WAF / DDOS protection for NLB?

Our company makes use of a NLB that fronts a series of EC2 instances so we can serve many thousands of websites, each with their own unique SSL certificate. The certificates (and associated NGINX conf files) are distributed to each EC2 instance, and are synchronized when new instances are added to the NLB-fronted cluster during scaling. This setup works very well for us, but the one downside is a lack of DDOS protection for the EC2 instances. Ideally we would put our entire setup behind WAF, but WAF is not NLB compatible and we are unable to use an ALB due to the number of certificates we have to maintain. It would be possible to move to multiple ALBs with SAN certs to cover all our domains, but the complexity of that setup seems to outweigh the benefits for our use case.

So - what are some of the best options for adding DDOS protection to a NLB-fronted EC2 cluster? Ideally the protection would come into place at / above the NLB itself, but if needed we could handle this in software at the EC2 level. In that case we would want some kind of “centralized” option where one EC2 instance could act as “master”, keeping all the EC2 instances in-sync WRT any IPTables blocks that may be issued.

Thx in advance for any ideas!

Seeing as ALB doesn’t fit would you consider a 3rd party WAF/LB solution? You could either build something using Nginx, HAProxy, etc, or consider something like this: https://www.snapt.net/platforms/nova-adc

Disclaimer: I work at Snapt, but you can use Nova for free.

Would aws advance shield work for you, it has DDOS protection and works with NLBs
https://aws.amazon.com/about-aws/whats-new/2017/11/aws-shield-adds-advanced-ddos-protection-for-ec2-and-network-load-balancer/

I don’t have an answer for you, but I upvoted because we had this problem on a smaller scale and our solution was multiple ALBs until we reduced the number of sites we host and requested an increase to the TLS certs allowed on our ALB (but it’s still too low for your needs).

I’m not sure if the AWS Guard Duty is capable of detect DoS/DDoS, but if so, I would suggest to create a integration of it with the VPC Network ACL for blocking/unblocking IPs and IP ranges.

If money is not a problem Shield Advance is the way to go for NLB, but 3k/Month is a steep price.

If you want to stay all-AWS, AWS Shield Advanced is expensive but will do what you need. I would recommend pricing out some other DDoS protection providers as well; for many use cases CloudFlare in particular is much cheaper. (I can’t say for sure here since it really does depend on the specifics of your setup.)

I’m guessing that won’t fly with the ones paying the bills, but it’s a good option to at least mention to them.

We probably wouldn’t want to remove our existing NLB but placing a box upstream is an option. Ideally the HTTPS certs would not be required at that top level so we can avoid having to farm out those certs to another set of hardware.

When we implemented this years ago I figured we would just wait and eventually AWS would add WAF support for the NLB, or some kind of cert pass-thru for the ALB. No luck yet.

Interesting idea. I’ll look into it.

You can also use CloudFlare for antiddos and Network ACLs to block everything but CloudFlare ips

You could always have the NLB in front of an ALB that has WAF running on it?

AWS promotes Shield Advanced as the go-to protection for DDoS (not surprisingly). https://docs.aws.amazon.com/whitepapers/latest/aws-best-practices-ddos-resiliency/aws-best-practices-ddos-resiliency.pdf

If you want to go the WAF route you’ll have to terminate the HTTPS traffic at the edge. Otherwise the WAF will not be able to inspect the request that might contain a malicious payload.

But what is the problem with just adding the certificates you are already using to ACM and then adding them to a Cloudfront distribution that sits in front of your NLB? Managing the certificates within ACM should be easier than managing them by yourself.

WAF isn’t “really” the “right” product for DDOS protection. You are probably best using AWS Shield which is specifically built for DDOS protection.

Shield advanced is an option or if you can find a way to make the sites work behind CloudFront then you get Shield basic for free (plus CloudFront costs).

Guard Duty is not capable of this.

Is it possible front these websites via a Cloudfront distribution?

Ooo. Interesting idea. How would you do that for NLB though ?

Maybe. Managing them locally is already working, so offloading all that to ACM would require rewriting the issuance / activation process. Its not impossible, but we are talking thousands of certs. And we are using LetsEncrypt which has a 3 month expiration, so the churn on the certs is pretty significant. We are replacing many hundreds of certs a month, but after the initial setup I suppose that doesn’t matter much since it would be automated.

Sent a PM!