On this page13 sections
Short answer
How do you roll out WAF and bot rules without breaking production?
Deploy new rules in a non-blocking action first, review real events, write exceptions for legitimate traffic such as payment callbacks and partner integrations, and only then switch to a challenge or a block. Start on sensitive paths such as login and checkout, not site-wide. Where your plan has no Log action, size the rule in Security Analytics and start narrow.
Who this is for: platform and security teams turning on Cloudflare WAF, rate limiting, or bot protection for zones that carry real traffic. The method comes from our published migration playbook, and it belongs to the Onboarding stage of the four-stage delivery model.
Why observe first?
A rule that blocks the wrong request is an outage with a security label on it. Payment callbacks, partner integrations, and monitoring services often look like automation to a rule written against attack traffic. Observing first moves that discovery from a customer complaint to a log review.
Which actions does Cloudflare offer, and which plans have Log?
| Action | What it does (Cloudflare docs) | Terminating? |
|---|---|---|
| Log | Records matching requests in Cloudflare Logs; Enterprise plans only | No |
Non-Interactive Challenge (js_challenge) |
A challenge browsers can pass automatically | Yes |
Managed Challenge (managed_challenge) |
Chooses between a non-interactive and an interactive challenge | Yes |
Interactive Challenge (challenge) |
Asks the visitor to interact | Yes |
Block (block) |
Denies the request, usually with HTTP 403; rate limiting rules use 429 | Yes |
Skip (skip) |
Bypasses one or more security features for matching requests | No |
Cloudflare recommends Log for validating rules before a more severe action, but custom rules on Free, Pro, and Business support every action except Log. Managed rulesets are less clear: the Cloudflare Managed Ruleset page lists Log as an override action without a plan restriction, while the actions reference calls Log Enterprise-only. Check the action list in your own dashboard.
The WAF rollout runbook: observe, challenge, block
This is the WAF rollout runbook. Each phase has an exit condition and a rollback. Exit conditions are about evidence, not elapsed time: Cloudflare publishes no observation period, and a monthly billing run will not appear in a three-day window.
| Phase | Action | Exit condition | Rollback |
|---|---|---|---|
| 0. Scope | Choose sensitive paths first: login, checkout, API write endpoints | A written list of paths, each with an owner | None needed |
| 1. Observe | Log on Enterprise; on other plans, size the rule in Security Analytics and go live on a narrow scope | Every matching event classified as attack, legitimate, or unknown, with none unknown | Disable the rule |
| 2. Challenge | Managed Challenge on the same expression, plus exceptions | Legitimate clients still pass; no support tickets tied to the rule | Back to Log on Enterprise; otherwise disable or revert the rule |
| 3. Block | Block for the attack classes confirmed in phase 1 | Events after the change show only expected blocks | Back to Managed Challenge, or disable |
Only start phase 3 for rules whose matches you can classify. A rule whose events you cannot explain stays in phase 1 or 2.
How do you review events?
Cloudflare has two views. Security Analytics shows all traffic, whether or not Cloudflare acted on it, and does not count Log, Skip, or Allow actions as mitigated. Zone-level analytics are included on every plan, with up to 31 days of data on Free, Pro, and Business and up to 90 days on Enterprise; results are sampled by default. Security Events shows requests that any Cloudflare security product acted on or flagged, filterable by action, host, country, ASN, user agent, path, and IP, for up to 31 days on all plans; Free shows sampled logs only.
Review by rule, then by path, then by client. One rule matching many requests from one partner address is an exception candidate; the same rule matching a spread of unrelated addresses on a login path is likely the traffic you meant to catch.
Observing without Log on Free, Pro, and Business
Do not guess. In Security Analytics, enter the filters the rule would use, read the matching traffic as a population, refine the filters until you recognize every client, then select Create custom security rule to build the rule from them. Give it an action you can tolerate being wrong, such as a Managed Challenge on one path, and watch Security Events.
This is not equivalent to Log: historical filtering shows what traffic looked like, not what the rule will do next week, and a live challenge can reach a real visitor. Two plan limits shape the filters: bot score needs Bot Management on Enterprise, and attack score is unavailable on Free and Pro, with Business limited to the attack score class. Our practice, as in the playbook, is to go live on a low-risk subset first.
How do you write exceptions?
Two mechanisms exist. Skip rules bypass one or more security features for matching requests, such as passing a trusted API client through rate limiting or exempting a monitoring service from managed rules. They can skip managed rules, rate limiting rules, and Super Bot Fight Mode, but not Bot Fight Mode. Managed ruleset exceptions bypass managed rules under conditions, while overrides change a rule’s action or disable it; Cloudflare states that “Exceptions have priority over overrides.” Ruleset and tag overrides also apply to future rules; rule overrides affect existing rules only.
Cloudflare’s account-takeover guide says to create the skip rule first, so monitoring tools, health checks, and partner integrations are not blocked. Write each exception as narrowly as the evidence allows: path, method, and a stable client attribute such as a partner’s published address range. Record the owner and the reason in the rule description.
What changes for bot rules?
| Product | Plans | Rollout notes |
|---|---|---|
| Bot Fight Mode | Free | Cannot be skipped or customized |
| Super Bot Fight Mode | Pro, Business, and Enterprise without Bot Management | Cannot be customized with custom rules; may challenge API or mobile traffic; a Skip custom rule runs before it; with Tunnel, keep Definitely Automated on Allow to avoid websocket: bad handshake errors |
| Bot Management for Enterprise | Paid add-on | Bot score 1 to 99: 1 is automated, 2 to 29 likely automated, 30 to 99 likely human; act on it with custom rules or Workers |
Start bot rules where the harm is concentrated, such as login and checkout. Cloudflare defines verified bots as bots it has confirmed to be transparent about who they are and what they do. Its AI bot policies, available to all customers, can also block verified bots with matching behavior, and Cloudflare introduced new AI bot defaults for new domains from September 15, 2026, so check the current setting rather than inheriting it. Cloudflare recommends Managed Challenge for most WAF rules, but challenge pages do not work for AJAX or fetch requests: test API and mobile clients before enforcing.
What about rate limiting and detections?
Rate limiting rules are available on every plan, with 1, 2, 5, and 100 rules on Free, Pro, Business, and Enterprise. Free and Pro count by IP only; the maximum mitigation timeout is 10 seconds on Free, 1 hour on Pro, and 1 day on Business and Enterprise. The parameters page lists block, challenge, and log actions; Log remains Enterprise-only. Start with a generous threshold on one sensitive path and tighten from evidence.
WAF detections such as attack score and leaked credentials detection have no log-only mode: once enabled, they populate fields that rules and analytics use. Treat them as inputs to a rule, then follow the runbook for that rule.
How do you keep the rollout reversible?
- Keep the rules in Terraform: Cloudflare documents version control and rollback as purposes of its provider, so reverting a rule is a code revert and an apply.
- Give each rule a description with its owner, the date, and the phase.
- Change one rule’s action at a time and review events after each change.
- Name the person who may disable a rule quickly, and rehearse it.
What this article has not tested
- This article is built from Cloudflare’s documentation and the published method; it reports no results from a specific deployment.
- Whether managed-rule overrides offer Log on every plan; the documents disagree, as noted above.
- How challenge actions behave against specific API clients, mobile apps, or webhooks.
- Cloudflare Gateway policy rollout and API Shield.
FAQ
Can you run Cloudflare WAF rules in log mode on every plan?
Not for custom rules. Cloudflare documents the Log action as Enterprise-only, and custom rules on Free, Pro, and Business support every action except Log. On those plans, size the rule with Security Analytics filters, deploy it with a challenge on a narrow scope, and watch Security Events before widening it.
How long should you leave a rule in observe mode?
Cloudflare does not publish a fixed period. Leave a rule in observe mode until every matching event is classified as attack, legitimate, or unknown, and none is unknown. Traffic that repeats weekly or monthly, such as batch jobs and billing runs, must appear in the window before you move the rule to a challenge.
Should you go straight to Managed Challenge or Block?
Use Managed Challenge as the first enforcing step: it chooses between a non-interactive and an interactive challenge, and Cloudflare recommends it for most WAF rules. Reserve Block for attack classes you confirmed during observation. Test API and mobile clients first, because challenge pages fail for AJAX and fetch requests.
How do you let payment callbacks or partner traffic through?
Write a narrow Skip rule or a managed ruleset exception for that path and method, plus a stable client attribute such as the partner’s published address range. Skip rules can bypass managed rules, rate limiting rules, and Super Bot Fight Mode. Record the owner and the reason in the rule description, and review the exception periodically.
How do you roll back a rule that causes a problem?
Disable the rule, or move its action one step back: Block to Managed Challenge, or Managed Challenge to Log where the plan has Log. If the rule lives in Terraform, revert the commit and apply. Decide in advance who may do this, and rehearse it before enforcement, so the rollback does not wait for a meeting.
Sources
Checked against vendor documentation on How the articles are checked
- Rules language actions
- WAF custom rules
- Skip action
- Security Analytics
- Security Events
- Managed rules
- Cloudflare Managed Ruleset
- Rate limiting rules
- Rate limiting parameters
- WAF detections
- Attack score
- Feature interoperability (phase order)
- Bot Fight Mode
- Super Bot Fight Mode
- Bot Management
- Bot score
- Verified bots
- AI bot policies
- Challenge pages
- Stop account takeover attacks
- Cloudflare Terraform provider
- Migrating hundreds of domains to Cloudflare without downtime, section 5 (author’s original write-up)