DDoS Protection: Managed Rulesets, Mitigation, and Monitoring
How always-on DDoS managed rulesets detect attacks, what you can customize, and how to verify mitigation with alerts and analytics.
This page summarises Cloudflare DDoS Protection documentation: automatic detection and mitigation at OSI layers 3, 4, and 7, the managed rulesets you inherit on onboarded properties, optional Enterprise features, and how to confirm attacks were handled without mistaking normal spikes for outages.
Cloudflare provides unmetered and unlimited distributed denial-of-service (DDoS) protection at layers 3, 4, and 7 to all customers on all plans and services.
— Cloudflare, About DDoS protection
Protection is driven by the Autonomous DDoS Protection Edge, which detects and mitigates attacks automatically. You customise behaviour mainly through DDoS Attack Protection managed rulesets, not by turning protection off.
DDoS managed rulesets: what runs by default on your zone
Section titled “DDoS managed rulesets: what runs by default on your zone”HTTP DDoS Attack Protection and Network-layer DDoS Attack Protection are the two managed rulesets. Both are always enabled; you can only adjust actions, sensitivity, and scoped overrides.
| Ruleset | OSI focus | Typical attack examples | Who can customise ruleset behaviour |
|---|---|---|---|
| HTTP DDoS Attack Protection | L7 (HTTP/HTTPS) | HTTP floods, cache busting, HTTP/2 Rapid Reset, Slowloris-style patterns | Action/sensitivity varies by plan; some API-only account overrides for HTTP |
| Network-layer DDoS Attack Protection | L3/4 | SYN floods, UDP floods, DNS query floods, amplification | All plans get protection on onboarded zones, Spectrum apps, Magic Transit prefixes; rule customisation mainly Enterprise Magic Transit / Spectrum |
The DDoS Attack Protection managed rulesets provided by Cloudflare are enabled by default on zones onboarded to Cloudflare, IP applications onboarded to Spectrum, and IP Prefixes onboarded to Magic Transit.
— Cloudflare, Get started with DDoS protection
For HTTP, rule tags group behaviour: botnets, unusual-requests, generic floods, read-only high-confidence rules, and advanced (tied to Adaptive DDoS Protection). See HTTP rule categories and network rule categories.
Origin error floods: HTTP DDoS when your server returns many errors
Section titled “Origin error floods: HTTP DDoS when your server returns many errors”HTTP DDoS protection can react when traffic drives a high rate of origin errors. Rule dd42da7baabe4e518eaf11c393596a9d mitigates HTTP requests causing a high number of origin errors (available on any plan). Default sensitivity is 1,000 errors per second; Pro, Business, and Enterprise add a check that errors must be at least five times normal origin traffic before mitigation applies. Errors counted include 52x and most 53x (excluding 530). Details are in HTTP DDoS Attack Protection — Origin Protect rules.
How Autonomous Edge detects a DDoS attack and mitigates it
Section titled “How Autonomous Edge detects a DDoS attack and mitigates it”How DDoS protection works describes out-of-path sampling of packets and HTTP metadata (headers, path, rates, origin error rates). Dynamic rules match known tools, protocol violations, suspicious patterns, and floods. When traffic matches, Cloudflare builds a real-time fingerprint and deploys an ephemeral mitigation rule that expires when the attack stops.
Once attack traffic matches a rule, Cloudflare’s systems will track that traffic and generate a real-time signature to surgically match against the attack pattern and mitigate the attack without impacting legitimate traffic.
— Cloudflare, How DDoS protection works
Typical mitigation actions include Block, Managed Challenge, Interactive Challenge, Log, and rule defaults (see the actions table on the same page). Average edge detection and mitigation for L3/4 and HTTP managed rulesets is up to about three seconds; Advanced TCP and DNS protection mitigates immediately per that documentation.
At the platform level, main components include dosd (denial-of-service daemon) on every edge server and centralized coordination for global volumetric events. Magic Transit traffic may pass managed rulesets → Advanced TCP Protection → Advanced DNS Protection → Network Firewall, with Programmable Flow Protection inside the advanced layer for UDP-based protocols.
For network-layer attacks, a DDoS attack event (start/end, attack ID, vector, mitigating rule) is defined for the Network-layer DDoS managed ruleset; HTTP and other systems do not yet group events the same way—see DDoS protection FAQ — What is a DDoS attack event?.
DDoS attack coverage: layers 3/4, HTTP, and DNS
Section titled “DDoS attack coverage: layers 3/4, HTTP, and DNS”Attack coverage maps rulesets to vectors: L3/4 includes SYN floods, carpet bombing, DNS amplification, QUIC floods, and many reflection attacks; L7 HTTP includes HULK, LOIC-style botnets, TLS exhaustion, and WordPress pingback abuse. Advanced TCP Protection (Magic Transit) targets sophisticated spoofed/randomized TCP floods. Advanced DNS Protection covers randomized DNS attacks including Water Torture, random prefix attacks, and DNS laundering.
Protection generally extends down to the layer where your traffic is onboarded (CDN/WAF gives L7 down through L3/4). DDoS protection does not cover SMTP, IMAP, or POP3—use Email Security for mail-borne threats instead.
Random prefix attacks on authoritative DNS
Section titled “Random prefix attacks on authoritative DNS”Random prefix attacks flood queries for non-existent subdomains (12345.example.com), bypassing resolver cache and hammering authoritative nameservers—often via public resolvers, so source-IP blocking causes false positives. With DNS Firewall random prefix attack mitigation (opt-in), Cloudflare can stop upstream queries for attack-like prefixes and answer from cache when TTL allows—see about random prefix attacks.
Adaptive and Advanced DDoS Protection: when baseline rulesets are not enough
Section titled “Adaptive and Advanced DDoS Protection: when baseline rulesets are not enough”Adaptive DDoS Protection learns a seven-day rolling profile (recalculated daily, using 95th percentile rates) per dimension: origin errors, user agents (network-wide baseline), client geo, or IP protocol (L3/4 on Magic Transit / Spectrum BYOIP). Traffic that deviates from the profile may be treated as attack traffic; HTTP rules also use ML for automation signals.
Adaptive features are Enterprise-scoped: HTTP dimensions need WAF/CDN Enterprise with Advanced DDoS Protection; protocol/geo UDP dimensions need Magic Transit or Spectrum BYOIP Enterprise. HTTP profiles are zone-level, so they may be a poor fit for SSL for SaaS zones aggregating many custom hostnames—documented on the same page.
Advanced TCP Protection, Advanced DNS Protection, and Programmable Flow Protection (custom eBPF for UDP L7 protocols) are aimed at Magic Transit-style deployments. Configure DDoS protection for data centers notes Advanced TCP is off by default and Advanced DNS may be in beta for Magic Transit customers.
Configure DDoS settings without blocking legitimate traffic spikes
Section titled “Configure DDoS settings without blocking legitimate traffic spikes”If you expect large legitimate surges (sales events, viral traffic), tune before an incident:
- Adjust action and sensitivity on managed ruleset rules in the dashboard, API, or Terraform examples.
- Use override expressions to limit where sensitivity or action changes apply (How DDoS protection works).
- On Enterprise, Cloudflare recommends starting with ruleset actions set to Log, analysing flagged traffic, tuning rules, then restoring defaults (Get started — Enterprise plan).
Proactive DDoS defense adds operational habits: keep managed rulesets at default High sensitivity for activation, use WAF and rate limiting, hide origin IPs (proxy DNS records—proxy DNS records), enable caching, and exclude query strings from cache keys to absorb randomized HTTP attack patterns.
Low-and-slow attacks (e.g. Slowloris, RUDY) are partly addressed because the CDN/WAF waits for complete HTTP requests and times out incomplete ones—see FAQ — low and slow. Under heavy L7 pressure, Under Attack mode is a last-resort interstitial that blocks suspicious clients.
DDoS alerts and analytics: how to see attacks that were mitigated
Section titled “DDoS alerts and analytics: how to see attacks that were mitigated”Analytics
- Security Events (analytics reference): L7 events including HTTP DDoS mitigations (also in Cloudflare Logs).
- Network Analytics: L3/4 traffic and attacks on IP ranges / Spectrum; Magic Transit operators use it as the primary DDoS view (Verify DDoS protection).
Internal DDoS rules may mitigate traffic without exposing a public rule ID in dashboards or logs—those rules are intentionally low false-positive.
Alerts
Configure notifications for ~1 minute real-time alerts (DDoS alerts): HTTP DDoS Attack Alert on WAF/CDN; L3/4 alerts on Spectrum / Magic Transit (Advanced L3/4 alerts Enterprise BYOIP). Emails include detection time, attack type, peak rate, target, and matched rule. Duplicate alerts for the same attack are suppressed within one hour, but configuring both standard and Advanced alert types for the same attack class can still duplicate notifications.
Reports
WAF/CDN customers can download monthly security reports; Magic Transit and Spectrum BYOIP get weekly email summaries (DDoS reports). Reports and alerts are independent data products.
For global trend research (not per-zone operations), Cloudflare Radar application layer attacks and network layer attacks document API endpoints; quarterly DDoS threat reports explain how attack counts and geography are derived.
Common mistakes when interpreting DDoS protection
Section titled “Common mistakes when interpreting DDoS protection”| Mistake | Why it misleads | What to do instead |
|---|---|---|
| Attacks hit origin IP directly | Traffic bypasses Cloudflare; edge rules never see it | Proxy records, firewall origin to Cloudflare IPs only (Proactive DDoS defense, Troubleshooting — Is Cloudflare attacking me?) |
| Testing HTTP DDoS on Magic Transit only | HTTP rules need reverse-proxy onboarding | Onboard HTTP app to CDN/WAF before simulation (Simulating test DDoS attacks) |
| Assuming alert silence means no L7 attack | Advanced TCP/DNS/Programmable mitigations lack alert types | Check Network Analytics and Security Events |
| High traffic from ASN 13335 | Workers, WARP, relays, health checks—not necessarily attack | See Analytics FAQ |
| Simulating attacks on shared properties | Policy violation | Only test your own onboarded properties; Enterprise Network Flow tests need account manager approval (DDoS testing guide) |
Signs you may be under attack while on Cloudflare include sudden slowness, analytics spikes, and abnormal origin log patterns (Under a DDoS attack?).
How to check this on your site
Section titled “How to check this on your site”-
Confirm DNS records for web traffic are proxied (orange cloud) so HTTP DDoS rules apply, per proxy DNS records.
-
Open Security → Events and review HTTP DDoS mitigations against your traffic baseline (DDoS analytics).
-
For IP/prefix workloads, open Network Analytics, filter mitigations from DDoS managed rulesets, and compare with executive summary attack IDs (Verify DDoS protection).
-
Configure at least one DDoS alert matching your plan (HTTP and/or L3/4) and send a test notification channel.
-
You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact wording you are asking about, and we will correct or clarify it.