Most teams meet Cloudflare’s DDoS posture for the first time during an incident. The reflex is to call support and “turn up the protection” — but the L3/L4 layer is already on, hasn’t been off, and isn’t tuneable in the dashboard. What you can tune is the L7 HTTP DDoS Managed Ruleset and, for IP-space customers, the Network-layer DDoS Managed Ruleset. This article draws the line between what Cloudflare runs for you automatically and what you actually need to configure — for ops teams running production zones on Cloudflare, particularly ones that have just been hit.
How to verify
Confirm the Managed Rulesets are deployed on your zone before the next attack, not during it. From a workstation with the Cloudflare API token (Zone.Read + Zone WAF):
# List rulesets at the zone scope — look for the http_ddos_l7 phase
curl -sS "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/rulesets" \
-H "Authorization: Bearer ${CF_API_TOKEN}" \
| jq '.result[] | select(.phase | test("ddos"))'
# Check the deployed entrypoint for the L7 phase
curl -sS "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/rulesets/phases/ddos_l7/entrypoint" \
-H "Authorization: Bearer ${CF_API_TOKEN}" | jq '.result.rules'
# Pull attack events in the last 24h (GraphQL Analytics)
curl -sS "https://api.cloudflare.com/client/v4/graphql" \
-H "Authorization: Bearer ${CF_API_TOKEN}" -H "Content-Type: application/json" \
-d "{\"query\":\"query{viewer{zones(filter:{zoneTag:\\\"${ZONE_ID}\\\"}){httpRequestsAdaptiveGroups(filter:{datetime_geq:\\\"2026-06-01T00:00:00Z\\\",edgeResponseStatus_in:[429]},limit:100,orderBy:[count_DESC]){count dimensions{clientCountryName edgeResponseStatus}}}}}\"}"
In the dashboard: Security → DDoS → Network-layer DDoS Attack Protection and HTTP DDoS Attack Protection. Both should show a deployed managed ruleset. Security → Events filtered by Service = DDoS reveals mitigated traffic in real time.
What’s happening
Cloudflare’s DDoS protection runs at three layers, and the surface area you can configure is inversely proportional to how close to the wire the attack hits.
L3/L4 (packet level) is always on for every zone, every plan. SYN floods, UDP amplification, ACK floods — these are absorbed at the edge before they reach the Cloudflare proxy stack, let alone your origin. You don’t configure this. There is no toggle. The anycast network and the kernel-level packet processing path either drop the packet or pass it; the decision is made on packet shape and rate without consulting any rule you wrote. This is also why DDoS protection is a “free for everyone” feature in Cloudflare’s marketing — the cost of mitigating L3/L4 floods at scale is amortized across the network and isn’t optional.
L7 (HTTP/HTTPS) protection is a Managed Ruleset — the HTTP DDoS Managed Ruleset — that sits in the ddos_l7 phase ahead of your custom WAF rules. It looks at HTTP request patterns (same UA, same path, same JA3 fingerprint, traffic spikes from a small subnet) and either challenges, blocks, or rate-limits the offending requests. The default sensitivity is “High” for the entrypoint, but you can override per-rule to lower sensitivity or change the action when a legitimate traffic pattern (say, a CI bot doing 500 RPS against a public endpoint) triggers it. Overrides are surgical — they don’t disable the protection, they just relax one rule for one host or URL pattern.
Network-layer DDoS Managed Ruleset is the equivalent for IP-space customers on Magic Transit or Spectrum — it inspects packets and TCP/UDP flows rather than HTTP semantics.
The procedure
The L3/L4 layer needs nothing from you. The work is in (1) confirming the L7 Managed Ruleset is deployed, (2) adding overrides for known false positives, and (3) setting up the operational pieces — alerts and an escalation path — so the next attack isn’t a discovery exercise.
-
Confirm the L7 Managed Ruleset is deployed. Dashboard: Security → DDoS → HTTP DDoS Attack Protection → Deploy ruleset. By default the entrypoint runs every rule at its default sensitivity and default action. You don’t need to do anything more here unless you have false positives.
-
Set notifications before you need them. Account Home → Notifications → Add. Pick “DDoS Attack — HTTP” and “DDoS Attack — L3/L4”. Route to a channel humans actually watch — PagerDuty or an on-call email distribution, not a generic shared inbox.
-
Add an override only when you have proof of a false positive. Suppose your healthcheck partner sends 800 RPS to
/healthzfrom a small CIDR and the Managed Ruleset is challenging it. Add an override via API:curl -sS -X POST \ "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/rulesets/phases/ddos_l7/entrypoint" \ -H "Authorization: Bearer ${CF_API_TOKEN}" \ -H "Content-Type: application/json" \ -d '{ "rules": [{ "action": "execute", "action_parameters": { "id": "4d21379b4f9f4bb088e0729962c8b3cf", "overrides": { "rules": [{ "id": "<rule-id-from-list>", "action": "log", "sensitivity_level": "low" }] } }, "expression": "(http.host eq \"api.example.com\" and http.request.uri.path eq \"/healthz\")", "description": "Lower L7 DDoS sensitivity for healthcheck endpoint" }] }'Always scope the override with an expression. Never lower sensitivity zone-wide — you erase the protection for the rest of the surface.
-
For Magic Transit / Spectrum, deploy the Network-layer Managed Ruleset the same way — Security → DDoS → Network-layer DDoS Attack Protection. Overrides accept source IP, protocol, port, packet-rate thresholds.
-
Practice the dashboard before the next attack. Security → Events with the time range zoomed to the attack window is where the on-call engineer will work. Make sure they can filter by
Service = DDoS, sort by RPS, and pivot to the source country / ASN. If they’re learning the UI during the incident, the incident is longer than it needs to be. -
Engage Cloudflare support during a sustained or novel attack — Enterprise plans get an “Under Attack” hotline; Pro/Biz open a ticket flagged “DDoS in progress” with the zone ID and the time window. Support can deploy account-level overrides faster than you can iterate via API.
Common pitfalls
- Turning on “Under Attack Mode” zone-wide as a reflex — it forces every visitor through a JavaScript challenge and tanks conversion; use it only when nothing else is working.
- Lowering the L7 Managed Ruleset sensitivity globally because of one false positive — fix it with a scoped override expression instead.
- Forgetting that Spectrum / Magic Transit need the Network-layer ruleset deployed separately from the HTTP one.
- Treating “Cloudflare absorbed it” as the whole story when origin metrics show the attack still bypassed via an unproxied DNS record (e.g. a grey-clouded
direct.example.com). - Not capturing the attack signature post-mortem — the Security Events JSON export is your evidence for the next ASN block or rate-limit rule.
Stack Harbor runs the L7 Managed Ruleset deployment, override discipline, and the alerting wiring on every Cloudflare zone we operate. The on-call rotation already knows the dashboard paths; the override expressions live in version control alongside the rest of the WAF config. See managed operations for the engagement shape.