Wondering how to create Cloudflare User-Agent Blocking Rules? We can help you.
These rules allow us to block any User-Agent strings that are found suspicious and work great in conjunction with the Browser Integrity Check feature.
Here at Bobcares, we often handle requests from our customers using Cloudflare to set up User-Agent blocking rules as a part of our Server Management Services.
Today we will see how our Support Engineers do this for our customers.
How to Create a User-Agent Blocking Rule
User-Agent Blocking allows us to block any preferred User-Agent string.
Furthermore, we can choose how to handle a matching request with actions like Block, JS Challenge, Captcha Challenge, and Whitelist.
However, we must keep in mind that the User-Agent Blocking (UA) rules apply to our entire zone, so we cannot specify sub-domains as we can with Zone Lockdowns.
Thus UA rules are applied after Zone Lockdown rules, thus permitting an IP address via Zone Lockdown skipping UA rules.
Steps to create User-agent blocking rule
Now we will see the steps that our Support Engineers follow to create these rules for our customers using Cloudflare.
1. Firstly, we have to log in to our Cloudflare Account.
2. Then we have to select the Domain to which we wish to add these rules to.
3. After that go to the Tools tab within the Cloudflare Firewall app.
4. Then click Create Blocking Rule under User-Agent Blocking.
5. Now, we have to enter the Name/Description.
6. And choose an applicable Action of either Block, Challenge (captcha), or JS challenge.
7. After that we can enter the User-Agent.
For example, to block the Bad Bot web spider we can enter as given below:
BadBot/1.0.2 (+http://bad.bot)
8. We must keep in mind that Wildcards (*) are not supported.
9.Finally we can click Save and Deploy.
[Need assistance? We can help you]
Conclusion
To conclude, we saw the steps that our Support Techs follow to create User-Agent Blocking rules for our customers.
0 Comments