What options do we have realistically to filter out or block unwanted traffic?
What clever schemes can we come up that don't rely on centralised serices like Cloudflare?
What options do we have realistically to filter out or block unwanted traffic?
What clever schemes can we come up that don't rely on centralised serices like Cloudflare?
8 comments
Most of my filtering is just to keep the bots from clicking on some forms and excluding them from visitor logs. No problem with most crawlers. The bad ones are the ones that cycle through IPs, mimic agents, and space out their hits, they are the ones that clog my logs - some hit the same page multiple time (I assume some SEO tactic, which is not how my sites rank items).
My best bet might be IP filtering (restricting to US only) - wondering if any have implemented that (is that a big hit on page load time?), I would think with VPNs that doesn't always work that well...
Me: "Bro you reduced all traffic by 90%, my customers are pissed"
Personally I do not have an issue with bots as long as they behave and are not straight up malicious, so I rely on a combination of rate limiting, a fine-tuned OWASP CRS ruleset and an aggressive Fail2ban enforcement (hit 2 triggers and you get a 24 hour ban, 2 bans and you get banned for 30 days).
My sites also make extensive use of static elements and caching.
A real sustained DDoS would probably still require upstream handling by larger infrastructure than I run.
- https://fx.leftium.com/static
- https://www.youtube.com/shorts/tPfzNzy24to
---
I noticed most of the traffic to my hobby sites was bot traffic (probing for common vulnerabilities). So I added a robots.txt for well-behaved bots and rules for the bad ones. It works pretty well.
robots.txt: https://github.com/Leftium/robots-txt
Sample cloudflare rules: