Define the Site, Baseline, and Acceptance Criteria
A shop cannot close for a month while it installs a security desk. The owner adds the desk on Monday, the parcel locker on Wednesday, and the cameras on Friday, testing after each change and keeping the old keys behind the counter. A website move to Cloudflare has the same shape. The unit of work is not "the configuration" but a sequence of small, reversible changes, each with an observation that proves it did what you intended.
The subject is fieldnote.example, a subscription publishing site. One nginx host runs the application, and media sits in object storage behind the same hostname. DNS is at the registrar, the origin has a Let's Encrypt certificate, and there is no CDN. The owner wants fewer origin requests, a smaller attack surface, and the ability to undo any change in minutes.
Five surfaces share that hostname, and each has a different cache and trust requirement:
/and/blog/*— marketing copy and articles, public and cacheable./login— the form that starts a session./account/*— billing details for one signed-in reader at a time./api/v1/*— JSON for the mobile client./assets/*— fingerprinted CSS, JavaScript, and images.
Some terms carry the rest of the article:
- A zone is the domain plus its DNS records and settings inside Cloudflare. The zone is not the origin (the server that holds the application and data).
- A proxied record (the orange cloud) makes DNS answer with Cloudflare addresses, so HTTP traffic passes through the edge, Cloudflare's anycast network where TLS terminates, rules evaluate, and cache lives.
- A cache key is the identity of a stored object; if two requests produce the same key, the second can receive the first response. Time to live (TTL) is how long that copy may be reused.
- A WAF inspects requests for attack patterns; a managed ruleset is a vendor-maintained collection of those rules.
- Authenticated Origin Pulls (AOP) makes Cloudflare present a client certificate to your origin, so the origin can reject connections that did not come through the edge.
The mental model is a chain of five decisions, not a stack of products. DNS decides where the name points. TLS decides whether both legs are encrypted and whether the origin is verified. Security rules decide whether the request continues. Cache decides whether the origin is contacted at all. The origin ingress decides whether a connection is allowed even when every earlier decision was skipped. Figure 1 draws the chain and its failure exits.
%%{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
subgraph PUB["Public network"]
V["Visitor browser"]
DNS["Proxied DNS record returns an edge address"]
end
subgraph EDGE["Cloudflare edge: inspected path"]
TLS["Edge TLS termination"]
SEC["WAF, bot rules, rate limit"]
KEY{"Cache key present?"}
HIT["Response served from edge"]
STOP["403 or challenge page"]
STORE["Store under the cache key"]
end
subgraph ORIG["Origin network: your trust boundary"]
CONN["Origin connection: Full strict plus AOP"]
ING{"Client certificate valid?"}
REJECT["TLS handshake rejected"]
APP["Application authorizes the session"]
CLASS{"Response class"}
PRIV["Return private, no-store"]
end
V --> DNS
DNS --> TLS
TLS --> SEC
SEC -->|"block or challenge"| STOP
SEC -->|"allow"| KEY
KEY -->|"HIT"| HIT
KEY -->|"MISS"| CONN
CONN --> ING
ING -->|"no"| REJECT
ING -->|"yes"| APP
APP --> CLASS
CLASS -->|"public, no Set-Cookie"| STORE
CLASS -->|"private or Set-Cookie"| PRIV
HIT --> V
STOP --> V
PRIV --> V
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 DNS,TLS,SEC,CONN primary;
class V,KEY,STOP,STORE,APP,PRIV secondary;
class HIT,ING,CLASS ok;
class REJECT danger;
Two properties matter. First, the cache decision uses a key the origin does not automatically control. A response can be correct for one visitor and catastrophic for another if the key omits the input that made it personal. Second, the ingress decision is the only control that still applies when someone bypasses DNS. A WAF rule that never sees a request is not a control; it is a log line that never happens.
Figure 2 shows the same system as layers with owners. The public network, the edge, and the origin network are separate trust domains. The edge team owns TLS mode, WAF, bot rules, rate limits, and cache policy. The platform team owns the origin certificate, the listener, and the ingress check. The product team owns what the application puts in a response, including Set-Cookie and Cache-Control. Most incidents here come from one team changing a layer another team assumed was stable.
Before touching a setting, record a baseline. For seven days, capture requests by path class, cache hit ratio for /assets/*, p95 time to first byte, origin 5xx rate, WAF actions, bot challenges, and login success rate. The baseline is the only way to distinguish "the change helped" from "traffic shifted." Store the raw export with the date and zone ID.
Acceptance criteria make the project falsifiable. Each has an observation, not an opinion:
- AC-1, transport: the apex and
wwwreturn a 301 to HTTPS, and HSTS carries amax-ageof at least six months. - AC-2, origin identity: the zone uses Full (strict), and the origin rejects TLS without the configured AOP certificate.
- AC-3, public cache: a second asset request returns
CF-Cache-Status: HITwithAge, and/assets/*reaches an 80% hit ratio after warmup. - AC-4, private isolation: two sessions requesting
/account/billingreceive different bodies, and neither response is aHITor carriesAge. - AC-5, deception resistance:
/account/billing.cssand/account/billingwithAccept: text/cssare not served from cache. - AC-6, abuse control: the sixth login POST from one address within ten seconds is challenged or blocked, while a normal login succeeds.
- AC-7, recovery: disabling the newest cache or WAF rule restores prior behavior within five minutes, with timestamps.
Recovery is the criterion most projects skip. A configuration you cannot reverse is not finished; it is a bet.
Design the DNS, TLS, and Origin Boundary
The first design decision is not a Cloudflare toggle. It is a sentence: "My origin accepts connections only from the edge, and only over verified TLS." Everything else follows from how you enforce that sentence.
Start with DNS. Proxy the apex and www, and keep the origin hostname out of public DNS. A proxied record changes the answer from your server's address to Cloudflare anycast addresses, which is what puts the edge in the path. The proxy hides the address; it does not erase it. Historical records, certificate-transparency logs, forgotten staging names, and scans can still reveal it, which is why Part 9 treats discovery as expected. If the origin must be reachable by name, put it behind a Tunnel or restrict it at the network layer.
Then TLS. Full (strict) encrypts both legs and validates the certificate the origin presents. The certificate must be unexpired, match the hostname Cloudflare requests, and chain to a public CA or to Cloudflare Origin CA (Full (strict)). The default Universal SSL certificate covers the apex and first-level subdomains; deeper names need a deliberate certificate plan. If validation fails, visitors see 526, and the origin may log nothing because the handshake never became an HTTP request.
Both halves of the boundary are testable from outside. Proxy the apex and www, then prove that the origin certificate validates for the hostname the edge requests.
Now the worked comparison. Suppose /account/billing sets a session cookie and returns a billing address. Six plausible designs behave very differently.
| Design | What it proves | What it leaves open | Operational cost | First failure symptom |
|---|---|---|---|---|
| DNS-only, grey cloud | Nothing at the edge; the origin address is public | TLS, WAF, cache, and DDoS absorption are all yours to run | Certificate and patch management on the origin | No cf-ray; clients connect straight to the origin |
| Proxied with Flexible | The browser-to-edge leg is encrypted | Edge-to-origin is plaintext; the origin certificate is not verified; direct access still works | Low, but the origin must accept HTTP | Redirect loop when the origin forces HTTPS |
| Proxied with Full | Both legs are encrypted | The origin certificate is not verified, and a direct client can still connect | Origin certificate installation | 525 when the origin handshake fails |
| Full (strict), no AOP | Both legs are encrypted and the origin identity is verified | A direct request to a discovered origin address is still accepted | Certificate lifecycle and renewal | 526 on expiry or hostname mismatch |
| Full (strict) with zone-level AOP | The request presented your account's client certificate at the origin | Source addresses may still be reachable; the global AOP certificate is shared across accounts | Client certificate on the origin, renewal, and reload | 526 when the origin does not trust the client CA |
| Cloudflare Tunnel | The origin has no public inbound listener | The connector host becomes a new trust anchor; AOP is incompatible with Tunnel | Run, monitor, and upgrade cloudflared | 1033 or a tunnel-down error |
Read the table by the second column, not the first. "Encrypted" and "private" are different claims. Flexible encrypts the browser leg and then speaks plain HTTP to the origin; a direct request to the origin IP still works. Full encrypts both legs but does not verify the origin certificate, and a direct request still works. Only the ingress check changes what an attacker can do after discovering the address. Figure 3 traces the allowed path and the two failure branches.
%%{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'}}}%%
sequenceDiagram
autonumber
participant B as Browser
participant E as Cloudflare edge
participant O as Origin
participant A as Attacker with origin IP
B->>E: GET /account/billing with session cookie
E->>E: WAF, bot rules, rate limit
alt blocked
E-->>B: 403 or challenge page
else allowed
E->>O: HTTPS request plus AOP client certificate
alt certificate missing or untrusted
O-->>E: TLS alert
E-->>B: 526 Invalid SSL certificate
else certificate valid
O->>O: Authorize session and read one billing row
O-->>E: 200 with private Cache-Control and Set-Cookie
E->>E: Cache key check: private response is not stored
E-->>B: 200 with CF-Cache-Status DYNAMIC
end
end
A->>O: Direct GET with a spoofed CF-Connecting-IP
O-->>A: TLS handshake rejected
The 526 branch is the most common self-inflicted outage in this project, and it is not a cache problem. The origin certificate expired, the hostname does not match, an intermediate is missing, or the origin expects a client certificate that Cloudflare is not presenting.
526 is not a cache problem
A 526 appears after the edge reached the origin and the origin certificate failed validation. A 525 means the TLS handshake failed before any certificate was checked. Both are transport faults: purging the cache or loosening a Cache Rule will not clear them, and the fix belongs in the certificate chain or the origin's client-certificate trust store.
AOP has three scopes, and the difference matters. The global scope uses a certificate shared across all Cloudflare accounts; it proves the request came through Cloudflare's network, not your zone. Zone-level AOP uses a certificate you upload, exclusive to your account. Per-hostname AOP applies your certificate to specific hostnames. Use one of the latter two when "from Cloudflare" is not a strong enough statement (Authenticated Origin Pulls). AOP is available to all plans, but it requires Full or Full (strict) and is not compatible with Cloudflare Tunnel. Tunnel is the stronger design when you can run it, because the origin has no public listener to bypass.
Isolation is proved with two sessions, not by reading a rule. Sign in as user A and user B in separate cookie jars, request the same private URL from each, and compare the headers and the bodies.
A single HIT on a private route is a stop-work condition, not a tuning opportunity. Part 12 develops the key design, and Part 14 covers purging.
Also test the bypass yourself. Resolve the origin address from an old record or a staging name and send a request with CF-Connecting-IP: 127.0.0.1. If the origin answers, the edge policy is advisory; the fix belongs at the origin, not in another WAF rule.
The product boundary belongs in the plan, not in a demo. AOP is available to all plans; zone-level and per-hostname certificates are the account-exclusive options. Smart Shield is opt-in for all customers through paid packages, but Smart Shield Advanced, including Regional Tiered Cache and Cache Reserve, is Enterprise-only (Smart Shield packages). API Shield's full suite and Bot Management are Enterprise products; Bot Management is an add-on. Rate-limit counts and periods vary: one rule on Free, two on Pro, five on Business, contract-dependent on Enterprise (rate limiting availability). Write the plan next to each control rather than discovering the gap during a demo.
Implement Cache, Performance, and Security Policies
With the boundary fixed, policies become named rules. Name every rule with a stable identifier, because an identifier is what you put in a change record and a rollback instruction. The set below is intentionally small. A capstone that ships forty rules has not designed a policy; it has accumulated one.
Four cache controls cover the site, and each one answers a different question. CR-1 makes fingerprinted assets cheap to serve. CR-2 makes anonymous blog HTML cacheable without ever storing a signed-in reader's page. CR-3 removes private surfaces from consideration before a broader rule can reach them. CR-4 ties the stored object to the response content type, so a .css suffix cannot smuggle HTML into cache.
Fingerprinted filenames are the precondition for CR-1. If a filename can change content in place, a one-year TTL is a one-year bug. For CR-2, the cookie and authorization exclusions are the security control; the five-minute TTL is only freshness (Cache Rules settings).
Cache eligibility is not cache safety
The most consequential misconception in this capstone is that "Cloudflare only caches static files by default" remains true after you add a Cache Everything rule. It does not. Once a rule makes HTML eligible, the cache key decides who can receive the stored copy; if the key omits the session cookie or the Authorization header, the next visitor can receive the previous visitor's page. The default Set-Cookie protection helps only until someone overrides the edge TTL to "fix" a low hit ratio.
Origin headers have to cooperate with the rule. Public assets return Cache-Control: public, max-age=31536000, immutable, private routes return private, no-store, and static responses set no cookies.
Set-Cookie is a safety net, not a caching strategy. Cloudflare will not store a response that carries the header by default, which explains most "why is my hit ratio zero?" reports. A Cache Rule can make a response eligible, but a no-store response still returns BYPASS (cache responses). Fix the origin header instead of overriding it at the edge.
Performance policy is deliberately boring. Enable Brotli and HTTP/3, keep the origin connection alive, and remove render-blocking third-party scripts before adding more edge features. Measure p95 time to first byte and the cache hit ratio by path class, not a single site-wide average; a 90% hit ratio driven by tiny assets can coexist with a slow checkout. Part 15 covers the measurement discipline; the capstone needs only the before-and-after pair.
Security policy is staged in seven moves, and each move has an owner and a rollback line. Observe first, enforce second, narrow third; log mode is a timed observation window, not a destination.
| ID | Control | Setting | Pass evidence | Rollback lever |
|---|---|---|---|---|
| SEC-1 | Managed ruleset, observe | Cloudflare Managed Ruleset in log mode for seven days | Actions reviewed by rule ID, path, and country | The window ends with no block live |
| SEC-2 | Managed ruleset, enforce | Block, with narrow exceptions for the admin upload path and multipart API endpoints; ruleset version and date recorded | The regression list passes and every exception is named | Switch the ruleset back to log |
| SEC-3 | Login rate limit | Free: five POSTs per IP in ten seconds, then a ten-second block. Pro or Business: longer window and a managed challenge, because shared NAT can punish a whole office | The sixth POST is challenged or blocked; a normal login still succeeds | Disable the rule |
| SEC-4 | API rate limit | /api/v1/* at sixty requests per minute per IP, or ten per ten seconds on Free; a higher ceiling for authenticated clients where the plan allows counting by header | A burst is limited while a token-bearing client keeps working | Disable the rule |
| SEC-5 | Bot controls | Bot Fight Mode on Free, or Super Bot Fight Mode on Pro and above with verified bots allowed | Search indexing and ordinary browsers still pass | Turn the mode off |
| SEC-6 | Turnstile | Login and contact forms, with the token validated server-side | A forged token is rejected at the server, not only in the browser | Remove the widget and the server check |
| SEC-7 | Browser policy | HSTS at six months without preload; CSP in report-only for two weeks; nosniff, strict-origin-when-cross-origin, and a restrictive Permissions-Policy | Headers present on HTML; CSP reports reviewed, not ignored | Shorten HSTS and drop CSP to report-only |
Bot Management scoring is an Enterprise add-on and should not appear in the plan unless it is licensed. The same discipline applies to HSTS: six months without preload until every subdomain is ready.
Figure 4 assigns each decision to a layer and shows the private path end to end.
Auditability comes from three habits, not a dashboard. Keep the rule set in version control as Terraform or exported API JSON. Give every rule a ref, description, owner, and rollback line. Export the zone configuration before and after each change, and keep the diff with the evidence bundle. Cloudflare's audit log records purge events, including what was purged and by whom, which is the evidence you want when a "wrong page" report arrives (purge audit logs).
Name it before you need it
A rule you cannot name is a rule you cannot roll back. Every rule carries a ref, description, owner, and rollback line, and the whole set lives in version control.
Rollback for this layer is per-rule, not per-zone. Disable CR-2 to stop HTML caching, leave CR-1 in place, switch SEC-2 to log, and purge by prefix for the affected path. Purge everything is a last resort because it creates a miss storm. Test each lever on staging and write down the observed time; a rollback plan without a measured duration is a hope.
Prepare an Incident and Recovery Runbook
A runbook is a decision table with timestamps, not a wiki page. It should tell a tired person what to check first, what not to touch, and how to prove recovery. Write it for the person who did not build the system, because during an incident that person may be you.
Detection uses a small set of signals. Page on a five-minute 5xx rate above 1%, a cache hit ratio drop of more than 20 points for /assets/*, a login success rate drop of more than 30%, or an origin health-check failure. Include a synthetic canary for the marketing page, the login page, and one authenticated route. A canary that only checks the homepage will report green while checkout is down. The analytics and log pipeline in Part 45 supplies the data; the runbook needs the thresholds and the owner.
Classify before changing anything. Three questions narrow almost every incident: is the scope one hostname, one path, or the whole zone; did a change land in the last sixty minutes (the audit log answers in seconds); and does the origin answer a direct canary request? If it does, the fault is at the edge or in the path. If it does not, the fault is at the origin.
The first five minutes are scripted, and they are not a search for a fix. Acknowledge, open the incident channel, capture the current state, then choose exactly one lever. The capture list is short: the failing cf-ray, a HAR if a browser is involved, the rule set digest, the SSL mode, and the origin certificate expiry.
Never probe in production
Do not purge cache, change DNS, or disable the WAF "to see if it helps" before you know which layer failed. Each of those changes destroys evidence and widens the blast radius, and a full purge turns a wrong-body report into a miss storm.
Order the levers by blast radius. The smallest lever that fits the evidence wins:
- Disable one rule — seconds; right when a specific rule ID is implicated.
- Move one managed ruleset to log — under a minute; right for a suspected false positive, never as a permanent state.
- Bypass cache for one path and purge that prefix — minutes; right for a wrong-body report.
- Revert the TLS mode or origin certificate — minutes; expect 525 or 526 during the transition.
- Grey-cloud a record — removes WAF, bot, cache, and DDoS absorption at once; use it only when the edge is the confirmed fault and the origin can survive direct traffic.
- Change nameservers — an onboarding or exit action, not an incident action.
Three one-way doors
HSTS with preload is slow to undo. Once a browser stores the policy, a subdomain that still serves HTTP can be locked out. DNSSEC misconfiguration can make the zone unresolvable; disable it deliberately, never as a probe. A deleted custom rule is recoverable only if you exported it — which is the argument for keeping the rule set in version control.
Failure codes belong in the runbook. 520 is an unknown origin error, 521 a refused connection, 522 a connection timeout, 523 an unreachable origin, 524 a timeout after connection, 525 a failed TLS handshake, and 526 an invalid or untrusted origin certificate. The 525 and 526 codes point at certificates; 521 and 522 point at reachability.
Tradeoffs belong in the runbook. A WAF in block mode protects more and breaks more; log mode protects less and tells you more. A five-minute HTML TTL is fresher and produces more origin traffic. A managed challenge on login reduces abuse and conversions. Write down the chosen tradeoff and the threshold that would make you revisit it. Figure 5 turns the first ten minutes into a path with time budgets.
The runbook also needs a recovery-ready evidence trail: the incident start time, the failing cf-ray, the rule ID or setting changed, the time of the change, the canary result after the change, and the time the incident closed. That trail is what makes the next postmortem useful and what proves AC-7. Part 21 covers the wider incident command model, and Part 47 covers the layer-by-layer diagnosis this decision tree compresses.
Build the Controlled Website Delivery Configuration
This capstone is design-only as of 2026-11-05. No hosted zone was changed, no traffic was measured, and no product version was tested. The build below is a reproducible plan with expected observations; it becomes executed work only when someone runs it and attaches the output.
Two tracks are possible. The hosted track uses a staging hostname on a real zone and exercises the edge. The fixture track runs nginx locally with a self-signed CA and two session cookies, and exercises only the origin ingress and header behavior. The fixture cannot test WAF, bot rules, or edge cache, and it must not be described as hosted validation.
The build is ordered by reversibility, not by product menu. DNS and TLS come first because every later observation depends on them. Cache comes next because it is the easiest layer to verify with a header. Security comes last because a false positive is indistinguishable from an outage until you have a baseline. Reverse that order and you will tune WAF rules against a cache that is still warming.
Build the Controlled Website Delivery Configuration
Status: design-only — not executed at the 2026-11-05 verification date. Prerequisites: a domain you control, a Cloudflare account, a staging hostname, and an API token with Zone Read, DNS Edit, Zone Settings Edit, Cache Rules Edit, and WAF Edit.
- Tools the checks below use:
curl,dig,openssl,jq. - Free covers Full (strict), AOP, Cache Rules, Bot Fight Mode, and one rate-limit rule.
- Pro adds Super Bot Fight Mode and a second rate-limit rule; Business adds more rules and longer windows.
- Enterprise adds Bot Management as an add-on, API Shield, and Smart Shield Advanced.
- Steps marked hosted-only cannot run in the local fixture.
Minimal setup. The staging origin at 203.0.113.10 serves five paths, with two test accounts:
/assets/app.abc123.css— the fingerprinted asset./blog/hello— anonymous blog HTML./account/billing— private HTML./login— the rate-limit target./api/v1/me— the JSON API.
For the fixture track, run nginx locally with a self-signed CA and ssl_verify_client on.
- Export the baseline: at least 24 hours, ideally seven days, of path metrics, DNS records, SSL mode, and rule sets. Save the JSON with the date.
- Proxy
staging.fieldnote.exampleonly. Leave the apex untouched until staging passes. - Set SSL/TLS to Full (strict). Confirm the origin chain with
openssl s_clientagainst the staging hostname. - Upload the zone-level AOP certificate, configure the origin trust store, and reload nginx. Hosted-only.
- Create CR-1 and CR-3. Request the asset twice and
/account/billingtwice. ExpectMISSthenHITfor the asset, andDYNAMICorBYPASSfor the account page. - Create CR-2 with the cookie exclusion. Request
/blog/hellowith and without a session cookie. Expect aHITwithout the cookie and noHITwith it. - Enable cache deception armor. Request
/account/billing.cssand confirm noHIT. - Deploy the managed ruleset in log mode. Replay a 200-URL regression list covering checkout, search, and the API. Expect zero blocks and a list of would-be actions.
- Add SEC-3 and SEC-6. Send six login POSTs in ten seconds from one address; expect a challenge or block on the sixth. Complete one normal login.
- Run the rollback drill: disable CR-2, purge
/blog/by prefix, confirm the page isDYNAMIC, re-enable, and record the elapsed time. Repeat for SEC-2 in log mode.
Expected observations are conditional, not measured.
CF-Cache-Statusmoves from MISS to HIT only on public assets.Ageis present on a public HIT and absent on every private response.- The two test accounts receive different bodies on
/account/billing. - The sixth login POST meets a challenge, and a normal login still works.
Failure checks. A HIT on a private route, an age header on personalized HTML, a 526 after the AOP change, a WAF block on the regression list, or a rollback over five minutes.
Cost dimensions. Plan subscription, Smart Shield or Argo add-ons, Cache Reserve, Logpush export and transformation usage (all plans, usage-based, since 2026-09-30), request volume, origin egress, and staff time. No dollar figures are quoted because pricing changes.
Cleanup. Delete the test rules, revert the SSL mode, remove the AOP certificate, restore the DNS record, revoke the token, and purge the staging hostname.
Figure 6 shows the evidence flow that the card produces.
%%{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 LR
B["Baseline snapshot: 24 hours by path class"] --> S["Stage the change on one hostname"]
S --> C["Canaries: three public, two private"]
C --> V{"Pass criteria met?"}
V -->|"yes"| E["Expand to apex and www"]
V -->|"no"| R["Roll back the single lever"]
R --> RV["Re-run canaries and confirm baseline"]
E --> D["Record evidence bundle and config digest"]
RV --> D
D --> X["Sign-off: owner, date, rollback time"]
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 B,S,C,V,E,R,RV,D,X secondary;
Submit Measurements, Negative Tests, and a Rollback Demonstration
Submission is a folder, not a screenshot. A reviewer should open it and answer three questions without asking you: what changed, what proves it worked, and how long recovery takes. Use a fixed index, and let each folder answer one question.
01-baseline/— the seven-day export, with the date.02-config-before/— the zone export taken before the first change.03-changes/— one record per rule or setting: actor, time, reason, rollback line.04-measurements/— before-and-after pairs by path class.05-negative-tests/— the bypass, deception, and cross-session checks.06-rollback/— timestamps from the timed drill.07-runbook/— the decision table and evidence trail.08-signoff.md— owner, date, and measured rollback time.
The pass/fail matrix below is the submission's front page. Because this article is design-only, every hosted row is marked not run; the pass condition is the contract the runner must satisfy, not a claimed result.
| ID | Evidence | Pass condition | Status |
|---|---|---|---|
| AC-1 | curl -I http://fieldnote.example and the HTTPS equivalent | 301 to HTTPS and HSTS max-age at least 15552000 | Not run, design-only |
| AC-2 | openssl s_client with and without the AOP client certificate | Connection without the certificate is rejected; with it, the app responds | Not run, design-only |
| AC-3 | Two requests for /assets/app.abc123.css | MISS then HIT, with Age on the hit | Not run, design-only |
| AC-4 | Two cookie jars, three requests each to /account/billing | Different bodies, no HIT, no Age, cookie preserved | Not run, design-only |
| AC-5 | Requests for /account/billing.css and /blog/hello.css | No HIT on either path | Not run, design-only |
| AC-6 | Six login POSTs in ten seconds from one address | Sixth is challenged or blocked; a normal login still works | Not run, design-only |
| AC-7 | Timed disable, purge, verify, re-enable | Rollback complete in five minutes or less, with timestamps | Not run, design-only |
| N-1 | Direct request to the origin with a spoofed header | TLS handshake rejected or connection refused | Not run, design-only |
| N-2 | 200-URL regression list against managed rules | Zero blocks on legitimate traffic; would-be actions reviewed | Not run, design-only |
Score one point per row. A submission is complete at 9/9; 7–8 is conditional only when the missing rows are measurement gaps, never when isolation or rollback failed. A single HIT on a private route or an untimed rollback returns the capstone for rework regardless of the total.
Negative tests are what reviewers trust, because a happy path can happen by accident. N-1, bypass: a direct request to the origin with a spoofed client-identity header; pass means rejection. N-2, false positive: replay checkout, search, upload, and API calls with realistic bodies; pass means no block. N-3, cross-session: the two-jar test from AC-4.
N-4, deception: private HTML requested with a .css suffix and with Accept: text/css. N-5, shared NAT: burst logins from one address while a second user on that address logs in; pass means the second user is not locked out. N-6, certificate failure: point staging at an expired certificate, confirm 526, restore. N-7, rollback under load: run the drill while a canary generates traffic, because a rollback that only works on an idle zone is not a rollback.
Run the rollback demonstration as a timed exercise. At T+0 the canary fails or a rule breaks on staging. At T+1 the rule ID is identified from the change record. At T+2 the rule is disabled. At T+3 the prefix is purged. At T+4 three canaries and one private-route check run. At T+5 the cf-ray, status codes, and elapsed time are recorded. Target five minutes for a rule rollback and ten for an SSL mode revert. If DNS is required, the drill has already failed the design goal.
Self-check, with explanations:
- Full (strict) plus AOP means the origin is private, right? No. Global AOP uses a certificate shared across Cloudflare accounts, so it proves the request came through Cloudflare's network, not your zone. Zone-level or per-hostname AOP narrows that to your certificate, but reachability is separate; Tunnel or a network allowlist removes the public listener. AOP is also incompatible with Tunnel.
- A reader reports seeing another reader's name on
/blog/post. First action? Bypass cache for that path and purge by prefix, then preserve the headers and failingcf-ray. Do not purge everything: a full purge creates a miss storm and destroys the evidence of which key collided. Fix the key or the eligibility expression, not the TTL. - Why is greying out the record a last resort? It removes WAF, bot controls, cache, and DDoS absorption at once, exposes the origin address, and takes minutes to reverse because resolvers cache the old answer. A rule-level disable is narrower and keeps the protection you paid for.
- Which cache statuses count as success?
HITwithAgefor public assets;DYNAMICorBYPASSfor private responses. AMISSon every asset points atSet-Cookie,no-store, or a rule that never matched.BYPASSmeans the request was eligible but the response refused storage, a different bug fromDYNAMIC.
Unresolved limitations. No hosted zone was changed and no measurement was taken, so every result is a design expectation. Availability, limits, and pricing were checked on 2026-11-05 against the planning baseline of 2026-11-02; no tool versions were tested because no lab ran. Plan-specific behavior is the largest gap: rate-limit counts, Bot Management scoring, API Shield, and Smart Shield Advanced vary by contract. WAF false-positive rates need production traffic, not a 200-URL list. The two-identity test proves isolation for those identities only, and does not cover browser caches, service workers, or origin-side proxies. Tunnel was not exercised, regional latency was not measured, and DNS propagation was not observed. Quotas and prices change; re-check them at execution time.
References, verified 2026-11-05: Cloudflare Cache, Cache Rules, Cache Rules settings, Cache responses and CF-Cache-Status, Purge cache, Cloudflare SSL/TLS, Full (strict), Authenticated Origin Pulls, Cloudflare Tunnel, Cloudflare WAF, Managed rules, Rate limiting rules, Bot Fight Mode, Super Bot Fight Mode, Smart Shield, Smart Shield get started, Logpush, and Proxy status.