Update custom rules for customers or partners
You may want to adjust your custom rules to increase access by customers or partners.
Potential examples include:
- Removing rate limiting for an API
- Sharing brand assets and marketing materials
Use ASN in custom rules
Section titled “Use ASN in custom rules”If a customer or partner is large enough, you could set up a custom rule based on an autonomous system number (ASN) ↗.
Allow traffic by ASN
Section titled “Allow traffic by ASN”This example uses:
- The
ip.src.asnum
field to specify the general region. - The
cf.bot_management.score
field to ensure partner traffic does not come from bots.
Example rule:
- Expression:
(ip.src.asnum eq 64496 and cf.bot_management.score gt 30)
- Action: Skip:
- All remaining custom rules
Adjust rules by ASN
Section titled “Adjust rules by ASN”This example uses:
- The
ip.src.asnum
field to specify the general region. - The
cf.threat_score
dynamic field to ensure requests are not high-risk traffic.
If a request meets these criteria, your custom rule skips User Agent Blocking rules.
- Expression:
(ip.src.asnum eq 64496 and cf.threat_score lt 14)
- Action: Skip:
- User Agent Blocking
Use IP addresses in custom rules
Section titled “Use IP addresses in custom rules”For smaller organizations, you could set up custom rules based on IP addresses.
Allow traffic by IP address
Section titled “Allow traffic by IP address”This example:
- Specifies the source IP address and the host.
- Uses the
cf.bot_management.score
field to ensure requests are not high-risk traffic.
Example rule:
- Expression:
(ip.src eq 203.0.113.1 and http.host eq "example.com" and cf.bot_management.score gt 30)
- Action: Skip:
- All remaining custom rules
Adjust rules by IP address
Section titled “Adjust rules by IP address”This example specifies the source IP address and the host.
If a request meets these criteria, it will skip rate limiting rules.
- Expression:
(ip.src eq 203.0.113.1 and http.host eq "example.com")
- Action: Skip:
- All remaining custom rules
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark