Linux: prevent outgoing TCP flood

Posted by Willem on Server Fault See other posts from Server Fault or by Willem
Published on 2012-10-19T10:30:21Z Indexed on 2012/10/19 11:07 UTC
Read the original article Hit count: 265

Filed under:
|
|
|

I run several hundred webservers behind loadbalancers, hosting many different sites with a plethora of applications (of which I have no control). About once every month, one of the sites gets hacked and a flood script is uploaded to attack some bank or political institution. In the past, these were always UDP floods which were effectively resolved by blocking outgoing UDP traffic on the individual webserver. Yesterday they started flooding a large US bank from our servers using many TCP connections to port 80. As these type of connections are perfectly valid for our applications, just blocking them is not an acceptable solution.

I am considering the following alternatives. Which one would you recommend? Have you implemented these, and how?

  • Limit on the webserver (iptables) outgoing TCP packets with source port != 80
  • Same but with queueing (tc)
  • Rate limit outgoing traffic per user per server. Quite an administrative burden, as there are potentially 1000's of different users per application server. Maybe this: how can I limit per user bandwidth?
  • Anything else?

Naturally, I'm also looking into ways to minimize the chance of hackers getting into one of our hosted sites, but as that mechanism will never be 100% waterproof, I want to severely limit the impact of an intrusion.

Cheers!

© Server Fault or respective owner

Related posts about linux

Related posts about networking