Back to Cloudflare

Tune the WAF With Evidence Instead of Guesswork

November 4, 2026 Updated November 6, 2026 Wasil Zafar 29 min read

Build managed and custom policies with observable false positives

Table of Contents

  1. Threat Models and the WAF's Inspection Boundary
  2. Managed Rules and Custom Expressions
  3. Challenges, Blocks, and Narrow Exceptions
  4. Security Center Findings and Event Evidence
  5. Create a WAF Policy for a Controlled Test Application
  6. Compare Allowed and Denied Requests With Correlated Events

Threat Models and the WAF's Inspection Boundary

A customer pastes a browser error into your refund form. The error text contains <script>, because that is what the browser printed. The form submits, Cloudflare answers with a 403, and your support queue receives: "checkout is broken." Nothing in the application failed. A rule matched a string that is dangerous in one context and ordinary text in another, and nobody in the loop can see which rule fired or why.

That ticket is this article in miniature. The WAF decided from evidence it could see, and the evidence was incomplete in a way the rule author could not observe. Tuning is the work of narrowing that gap without pretending it closes.

Three terms carry the rest. Managed rules are rulesets Cloudflare writes, versions, and updates; you deploy them and adjust their behavior, but you do not author the signatures. Custom rules are expressions you write against request fields, with an action you choose. An action is what happens on a match: block, challenge, log, or skip a later security feature.

The analogy that keeps them apart is a customs checkpoint. The published contraband list is the managed ruleset: same list at every port, maintained by someone else, deliberately broad. The venue's own no-entry list is your custom rules. The officer works one list, then the other, and the first "no" ends the conversation.

Inspection boundary is the phrase to hold on to, and it has two halves. The first is what the edge can read: method, the URL as rewritten, headers, TLS and network metadata, and a window of the request body. The second is what it cannot recover: whether those bytes are valid for your schema, whether the caller is authorized, whether a field is a free-text note or an executable template. A signature engine sees bytes. Your application sees meaning.

Three facts follow, and every later decision rests on them.

  1. Signatures detect known shapes, not invalid intent. A quote character inside a SQL comment and a quote character inside a blog post are the same two bytes on the wire.
  2. Visibility is finite. Managed rules inspect a body window whose size depends on the plan: 128 KB on Enterprise, a lower default on other paid plans, and up to 1 MB on Free (Managed Rules). Bytes past the window are not analyzed, and http.request.body.truncated is how you find out that a request was cut short.
  3. Order is policy. A terminating action in an earlier phase means later phases never run for that request, so two rules that look independent can be in a strict sequence.

Figure 1 traces one request through those phases and shows the two exits: the request either leaves the pipeline with a terminating action, or continues to the origin with whatever earlier phases left behind.

