A list of ASNs to block bad bot traffic on your Cloudflare firewall.
This repository provides a collection of ASNs (Autonomous System Numbers) that are commonly associated with malicious bots, crawlers, and other unwanted traffic sources.
Blocking these ASNs can help reduce unwanted activity on your website and improve its overall security and performance.
You can find the list of ASNs in the ASN.txt
file in this repository.
You can either download this file directly or copy the ASNs to use in your Cloudflare firewall.
To block traffic from these ASNs in Cloudflare:
- Log into your Cloudflare dashboard.
- Select the website you want to protect.
- Navigate to Security > WAF > Tools.
- In the IP Access Rules section:
- Select ASN from the dropdown menu under "IP, IP range, country name, or ASN".
- Paste the ASN from the list into the Value field.
- Under Action, choose Block to stop traffic from this ASN, or select Managed Challenge if you'd rather present a Captcha.
- Under Zone, choose either This website to apply the block to the current website, or All websites in account to apply the block across all domains in your Cloudflare account.
- (Optional) Add any relevant Notes to identify or describe the blocked ASN.
- Click Add to implement the block.
While blocking ASNs from known bad bots can be effective, it's important to regularly monitor your site's traffic and firewall logs.
Occasionally, legitimate users may share the same ASN as bad bots, so it’s a good idea to review and update the ASN list periodically to avoid blocking valid traffic.
If you have additional ASNs that are known to be associated with bad bots, feel free to contribute by submitting a pull request.
Ensure that the ASNs are thoroughly tested and verified to avoid false positives.
This list is provided as a tool to help mitigate bad bot traffic, but it is not a comprehensive solution.
Blocking by ASN is one layer of protection, and it’s recommended to use additional security measures for complete protection.