ARTICLE - CDN, Security & Monitoring

Cloudflare WAF Threat Intelligence Rules

Turning intelligence fields straight into block conditions can widen false positives: Cloudflare aggregates activity by client IP across several days, and cross-field matches do not prove one event. Observe hits and account for shared egress before enforcement.

2026-08-05 Cloudflare Blog 49 views
Advertisement
Cloudflare WAF Threat Intelligence Rule Path Client IP Arrives at edge Intel lookup Rolling 7 days Populate fields Arrays or empty Rule match Custom / rate limit Rule action Log / enforce Requires Cloudforce One and WAF on the zone; unmatched IP fields are empty Different fields may come from different threat events for the same IP Source: Cloudflare threat intelligence docs; fields reflect a rolling seven-day window
Figure 1: Cloudflare WAF Threat Intelligence Rule Path (Source: Cloudflare's documented rolling seven-day IP intelligence fields and rule flow)

Cloudflare's cf.intel fields let WAF custom rules and rate limiting rules use Cloudforce One IP threat intelligence. They are not a static blocklist and do not mean that an IP is currently attacking your site: fields reflect intelligence activity for a client IP over a rolling seven-day window, and conditions across fields can combine values from different events. Deployment requires an active Cloudforce One subscription and WAF enabled on the zone; check matches in Cloudflare Security Analytics before enforcing a rule.

Field contents and matching scope

Cloudflare documents five array fields. If a client IP is not found in the threat intelligence database, these fields are empty. Values are case-sensitive.

Field Meaning Example value
cf.intel.ip.attacker_names Threat actor names associated with the IP BLACKBASTA
cf.intel.ip.target_industries Industries the IP has targeted Banking & Financial Services
cf.intel.ip.attacker_countries Source countries of activity, as ISO 3166-1 alpha-2 codes FR
cf.intel.ip.target_countries Countries the IP has targeted, as ISO 3166-1 alpha-2 codes FR
cf.intel.ip.datasets Dataset that flagged the IP; documented values include ddos and waf ddos

All fields are arrays. Use any() with [*] to check a value. This expression matches a client IP associated with activity targeting France and with the ddos dataset:

any(cf.intel.ip.target_countries[*] == "FR") and any(cf.intel.ip.datasets[*] == "ddos")

You should see a matching rule and event in Security Analytics after deployment; that confirms the rule evaluated, not that every value came from one event. Cloudflare says the values are flattened across the IP's activity during the previous seven days. Values in different fields do not have to come from the same threat event. Therefore, the and above does not prove that one event both targeted France and was labeled DDoS. Combining dimensions can match more traffic than expected; observe non-enforcing matches first and inspect Security Analytics. Shared NAT, proxy, or cloud egress IPs can also represent multiple users.

Observe first, then change the rule action

  1. Check prerequisites. The account needs an active Cloudforce One subscription, and WAF must be enabled on the zone. Do not assume the expression is available without both. If no matches appear, ask the Cloudflare account team to confirm subscription status.
  2. Create the rule. Filter and save relevant activity in Threat Events, then export it as a WAF rule; alternatively, enter an expression in a custom or rate limiting rule. Verify country codes, case, and the semantics of combining fields.
  3. Observe with Log. Cloudflare's getting-started steps recommend the Log action before enforcement. Review matches and event details in Security Analytics. Log availability depends on plan or product permissions; if the dashboard does not offer it, confirm account eligibility rather than substituting Block.
  4. Enforce only after review. Decide whether Block or Managed Challenge is appropriate after checking business traffic and shared-IP risk. Continue reviewing rule IDs, matching events, and application reports after the change; if the rule causes false positives, restore the observation action or disable that rule.

Do not use scanners, attack payloads, or third-party addresses to manufacture a match. Validate through authorized account events, saved views, and Security Analytics. Perform additional tests only in an environment you control and are authorized to test.

Protect existing rulesets when using Terraform

Cloudflare supports managing zone rules in the http_request_firewall_custom phase with the cloudflare_ruleset resource; the minimum listed permission is Zone WAF Write. First check whether that phase already has an entrypoint ruleset. Terraform manages the ruleset as a complete resource: import an existing ruleset and include its current rules in configuration before running terraform plan. Do not apply a new resource blindly or use an API PUT that replaces an existing entrypoint, since that can remove other rules.

After deployment, inspect matches in Security Analytics by rule and event. If there is no data, check the Cloudforce One subscription, WAF status, expression values, and action permissions. Change Log to an enforcement action only when the plan supports it and observation results justify the change.

Limitations

  • An active Cloudforce One subscription and WAF enabled on the target zone are prerequisites; an expression does not grant subscription access.
  • Fields reflect a rolling seven-day window of client-IP activity. IPs can be shared by NAT, proxies, or cloud egress, and a match stops when activity ages out.
  • An and across fields may be satisfied by values from separate threat events; it is not proof that those values co-occurred in one event.
  • Log availability depends on plan or product permissions. Terraform also requires importing and managing the complete existing ruleset state.
  • Threat intelligence is an additional signal, not a replacement for application patches, authentication, rate limiting, or defense in depth.

FAQ

How do I troubleshoot a cf.intel rule with no matches?

No matches do not prove the expression is wrong. Check the Cloudforce One subscription, WAF status on the zone, expression casing, and any() conditions. Fields cover activity for the client IP over the previous 7 days. If Security Analytics remains empty, ask the account team to confirm entitlement; do not broaden the rule or send requests to third-party addresses to force a match.

Can combined cf.intel fields widen the match scope beyond one event?

Not necessarily. Cloudflare flattens the IP's activity over the previous 7-day window into separate fields, so country, industry, or dataset values can come from different events. Combining fields can widen the match set. Observe with Log first, inspect event details in Security Analytics, and account for shared NAT or proxy addresses.

Can every Cloudflare plan use the Log action?

Do not assume so. Cloudflare's WAF custom-rules plan table limits Log availability, even though its threat intelligence setup recommends Log before enforcement. Confirm that the action is available on the target account. If it is not, ask the account team about eligibility; Block is not a safe substitute for an observation mode.

Can Terraform changes affect existing WAF rules in the dashboard?

Do not assume it will. A Terraform resource represents the full WAF ruleset state it manages, and the token needs Zone WAF Write permission. Import the existing entrypoint ruleset and include its current rules before applying, then inspect terraform plan for deletes or replacements. If unmanaged rules would be removed, stop and complete the configuration first.

Related Providers

  • Cloudflare WAF: deploy custom rules and review security analytics for a Cloudflare zone.
  • Cloudflare Security: review the wider Cloudflare security product scope beyond WAF.

References

Community & Resources

Original source: Cloudflare Blog ↗