Threat Models and the WAF's Inspection Boundary
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','titleColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    REQ["Request arrives
method, URL, headers, body bytes"] --> RW["URL Rewrite already applied
custom rules see the new path"] RW --> CR{"Custom rules
http_request_firewall_custom"} CR -->|"match: block / challenge"| TERM["Terminating action
no later phase runs"] CR -->|"match: log, or skip managed phase"| RL{"Rate limit
http_ratelimit"} CR -->|"no match"| RL RL -->|"limit exceeded"| TERM RL -->|"within limit"| MR{"Managed rules
http_request_firewall_managed"} MR -->|"phase skipped by earlier rule"| ORIG["Origin"] MR -->|"exception listed before execute"| SKIP["Single rule or ruleset skipped"] SKIP --> ORIG MR -->|"rule matches"| ACT["Ruleset action
block / challenge / log"] ACT -->|"terminating"| TERM ACT -->|"log"| ORIG MR -->|"no match"| ORIG classDef primary fill:#132440,color:#ffffff,stroke:#0b172b; classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a; classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f; classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420; classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f; class CR,MR,ORIG primary; class REQ,RW,TERM,RL,SKIP secondary; class ACT danger;

Figure 1 also explains a common bug report: a request that "should" have hit a managed rule returned 200 because an earlier rule skipped the managed phase, or because it matched the rewritten path rather than the visible URL.

Figure 2 draws the same boundary as layers, because the layers are what the rule types can actually address. Network and TLS identity sit at the outside. Request metadata sits in the middle. Body inspection is a window with a hard edge. Detection scores are derived signals that exist only on some plans.

What the WAF can inspect at the edge and what stays opaque A request passes from the browser into the Cloudflare edge, where network identity, request metadata, a plan-dependent body window, and derived detection scores are visible. Application intent, authorization state, and schema validity are not visible and remain behind the origin boundary. The edge sees bytes and metadata; the origin sees meaning Browser method, URL, headers, body after any rewrite Cloudflare edge: fixed phase order Network and TLS identity IP, ASN, country, TLS metadata Request metadata method, rewritten path, headers, cookies Body window (plan-dependent) 128 KB Enterprise, less on other paid plans, up to 1 MB Free; truncated bodies are flagged Derived signals attack score, bot score: plan and add-on gated cut Origin sessions, schema, authorization, business rules Not visible at the edge: intent, field semantics, post-login state

Unobserved is not low risk

A payload past the inspection limit is not low risk; it is unobserved. That is why the same rule can look effective in a small-payload test and leak in production.

Managed Rules and Custom Expressions

Three deployable rulesets, three designs. They are not interchangeable, and the choice changes what a false positive means and who is allowed to fix it.

Cloudflare Managed Ruleset. Signature-based, covering known CVEs and attack vectors. It is updated frequently and ships some rules disabled by default to hold the false-positive rate down.

Cloudflare OWASP Core Ruleset. Cloudflare's implementation of the ModSecurity Core Rule Set 3.3.0, and it scores instead of matching. Every matching rule adds to a request threat score, and one aggregate rule applies the configured action once the total crosses the threshold.

Cloudflare Free Managed Ruleset. Available on every plan and covering widely exploited vulnerabilities, but a subset rather than a replacement.

Availability filters the design first. Free zones get the Free Managed Ruleset only, while the Cloudflare Managed Ruleset and the OWASP Core Ruleset need Pro or above. Account-level deployment, Sensitive Data Detection, and payload logging are Enterprise, and the Rules language reference lists the Log action as Enterprise-only (Actions).

Custom rules are universal; the ceiling is not. Free allows 5 custom rules, Pro 20, Business 100, and Enterprise 1,000. Regex support starts at Business. Zone-level custom rulesets exist on every plan; account-level custom rulesets are Enterprise only.

Budget the narrowness. A tuning strategy that assumes unlimited narrow rules becomes a budgeting problem at 20.

The table separates the three tools by the thing that actually differs: who owns the change, and how far a change reaches.

DimensionManaged rulesetCustom ruleWAF exception
Who authors the match logicCloudflare security team; you deploy and overrideYou, in the Rules languageYou, as a skip expression plus a target
What it matches onCurated signatures, tags, and OWASP scoresAny supported request field, including bot score and attack scoreRequest fields only; the target is a ruleset or rule ID
Update cadenceCloudflare adds and retunes rules continuouslyOnly when you edit the ruleOnly when you edit the exception
Blast radius of one changeRuleset-wide or tag-wide overrides can cover rules added laterOne rule, in list orderEvery request matching the expression, for the named target
Plan floorFree ruleset on all plans; Cloudflare Managed and OWASP from ProAll plans, with rule caps and no Log below EnterpriseAll plans; scope rules differ at account level
Failure signatureSudden multi-path false positives after a ruleset updateA rule that never fires, or fires on the wrong pathCoverage hole that no rule reports

The worked comparison is the CMS code-editor field from the opening. A page editor accepts HTML fragments, so a legitimate POST body contains <script> inside a JSON string. Three fixes are available, and they are not equivalent.

FixScope of the changeBlast radiusWhat it costs
Disable the ruleStatus off for one rule IDEvery path in the zone, including the attack the rule was written forThe detection disappears and no event reports it
Override the tagAction or status for a tag such as xssExisting and future rules carrying that tagReads like a narrow fix, behaves like a policy change
Add a WAF exceptionSkip expression plus a target rule IDEvery request matching the expression, for that rule onlyNarrowest control available, still wider than the field it protects

The exception is the only option that names one rule. Read it as three narrowing clauses — host, method, path prefix — plus a target. The configuration below is the same change expressed as a ruleset entry, with a dry run before the write.

# Skip one rule ID for one host, method and path prefix.
# Target `rules`, not `ruleset`, so the rest of the ruleset keeps running.
resource "cloudflare_ruleset" "cms_html_exception" {
  zone_id = var.zone_id
  name    = "cms html field exception"
  kind    = "zone"
  phase   = "http_request_firewall_managed"

  rules {
    action = "skip"
    action_parameters {
      ruleset = "current"
      rules   = [var.cms_xss_rule_id]
    }
    expression  = "http.host eq \"cms.example.com\" and http.request.method eq \"POST\" and starts_with(http.request.uri.path, \"/admin/pages/\")"
    description = "Compensating control for the HTML editor field"
    enabled     = true
  }
}
# The same exception through the API, validated before it is published.
curl -sS -X PUT \
  "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/phases/http_request_firewall_managed/entrypoint?dry_run=true" \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -H "Content-Type: application/json" \
  --data @cms-exception.json | jq '.success, .errors'

A compensating control, not a fix

The WAF cannot address the field named body_html. An exception unblocks the request; it does not validate the input. Application-side validation of that field is the actual fix, and it belongs in the backlog rather than in the WAF.

Signatures ask about shape; schemas ask about meaning. This is where attack signatures and application-specific validation diverge. A signature asks whether a request looks like a known attack. A schema or application check asks whether it is the shape the endpoint accepts, and that question is answerable only where the schema is known.

Application Profiles models that schema. Cloudflare's Application Profiles product models supported fields, types, formats, and ranges per operation and classifies non-conforming requests without matching a signature (Application Profiles). It is a closed beta for invited Enterprise customers at verification time, so treat it as a direction, not a plan assumption.

What every plan can do today is encode the contract as a custom rule. A JSON endpoint that only receives POST with a JSON content type need not accept a GET whose query string looks like SQL.

Figure 3 shows the execution detail that decides whether any of these controls work: exceptions and overrides are evaluated in list order inside the managed phase.

Managed Rules and Custom Expressions
%%{init: {'theme':'base','themeCSS':'.edgeLabel .label text, .edgeLabel text, .edgeLabel span { fill:#132440 !important; color:#132440 !important; }','themeVariables': {'primaryColor':'#16476A','primaryTextColor':'#ffffff','primaryBorderColor':'#132440','secondaryColor':'#3B9797','secondaryTextColor':'#ffffff','secondaryBorderColor':'#132440','tertiaryColor':'#c4873b','tertiaryTextColor':'#132440','tertiaryBorderColor':'#132440','lineColor':'#5a6e82','textColor':'#132440','mainBkg':'#16476A','nodeBorder':'#132440','clusterBkg':'#eef3f7','clusterBorder':'#132440','edgeLabelBackground':'#ffffff','actorBkg':'#16476A','actorTextColor':'#ffffff','actorBorder':'#132440','activationBkgColor':'#3B9797','activationBorderColor':'#132440','signalColor':'#5a6e82','signalTextColor':'#132440','noteBkgColor':'#c4873b','noteTextColor':'#132440','noteBorderColor':'#132440','labelBoxBkgColor':'#a8dede','labelBoxBorderColor':'#132440','labelTextColor':'#132440','loopTextColor':'#132440','altBackground':'#f8f9fa','fontFamily':'DM Sans, sans-serif'}}}%%
flowchart TD
    E["Managed phase entry point
rules evaluated in list order"] --> S{"Skip rule listed
before the execute rule?"} S -->|"no, listed after"| N["Nothing skipped
execute already ran"] S -->|"yes"| X{"Skip scope"} X -->|"ruleset"| A["Every rule in that ruleset bypassed"] X -->|"rule IDs"| B["Only those rules bypassed"] X -->|"all remaining"| C["Every later execute rule bypassed"] N --> O{"Rule match?"} A --> O B --> O C --> O O -->|"yes"| P{"Effective action"} P -->|"override: log"| L["Event recorded
request continues"] P -->|"override: disabled"| Q["No event
request continues"] P -->|"default: block or challenge"| T["Terminates before origin"] O -->|"no"| Z["Request reaches origin"] classDef primary fill:#132440,color:#ffffff,stroke:#0b172b; classDef secondary fill:#16476A,color:#ffffff,stroke:#0f314a; classDef ok fill:#3B9797,color:#ffffff,stroke:#2a6f6f; classDef danger fill:#BF092F,color:#ffffff,stroke:#7a0420; classDef warn fill:#c4873b,color:#132440,stroke:#8a5a1f; class T,Z primary; class E,S,N,X,O,P,L,Q secondary; class A,B,C danger;

Two branches in Figure 3 are silent failures. A skip rule appended after the execute rule does nothing, and a disabled rule produces no event at all, so a dashboard that only counts events will report health while the rule is off.

Challenges, Blocks, and Narrow Exceptions

Actions differ in what the client experiences, and the difference is operational. One member of the group is safe before you trust a rule; the others end the request.

ActionWhat the client getsTerminates the requestSafe before you trust the rule
BlockAn error page with a 403 for most security productsYesNo
Managed ChallengeA non-interactive or interactive challenge, chosen per requestYesNo
Non-Interactive ChallengeThe js_challenge mechanism, forcedYesNo
Interactive ChallengeThe interactive mechanism, forcedYesNo
LogNothing visible; the match is recorded and the request continuesNoYes

Block and challenge are a question about the client. A browser can solve a challenge; a cron job, a mobile SDK, a payment webhook, and a partner's API client cannot. Putting a challenge in front of machine traffic converts a security decision into an availability incident, and the first symptom is usually a support ticket that says "your API returns HTML."

Narrowing an exception is a discipline with four parts. Name the host. Name the method. Name the smallest path prefix that contains the false positive. Then add one more discriminator that the attack would not satisfy, such as the content type, an argument name, or a required header. Skip the specific rule ID rather than the ruleset, and never skip the whole managed phase for a prefix that also serves real attack surface. Where a plan exposes the Log action, stage the change there first and read the events before switching the action; where it does not, scope the execute rule to a canary hostname so the blast radius is one hostname rather than the zone.

A 200 is not proof the exception is narrow

Replaying the false-positive request and getting a 200 proves the exception matched. It does not prove the exception is narrow. Send the actual attack payload to the same path through a different parameter, from a different method, and from a sibling path outside the prefix. If any of those now succeeds, the exception is a bypass, and you have moved the vulnerability rather than the rule.

Scope compounds the mistake. A zone-level exception does not affect account-level rules, and account-level rulesets run first within a phase, so an exception that looks correct in the zone view can be bypassed a level up. Exceptions also apply to managed rulesets only; skipping Browser Integrity Check, Zone Lockdown, or User Agent Blocking needs a custom rule with the skip action and the specific product selected.

Security Center Findings and Event Evidence

Security Insights are heuristics, not assertions. The findings once labelled Security Center now appear as Security Insights, and their construction matters more than the name: they are periodic heuristics. Two are directly relevant, "Managed Rules not deployed" and "Zones without WAF Managed Rules". Both have documented limitations. A zone protected by an account-level deployment can still be reported as unprotected, and a managed rule set to Log mode can still produce a vulnerability insight because it is not blocking. The documentation says to archive the insight when the configuration is intentional (Security Insights).

Two products answer two different questions. Security Events shows requests that a security product acted on or flagged, and it counts events rather than requests, so one request that trips three features appears three times. Security Analytics shows all incoming requests, including those nothing acted on, with 90-day retention on Enterprise and 31 days elsewhere. Both dashboards use sampled data, and the documentation warns that pagination in Security Events may not be reliable because the source data is sampled. If you need numbers you can defend, use the GraphQL Analytics API against firewallEventsAdaptive, and state the sampling caveat next to the number.

Three documented gaps in the evidence

OWASP hits are partly invisible to export. Triggered OWASP rules appear under Additional logs in Security Events but are not included in exported JSON files, so an analysis built on exports will systematically undercount the OWASP ruleset.

Payload logging is Enterprise-only. It records the matched string, so on lower plans you often know which rule fired but not which substring caused it, and "is this a false positive?" becomes inference from the path and parameter.

Event export is capped at 500 events. A busy zone cannot reconstruct a day of evidence from the dashboard.

Prioritize by rate, not by raw count. Group events by rule identifier and path over a fixed window, divide by request volume for the same window, and treat the ratio as an estimate. Ranking by raw event count rewards rules that sit on high-traffic paths, which is the opposite of prioritization.

query WafEvidence($zoneTag: String!, $since: Time!, $until: Time!) {
  viewer {
    zones(filter: { zoneTag: $zoneTag }) {
      # Matched events, grouped by rule and path.
      firewallEventsAdaptiveGroups(
        limit: 100
        filter: { datetime_geq: $since, datetime_leq: $until }
        orderBy: [count_DESC]
      ) {
        count
        dimensions { ruleId clientRequestPath action }
      }
      # Denominator: all requests in the same window.
      httpRequestsAdaptiveGroups(
        limit: 1
        filter: { datetime_geq: $since, datetime_leq: $until }
      ) {
        count
      }
    }
  }
}
# Send the query with a fixed window; keep the raw JSON as the evidence record.
curl -sS https://api.cloudflare.com/client/v4/graphql \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -H "Content-Type: application/json" \
  --data "$(jq -n --arg z "$ZONE_ID" --arg s "$SINCE" --arg u "$UNTIL" \
    --rawfile q evidence.graphql \
    '{query: $q, variables: {zoneTag: $z, since: $s, until: $u}}')" \
  | jq '.data.viewer.zones[0]'

The clearest documented case study of this tradeoff is Cloudflare's own. On 5 December 2025 the company raised WAF payload inspection to 1 MB across all plans to catch a React RCE payload shape. The same-day follow-up reversed it: the automatic rollout "proved impractical because the increase led to a surge in false positives for existing managed rules," notably in the Cloudflare Managed Ruleset and the OWASP Core Ruleset. Inspection went back to 128 KB on Enterprise, with 1 MB available on request for paid zones, while Free zones kept the larger window (payload limit update, original change). The lesson is not that the change was wrong; it is that inspection depth is a tuning parameter with a false-positive bill, and the bill arrives in the same change window.

Alerts are where evidence degrades into noise. Security Events alerts start at Business, with advanced alerting on Enterprise. Alert on a rate change or on a rule ID you have never seen rather than on each event, and never page on a Log rule, because a log-only rule is not mitigating anything.

Figure 4 contrasts the two paths teams take after a finding. The upper lane produces a narrow, testable change. The lower lane produces a confident-sounding decision with no evidence behind it, and it usually ends in a blanket disable.

Two paths from a security finding: evidence versus guesswork The evidence path moves from an alert to a specific event, then to a rule identifier and path, then to a narrow exception with a negative test. The guesswork path moves from a sampled count to a top-rule ranking, then to a blanket disable, ending in an unreported coverage hole. Same finding, two very different next moves EVIDENCE Alert or insight rate change, new rule ID One event opened request, action, path Rule ID + field payload log if available Narrow exception plus negative test GUESSWORK Sampled total one number, no request Top-rule ranking volume, not impact Blanket disable whole ruleset or tag Coverage hole no event reports it Break points on the lower lane: sampling without a query window, OWASP hits missing from exports, no payload log below Enterprise.

The lower lane in Figure 4 is not a strawman. It is the rational move when a dashboard gives you a number and no request, and it is why evidence quality is a tuning prerequisite rather than a reporting nicety.

Create a WAF Policy for a Controlled Test Application

The exercise below is a design-only walkthrough: no zone, ruleset, or request was created, and the expected observations are documented behavior rather than measurements. It is written for a reader on Pro or above, with notes where Free changes the path.

The goal is a policy you can defend: one managed ruleset scoped to a lab hostname, one log-or-challenge stage, one narrow exception, and a negative test proving the exception did not open a bypass.

The lab is three calls: read the entry point, validate the write, then publish it. The HCL below is the intended end state; the shell panel checks it without publishing anything.

# One execute rule, scoped to the lab hostname only.
resource "cloudflare_ruleset" "waf_lab_managed" {
  zone_id = var.zone_id
  name    = "waf lab managed phase"
  kind    = "zone"
  phase   = "http_request_firewall_managed"

  rules {
    action = "execute"
    action_parameters {
      id = var.cloudflare_managed_ruleset_id
    }
    expression  = "http.host eq \"waf-lab.example.com\""
    description = "Execute the Cloudflare Managed Ruleset on the lab host only"
    enabled     = true
  }
}
# Read the current entry point so you know the existing rule order.
curl -sS \
  "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/phases/http_request_firewall_managed/entrypoint" \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  | jq '.result.rules[] | {id, action, expression}'

# Validate the same write without publishing it.
curl -sS -X PUT \
  "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/rulesets/phases/http_request_firewall_managed/entrypoint?dry_run=true" \
  -H "Authorization: Bearer $CF_API_TOKEN" \
  -H "Content-Type: application/json" \
  --data @managed-phase.json | jq '.success, .errors'
Guided exercise

Create a WAF Policy for a Controlled Test Application

Execution status: design-only. No Cloudflare zone or ruleset was deployed and no request was sent. Expected results below come from the documentation cited in this article, not from a hosted run.

Prerequisites. A zone you control with a hostname you can afford to break, for example waf-lab.example.com, proxied through Cloudflare. An origin or Worker that echoes the method, path, headers, and body length so you can tell "blocked at the edge" from "reached the origin and failed." A scoped API token with Zone WAF Write and analytics read access, plus curl and jq. Plan notes: the Cloudflare Managed Ruleset and the OWASP Core Ruleset need Pro or above; Free can substitute the Free Managed Ruleset and cannot use the Log action.

Minimal setup.

  1. Create the lab hostname and confirm it is proxied. A grey-clouded record bypasses everything you are about to test, and the failure looks identical to a rule that did not deploy.
  2. Read the managed-phase entry point with the first call in the shell panel above. Save the entry point ruleset ID and note the position of any existing execute rule.
  3. Validate the intended change without publishing it by appending the dry-run flag to the Rulesets API write. The dry run performs the same authorization and server-side validation as the real write and returns a null result on success.
  4. Deploy the Cloudflare Managed Ruleset scoped to the lab host: an execute rule whose action parameters name the managed ruleset ID, with an expression for the lab hostname.
  5. If your plan exposes Log, override the action for a single rule you intend to study rather than for the whole ruleset, and record the rule ID. If it does not, set the ruleset action to Managed Challenge so a match is visible without a hard block.
  6. Send the five requests in the table below and record the status, the cf-ray header, and whether the origin echo appeared.
  7. Add one narrow exception for the case that was mitigated: host plus method plus the smallest path prefix, targeting the single rule ID rather than the ruleset. If the HTML fragment was not flagged, substitute a payload you know trips a rule on a path you can isolate, so the exception has a target. Place it before the execute rule in the entry point list.
  8. Repeat step 6 unchanged, then add the negative test: send the SQL-injection and XSS payloads to the same path through a different parameter, from a different method, and from a sibling path outside the prefix.

Expected observations.

RequestPayload shapeExpected observation
Benign JSON POSTParses cleanly, no attack markersReaches the origin; no block event
HTML fragment in a text fieldScript syntax inside a JSON stringRuleset-version dependent; record whether it fired
SQL-injection-shaped query stringInjection syntax in a parameterBlocked, with a rule ID visible in Security Events
XSS-shaped query stringScript syntax in a parameterBlocked, with a rule ID visible in Security Events
Oversized bodyPayload placed past the inspection windowReaches the origin; the truncation field explains the miss

The HTML fragment row is the one that changes with the ruleset version in your zone. Record the result rather than assuming it, and treat a payload past the window as a documented limit rather than a rule failure.

Failure checks.

  • A 200 for every request means the execute rule never deployed or the hostname is not proxied.
  • A 403 for everything means the scope expression is broader than the lab host.
  • A false-positive fix that also unblocks the injection test means the exception is too wide, not that the test is wrong.
  • A missing event for a rule you know matched usually means the rule is disabled or the request was skipped earlier in the phase.

Cost. One zone, minimal request volume, no paid add-on required for the core path. The real cost dimension is the plan floor for the rulesets you want to test and any Enterprise-only feature such as payload logging; do not assume those are included.

Cleanup. Delete the execute rule and the exception from the entry point, or restore the entry point definition captured in step 2. Confirm with a final GET that the rules array matches the original. Remove the lab hostname if it was created for this exercise, and revoke the scoped token.

The exercise is deliberately small. Its value is the fourth step and the eighth: one proves the rule works, the other proves the exception did not undo the protection somewhere else.

Compare Allowed and Denied Requests With Correlated Events

Pass/fail evidence for the exercise, recorded per request rather than per dashboard total:

  • Pass: the benign JSON request returns the origin's 200 with a cf-ray header and an origin echo, and no security event with a block action is recorded for that ray ID.
  • Pass: the request that was mitigated before the exception reaches the origin after it, with the same path and method in both cases, so the only variable is the exception.
  • Pass: the injection-shaped requests are still blocked after the exception, including when the payload moves to a different parameter, method, or sibling path.
  • Pass: the oversized-body request reaches the origin, and the truncation field explains why the payload past the window was not seen.
  • Fail: an exception that fixes the false positive and also clears the injection test. The coverage hole is real even though every user-facing check looks green.
  • Fail: a rule that never produces an event because an override disabled it. Absence of events is not evidence of absence of traffic.
  • Inconclusive: a block with no visible rule ID because the plan's event detail or sampling prevents attribution. Narrow the query window before concluding the rule is wrong.

Self-check, with explanations:

  1. Why did the exception seem to work in the dashboard but not in production? A zone-level exception cannot skip an account-level deployment, and account-level rules run first within a phase. Check both scopes before editing the zone.
  2. Why did the same rule block one request and pass an almost identical one? Body inspection is a window. If the payload sits past the limit, or the request was truncated, the signature never sees it, and http.request.body.truncated is the field that tells you so.
  3. Why did switching the rule from Log to Block cause an outage on an API path? A challenge or block is a terminating action for machine clients that cannot solve a challenge. The action has to match the client type, not just the threat.
  4. Why did the OWASP rule count look low in the exported data? OWASP-triggered rules appear under Additional logs but are excluded from exported JSON files. Export-based analysis undercounts them, which is a measurement artifact rather than a drop in attacks.

Unresolved limitations. Documentation was verified on 2026-11-04 against the pages cited below; the planning baseline was 2026-11-02, and no exercise was executed, so no hosted result, no plan-specific result, and no measured false-positive rate is claimed. No product versions were tested; ruleset versions and rule IDs quoted here are those published at verification time and can change. The availability of the Log action is inconsistent across pages: the Rules language reference calls it Enterprise-only, while the managed rules configuration pages list Log among override actions without a plan note, so verify it in your own zone before designing a log-only rollout. Body inspection limits are plan-specific and changed twice in December 2025; confirm the current value rather than relying on any article, including this one. Plan entitlements, quotas, and retention windows change; re-check them for your account. Sampling means dashboard counts are estimates, and the OWASP export gap means exports are incomplete by design. Application Profiles was a closed beta at verification time, so its availability and pricing are not guaranteed.

References: Cloudflare WAF, Managed Rules, Cloudflare Managed Ruleset, OWASP Core Ruleset concepts, Create exceptions, Add an exception via API, Custom rules, Skip options, Security features interoperability, Rule phase interactions, Security Events, Security Analytics, WAF attack score, Application Profiles, Troubleshoot managed rules, Security Insights, Rules language actions, WAF maximum payload update, Original payload change, Rulesets dry-run validation, and Querying firewall events with GraphQL.

Next in the Series

In Control Abuse With Bots, Turnstile, and Rate Limits, we'll explore Choose signals and server-side enforcement for each endpoint.