Course contents · Boundary and deterministic rules
- 1. Bound the Cloudflare WAF pilot to a zone and originFree
- 2. Deploy a harmless Cloudflare custom rule and prove its scopeFree
- 3. Trace a Cloudflare decision through phases and sampled eventsFree account
- 4. Repair a managed-rule false positive with a bounded exceptionPremium
- 5. Configure a Cloudflare rate rule without promising a global quotaPremium
- 6. Recover a WAF change while preserving the origin boundaryPremium
- 7. Hand over a Cloudflare WAF pilot with attributable evidencePremium
Deploy a harmless Cloudflare custom rule and prove its scope
Use an exact hostname and harmless path to prove a custom Block rule, with negative cases for other paths and hosts. Review the actual expression, deployed state and application receipt instead of inferring success from a 403.
25 MIN
By AISecurityInterviews · Updated
TL;DR: Deploy one deterministic, harmless path rule in the isolated zone. A correct result combines the intended rule match, a blocked request and continued useful work outside the rule's scope.
Where you are. The origin boundary and baseline are recorded. You will create the first bounded rule and test its expression before deployment.
Reference and lab scope. Cloudflare developer documentation checked November 2026, using the current Security dashboard. The fictional pilot uses an authorized, isolated Business-plan zone and an already protected HTTPS origin. Product procedures are documentation-checked, not tenant-tested. Supplied records and Python exercises are fictional and run offline.
Choose a test that proves routing and scope
Harbor Ledger's disposable route /__edgecheck__/blocked returns a harmless receipt before this lesson. The pilot will block that exact path on api.harborledger.example. It is a deliberate test marker, not an exploit, a vulnerability signature or an authentication secret. The result proves custom-rule enforcement for the tested request. It says nothing about managed-rule detection of an attack.
Use an exact hostname and path comparison. A broad substring might catch unrelated routes; a path-only rule could affect every hostname in the zone. Adding a client-supplied marker header would not authenticate the caller. Here the path exists only to make the policy decision observable in an authorized test application.
The expression to review is:
(http.host eq "api.harborledger.example" and
http.request.uri.path eq "/__edgecheck__/blocked")
The field is the path, so a query string does not become part of this equality test. Case, slash variants and upstream normalization can change what a real request presents to evaluation. Inspect the effective field values and existing rewrite settings rather than treating this literal comparison as an application-wide route classifier.
Read the real console form
In the selected zone, open Security rules, select Create rule > Custom rules, and name the new rule HL-Lab-Exact-Path. Under When incoming requests match, use the builder or Edit expression to enter the reviewed expression. Check the expression preview. Under Then take action, select Block.
Cloudflare's dashboard procedure documents Save as Draft and Deploy separately. Save a draft for review; deploy only the approved object in the isolated zone. Record its actual rule ID and position, not just its mutable display name. Existing terminating or skip rules can alter which later rules execute.

Locate the expression preview and the separate action control. An empty or correctly filled form is still not evidence of a deployed decision. Official Cloudflare documentation image, unmodified, © Cloudflare and contributors, CC BY 4.0. Source article · Open full-size image. This is an OEM example, not a screenshot of the fictional customer.
Custom-rule Log is Enterprise-only according to custom-rule availability. Do not describe it as a Business-plan monitor mode. The optional lab uses an owned disposable route and a deliberate Block decision. A Managed Challenge also changes behavior and may disrupt non-browser clients; it is not a passive substitute for logging.
Test the expression offline first
The following standard-library model accepts supplied effective field values. It does not parse URLs, reproduce edge normalization or run Cloudflare rules. Its purpose is to catch an accidental widening of the Boolean scope before anyone deploys it.
HOST = "api.harborledger.example"
PATH = "/__edgecheck__/blocked"
def applies(host, path):
return host == HOST and path == PATH
cases = [
(HOST, PATH, True),
(HOST, "/health", False),
("other.harborledger.example", PATH, False),
(HOST, PATH + "/", False),
(HOST, PATH.upper(), False),
]
for host, path, expected in cases:
assert applies(host, path) is expected
print("5 scope cases passed")
Expected output is 5 scope cases passed. Change and to or and the negative cases fail. That failure is useful: a reviewer can show exactly which other host or ordinary route would enter the rule. In a real application, the trailing-slash and case variants may map to the same handler; deciding whether they belong in production scope is a separate application review.
Draft
Review exact expression and position
Deployed rule
Record actual rule ID and enabled state
Harmless request
Capture time and response context
Acceptance
Correlate decision and application result
Run a bounded acceptance check
For an optional product rehearsal, the owner permits a few ordinary browser requests to the designated routes. Do not send attack strings or generate load. After deployment, request the exact test path once, then /health and the ordinary preview route. Record time, response status and any Ray ID available in the response. The blocked path should not produce a new accepted application receipt; the ordinary transaction should still succeed.
A 403 alone is insufficient because the origin, another edge rule or an identity control can also return one. In the next lesson, correlate the request with the actual custom-rule service, action and rule ID in Security Events. A missing event is an evidence gap, not permission to relabel another denial as this rule's result.
Preserve previous state and the exact new object ID for recovery. Do not toggle the proxy off or relax origin authentication to restore a disposable route. The scope of recovery should match the scope of this change.
Do this before moving on
Run the offline scope cases, then review a proposed expression that uses host equals pilot OR path equals marker. Give two concrete unintended matches and rewrite it with conjunction. Build an acceptance record with a marked-path denial, ordinary success, another-host negative case and an explicit configuration reference.
Review criteria: the engineer can distinguish draft from deployed state, explain why a client marker is not identity, and reject an unrelated 403. Optional live evidence must come from the approved test application; the offline model cannot substitute for it.
Go deeper
- Injection mechanisms explains why a path fixture does not validate attack detection.
- HTTP request interpretation examines differences between intermediaries and application request parsing.
- DNS security connects hostname scope to the effective traffic path.
Key takeaways
- Use exact host and path scope for the harmless pilot.
- Draft review and actual deployment are different states.
- Log availability depends on the plan and rule family.
- Attribute the denial to the intended rule and preserve useful work.
Check yourself
Say or write your answer first, then reveal. Explaining it from memory, in your own words, is the skill an interviewer is checking.
1Does blocking the marker path prove the managed rules detect injection?
2Why is Managed Challenge not a passive observation mode?
Sign in to track which lessons you have finished.