How does Cloudflare's Adaptive DDoS Protection build a zone's traffic baseline, and which of its rules do zones on every plan get?
answer
- seven days of daily peaks
- 95th percentile, recalculated daily
- origins, user agents, locations
- origin errors on every plan
basics
~20 sAdaptive DDoS Protection profiles each zone's daily peak rates over the past seven days at the 95th percentile, then flags traffic that deviates; every plan gets the origin-errors rule, while the location and user-agent rules need Enterprise with Advanced DDoS Protection.
solid answer
~40 sAdaptive DDoS Protection keeps, per profiling dimension, the maximum traffic rate seen each day over a rolling seven-day window, recalculated daily, using 95th percentile rates to drop outliers and needing a minimum request rate to build a profile at all. The HTTP rules profile **origin errors**, **user agents** (against a profile built from Cloudflare's whole network) and **locations** (client country and region); the layer-3/4 rule profiles **protocols** for Magic Transit and Spectrum BYOIP. On every plan, only the origin-errors rule is included: it mitigates floods causing over 1,000 errors per second at High sensitivity, and on Pro and above the rate must also be at least five times normal. The full adaptive set needs Enterprise with Advanced DDoS Protection; its rules default to Log, so you read flagged traffic before choosing an action.
go deeper
Recall that adaptive rules compare traffic with the zone's own recent normal, and that the origin-errors rule exists on every plan.
Explain the seven-day window of daily peaks at the 95th percentile, the four dimensions, the 1,000 errors per second default and the five-times check on Pro and above.
Work the Log-first promotion: read logged traffic, step sensitivity down until buyers are not flagged, then enforce. Flag the per-zone profile problem on SaaS zones and the effect of new markets.
Weigh whether adaptive rules justify the Advanced DDoS Protection subscription for your traffic shape, and plan launches into new markets so the Locations profile does not fight the business.
## What "adaptive" means here The standard DDoS managed rules use Cloudflare-wide heuristics. **Adaptive DDoS Protection** adds rules that compare traffic with *your* zone's normal behaviour and flag deviations. Each adaptive rule watches one **profiling dimension**: | Rule | Dimension it profiles | Layer | Who gets it | |---|---|---|---| | For Origins | origin error rate | HTTP | the error rule on every plan | | For User-Agents | top user agents across Cloudflare's whole network | HTTP | Enterprise with Advanced DDoS Protection | | For Locations | client country and region | HTTP | Enterprise with Advanced DDoS Protection | | For Protocols | IP protocol, and country or region for UDP | L3/4 | Magic Transit and Spectrum BYOIP on Enterprise | ## How the baseline is built The profile mechanics are specific and worth stating precisely: 1. For each value of the dimension, for example each source country, Cloudflare records the **maximum rate seen each day**. 2. It keeps a **seven-day window** of those daily peaks and **recalculates the profile every day**. 3. To discard outliers it uses **95th percentile** rates, dropping the top 5% of the highest rates. 4. A zone needs a **minimum request rate** before any profile is built; a quiet zone may have none. 5. The HTTP adaptive rules also use Cloudflare's machine-learning models to spot traffic that is likely automated. The HTTP adaptive rules live in the HTTP DDoS ruleset; its `advanced` tag holds the rules for Advanced DDoS Protection features such as Adaptive DDoS Protection, and they are tuned with the same overrides as any other rule. The HTTP profile is computed **per zone**. On a Cloudflare for SaaS zone serving many customers' custom hostnames, the profile blends all of them, so it can be inaccurate for any single customer's hostname and the adaptive rules may be ineffective there. ## The origin-errors rule on every plan The HTTP DDoS ruleset includes an Origin Protect rule, "HTTP requests causing a high number of origin errors", that every plan gets: - At the *High* (default) sensitivity, it mitigates when the zone's HTTP error rate exceeds **1,000 errors per second**. - On **Pro, Business and Enterprise**, the error rate must also be **at least five times** the normal origin traffic level before mitigation applies. - It counts errors in the **52x** range and the **53x** range except **530**. You cannot exclude particular status codes from this calculation. - Its sensitivity can be lowered like any other rule if your origin legitimately produces bursts of these errors. For a ticketing site, this is the rule that notices when a flood is pushing the origin into 52x errors, even on a Free plan. ## Default action Log, and how to promote a rule The Adaptive DDoS Protection page gives the adaptive rules a default action of **Log** (the origin-errors rule above is the documented exception that mitigates past its threshold on every plan), so the first step with the location and user-agent rules is to observe: - In the security analytics events view, filter by `Service equals HTTP DDoS` and the adaptive rule's ID, and look for *Logged* traffic. - If nothing appears, either your traffic did not deviate from the profile (widen the time range) or the zone lacks the volume to build one. - If the logged traffic is clearly attack traffic, create an override that sets the rule to Managed Challenge or Block. - If it includes legitimate users, lower the rule's sensitivity and keep observing until legitimate traffic stops being flagged, then enable a mitigation action. - If it still catches legitimate traffic, use override expressions, available with Advanced DDoS Protection, to exclude that traffic. Logged results also depend on sensitivity: at the default *High* setting, the logs show only traffic over the internal High threshold, and at Medium or Low only traffic over those thresholds. ## Where adaptive rules can mislead - **A new market.** An on-sale that draws buyers from a country rarely seen in the past seven days is exactly what the Locations rule flags. Read it in Log before enforcing. - **A new client.** A new mobile app release with an unfamiliar user agent can stand out against the network-wide user-agent profile. - **A rebuilt baseline.** The window is only seven days, so a week of unusual traffic becomes the new normal. Cloudflare may also change the logic of these rules over time, so re-read flagged traffic after a rule update rather than assuming last quarter's tuning still fits.
- Why might an Enterprise zone with Advanced DDoS Protection see no Logged traffic from the adaptive rules at all?Either nothing deviated from the profile during the period viewed, so widen the time range, or the zone lacks the minimum request rate Cloudflare needs to build a profile. A quiet zone may simply have no baseline. Silence in Log is therefore not evidence that a rule is safe to set to Block.
- On a Free zone, a flood pushes the zone into 522 connection-timeout errors; when does the origin-errors DDoS rule mitigate?When the zone's error rate in the 52x and 53x ranges (excluding 530) passes 1,000 errors per second at the default High sensitivity. On Pro and above, the rate must also be at least five times the normal origin traffic level. A team can lower the rule's sensitivity, but it cannot exclude particular codes from the count.
- Saying every Cloudflare plan gets the location and user-agent adaptive rules.
- Enforcing the location and user-agent adaptive rules before reading what they logged.
- Describing the baseline as a 30-day average instead of seven days of daily peaks.
- Assuming the origin-errors rule counts every 5xx status, including 500 and 503.
- Trusting adaptive profiles on a SaaS zone shared by many custom hostnames.