Field “Known Bots” (cf.client.bot) not filtering hits correctly
What steps have you taken to resolve the issue?
Deployed a Custom Rule such as: (not cf.client.bot and ip.geoip.asnum in {8075})
What is the current SSL/TLS setting?
Full (strict)
What are the steps to reproduce the issue?
The Custom Rule filter associated with “cf.client.bot” is incorrectly tagging bad hits that should be blocked.
I am getting malicious hits from ASN 8075 and the filter is failing to apply the logic.
Here’s an example of one of the multiple requests that wen through and it shouldn’t.
We started by blocking all of AS8075 from ireland as it was 100% attack attempts then just scaled up to blocking AS8075 as its responsible for about 80%+ of the script kiddie attack attempts on our sites
But you can’t just block the entire ASN, because there are legitimate bot visits coming from Microsoft ASN such as BingBot visits or Microsoft Ads visits.
This is challenging because attackers are using an ASN that seems trustworthy (Microsoft) and has good bots, in a deceptive way.
Let’s see if Cloudflare support can bring some light to it.
I’ve also been having problems trying to block similar traffic.
I have a (http.user_agent eq "") rule but it only appears to block about half of the matching requests.
I have fixed the issue by implementing these changes:
Disable both fight mode
Move Redirect Rule (WWW to non-WWW) from Cloudflare to nginx rule
Changed “ip.geoip.asnum” to “ip.src.asnum”
And the explanation is simple. Bot fight mode in the free Cloudflare tier is very bad. If you have proper Custom Rules in the Firewall, these are much more effective than their “Bot fight mode”. Redirect Rules get evaluated before Custom Rules, so Cloudflare was redirecting WWW to non-WWW and not applying the Firewall Custom Rules to those hits. I moved the WWW redirect to my own server instead of Cloudflare. And finally, the “ip.geoip.asnum” for ASN blocking is deprecated. The correct expression is “ip.src.asnum”.