English 中文(简体)
How can I defend against DoS attacks using Amazon EC2 Load Balancer?
原标题:

We usually blacklist IPs address with iptables. But in Amazon EC2, if a connection goes through the Elastic Load Balancer, the remote address will be replaced by the load balancer s address, rendering iptables useless. In the case for HTTP, apparently the only way to find out the real remote address is to look at the HTTP header HTTP_X_FORWARDED_FOR. To me, blocking IPs at the web application level is not an effective way.

What is the best practice to defend against DoS attack in this scenario?

In this article, someone suggested that we can replace Elastic Load Balancer with HAProxy. However, there are certain disadvantages in doing this, and I m trying to see if there is any better alternatives.

最佳回答

I think you have described all the current options. You may want to chime in on some of the AWS forum threads to vote for a solution - the Amazon engineers and management are open to suggestions for ELB improvements.

问题回答

If you deploy your ELB and instances using VPC instead of EC2-classic, you can use Security Groups and Network ACLs to restrict access to the ELB.

http://docs.aws.amazon.com/ElasticLoadBalancing/latest/DeveloperGuide/USVPC_ApplySG.html

It s common to run an application server behind a reverse proxy. Your reverse proxy is layer you can use to add DoS protection before traffic gets to your application server. For Nginx, you can look at the rate limiting module as something that could help.

You could set up an EC2 host and run haproxy there by yourself (that s what Amazon is using anyways!). Then you can apply your iptables-filters on that system.

Here s a tool I made for those looking to use Fail2Ban on aws with apache, ELB, and ACL: https://github.com/anthonymartin/aws-acl-fail2ban





相关问题
Access particular server behind load-balanced tomcat

I m building production configuration where 2 tomcats are sitting behind the apache with load-balancer and mod_proxy. What I need is the script which checks whether particular instance of tomcat is ...

IIS 6.0 Load Balancing and ASP.NET In-Proc Session

We have three web servers in our web farm that are load balanced using the Network Load Balancing Manager in Windows 2003. The sites that run on these boxes use In-Proc ASP.NET session. Our ...

通过Java EE进行集群和负荷平衡

我想通过利用Java EE来发展集群和负荷平衡,我想在后端使用两个Tocats,如果我提出申请后,它应根据负荷向目录提出请求。

Assets Management in a clustered environment

I have a content management system running on a web server, that among others allows the user to upload assets like images, files, etc to the server. The problem i have is that there will be 2 ...

BizTalk server problem

we have a biztalk server (a virtual one (1!)...) at our company, and an sql server where the data is being kept. Now we have a lot of data traffic. I m talking about hundred of thousands. So I m ...

Outgoing load balancer

I have a big threaded feed retrieval script in python. My question is, how can I load balance outgoing requests so that I don t hit any one host too often? This is a big problem for feedburner, ...

热门标签