6 points · by mwsherman · 16y ago · 5 comments
My instinct is to block the IP addresses, but I am concerned that it might have the effect of blocking legitimate customers. Maybe the abuser is sitting in a Starbucks, for example, and I wouldn't want to ban the people at the next table. Ditto for a corporate firewall.
What has your experience been? Is blocking IPs a bit too brute-force? Has it ever caused a customer complaint?
Thanks. - Matt
1. instead of blocking, throttle the IPs. Rate limit them to making no more than 1 request every 30 seconds or so. Most script kiddies get fed up if their attack gets painfully slow.
2. if you see a high rate of traffic coming from an IP, quarantine it for say 2-5 minutes (ie, block all traffic from it) and after that time throttle it.
3. If you notice patterns in the IPs, eg, they all come from the same block, then redirect those IPs to a different box (you can set up a VIP to do this). You can do what you want on this box (eg: don't bother opening database connections here), but the main thing is that your primary web server has all its resources available to serving legitimate customers.
4. Never give an attacker any indication that you've noticed their attack. It only makes it more fun for them and they'll persist longer. So, if you see abusive traffic, don't return a 404 or a 403. Just return a regular 200 with a cached version of your regular page.
My rule of thumb is to block small first, then wider based on the registrant of that IP. Russia and China seem to have the most spam-bots running (or at least the most aggressive), but as long as you block at the xxx.xxx.xxx level, you shouldn't impact actual users very much.
Like barredo said though, include some information on your 403 page.
Ban the IPs temporarily, say, a month, and put a message in your '403 forbidden access error page' saying sorry: "your ip is blocked because of weird-things-happening-from-your-ip, if you are a customer you should check for trojans or virus on your computer and send us an email"
Is this ideal? Of course not - bluesmoon's solutions are far more elegant. But how much time will it take me to code/manage those solutions over the next five years? Lots. How much more money will I have made as a result? Probably none. So I made the choice to be more aggressive but to be humble on my "You're blocked!" page and the customers that do call get it; they understand.
For a startup that doesn't yet know if they're going to make it big or not, it may well be worth it to delay the infrastructure and just put some heart behind it :)