Example rules (2)
Last updated Jun 15, 2026
and rate limiting rule examples using threat intelligence fields. All fields are arrays — use any() with [*].
Caution
Test rules with Log before enforcing. IP-based threat intelligence is a seven-day lookback over shared infrastructure — combine with other signals such as attack score before you block.
Log matches before blocking
Deploy with Log (Enterprise plans) to review matches before enforcing:
- Expression:
any(cf.intel.ip.attacker_names[*] != "") - Action: Log
Review matches in Security Events, then change the action to Block or Managed Challenge.
Block DDoS participants targeting your region
- Expression:
any(cf.intel.ip.target_countries[*] == "FR") and any(cf.intel.ip.datasets[*] == "ddos") - Action: Block
Challenge a threat actor targeting the finance sector
- Expression:
any(cf.intel.ip.target_industries[*] == "Banking & Financial Services") and any(cf.intel.ip.attacker_names[*] == "BLACKBASTA") - Action: Managed Challenge
Filter by attacker country
- Expression:
any(cf.intel.ip.attacker_countries[*] == "CN") - Action: Block
Combine with attack score
Block requests flagged by the WAF threat intelligence dataset that also have a low attack score:
- Expression:
any(cf.intel.ip.datasets[*] == "waf") and cf.waf.score lt 20 - Action: Block
Rate limit threat actors on API paths
Rate limiting rule applying a stricter rate to flagged IPs on your API:
- Expression:
any(cf.intel.ip.datasets[*] == "ddos") and starts_with(http.request.uri.path, "/api/") - Action: Block when the rate is exceeded.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/waf/detections/threat-intelligence/example-rules/#page","headline":"Example rules","description":"Mitigate high-risk traffic using threat intelligence fields in WAF rules.","url":"https://developers.cloudflare.com/waf/detections/threat-intelligence/example-rules/","inLanguage":"en","image":"https://developers.cloudflare.com/waf/detections/threat-intelligence/example-rules/og.png?v=4b3ad8e9c93eb313","dateModified":"2026-06-15","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["Threat Intelligence"]}
description: Fields available for threat intelligence detection in rule expressions. title: Threat intelligence fields image: https://developers.cloudflare.com/waf/detections/threat-intelligence/fields/og.png?v=55ae843bb45d3b15
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/waf/llms.txt
Use this file to discover all available pages before exploring further.
Docs