EC2 ELB and DOS attacks

amazon ec2ddosload balancing

I'm using Amazon's ELB to load balance between servers,

When my site is under attack by bots, everything is exhausted, so here is the problem

I can't block IP addresses with Amazon's security groups, because they don't explicitly allow "deny", so deny one IP you have to allow every other IP address which is tedious.

I can't use iptables to block IP addresses because ELB obfuscates the public IP addresses and replaces them with its own IP address.

The actual IP address of the visitors can only be seen in X-FORWARDED-IP

Best Answer

I don't believe this is doable in any other way then the one you've described on ELB level.

You could use firewall on each instance (in e.g. iptables) to block certain IP addresses, or even to set limit of connections per minute/second for IP address.

This way you could block attackers automatically.

Also you could use tools like Chef/Puppet to propagate your firewall config to each instance.

Related Topic