Back to Blog
DDoSWAFWAF TestingDDoS TestingRate Limiting

WAF DDoS Testing: Rule Order, Inspection Limits and the WAF Under Flood

BlackNeuron Research Team
November 17, 2026
14 min read
WAF DDoS Testing: Rule Order, Inspection Limits and the WAF Under Flood

A web application firewall is a server, and a flood is a workload.

Most WAF testing ignores that. It sends a crafted request, checks that the right rule matched, and moves on. That answers whether the WAF can recognise an attack. It says nothing about what the WAF does when ten thousand requests a second arrive and most of them look fine.

Under a flood the WAF stops being only a classifier. It is a component with a CPU budget, a body-size limit, a rule order that every request walks, a failure mode and a log pipeline. Any of those can give out before the origin does. This post is about testing the WAF as that component: the part of WAF testing that belongs to DDoS testing.

Two tests that share a name

"WAF testing" usually means one of two things, and only one of them tells you how the WAF behaves under a flood.

Functional WAF testWAF DDoS test
QuestionDoes rule X match payload Y?What does the WAF do at flood rates?
TrafficA handful of crafted requestsSustained volume, mostly valid-looking
Unit of resultOne rule, matched or notThe WAF's throughput, latency and verdicts over time
Typical findingA signature gapRule order, inspection limits, a failure mode, missing logs
Where it is readThe WAF's own logThe client, the WAF and the origin, compared

The functional test is the security team's tool and it is worth doing. Everything below concerns the right-hand one. What every DDoS test shares (planning, ceilings, abort rules) is laid out in the complete guide to DDoS testing, and what a WAF is and where it sits is on the WAF definition page.

Before the first rule runs

A WAF can only judge a request, so it only acts once a whole request exists. A lot of the work a flood causes happens before that point.

What a WAF sees, and when A rule can only judge a complete request. Much of a flood's work happens before one exists. UDP floods SYN floods Handshake floods Slow headers Slow POST Request floods Packets TCP handshake TLS handshake Headers Body WAF rules Origin No complete request yet: no rule can act Met by the provider edge, scrubbing, the TLS terminator and the proxy's timeouts The WAF decides here Body read only up to its inspection limit A WAF DDoS test records, for every vector, which layer met it first. BlackNeuron™
Where a WAF decides in the life of a request: packets, the TCP handshake, the TLS handshake and the request headers all arrive before any WAF rule can run, so SYN and UDP floods, TLS handshake floods and slow-header attacks land on the layers in front of the WAF; the rules only evaluate once a complete request exists, and body inspection only covers the first part of the body

Packets and handshakes

A SYN flood or a UDP flood is never a request, so no WAF rule ever sees it. The network layer, the provider edge or a scrubbing service has to absorb it.

The TLS handshake is the same story one step up. The WAF reads plaintext, so the handshake must finish before a rule can run, and a TLS handshake flood spends the terminator's CPU without ever producing a request to judge. Whoever terminates TLS in front of the WAF owns that load.

Headers that never finish

A slow-header attack sends a request one header at a time and never sends the blank line that ends the headers. ModSecurity's first phase runs once the request headers have been read, so a Slowloris connection never reaches it.

That attack belongs to the proxy's timeouts (in NGINX, client_header_timeout), not to the ruleset. A WAF report that says "slow attacks: covered" because a rule exists for them is reading the wrong layer.

Requests cancelled before they are answered

On HTTP/2 a client can open a stream and reset it a moment later. In the Rapid Reset pattern the cost is in stream setup and teardown inside the proxy, which happens whether or not a WAF rule ever weighs in. Whether the edge caps reset streams per connection is a proxy setting, and the test reads it there.

What this means for the test

A WAF DDoS test separates "the WAF did nothing" from "the WAF never saw it". For every vector in the plan, it records which layer met it first. Only the vectors that arrive as complete requests are fair questions for the WAF.

Rule order is a bill every request pays

A WAF evaluates rules in order. A request walks the list until a rule takes a terminating action (block, allow, challenge) or the list runs out. A flood request that looks valid matches nothing for most of the walk, so it pays for every rule in front of the one that finally stops it.

The rule walk a flood request pays for Same request, same verdict. Capacity units are AWS WAF's published WCUs. Cheap rules first: stopped after 4 WCU IP set 1 WCU Geo match 1 WCU Rate rule 2 WCU, blocks Core rule set 700, not reached SQL database 200, not reached Bad inputs 200, not reached Managed groups first: stopped after 1,102 WCU Core rule set 700 WCU SQL database 200 WCU Bad inputs 200 WCU Rate rule 2 WCU, blocks Every pattern group runs on every flood request first. Anomaly scoring (ModSecurity with the OWASP CRS): every rule runs Rule 1 adds to score Rule 2 adds to score Rule n all of them Score check end of phase Block if score 5 or more On a self-hosted engine the walk is your CPU. On a managed edge it is the provider's, and it shows as latency. BlackNeuron™
WAF rule order for a flood request: with an IP set, a geo rule and a rate rule first, the request is blocked after 4 capacity units of cheap checks; with the managed core rule set, the SQL database group and the known bad inputs group first, every flood request is inspected by every expensive group before the rate rule blocks it at 1,102 units; under anomaly scoring, every rule runs and the block is decided at the end

Cheap rules first

The cheap rules are exact lookups: an IP set, a country, a rate counter, a header that must be present. The expensive ones are pattern matches over the URI, the headers and the body, which is what most managed rule groups are.

Put the rate rule after the managed groups and every flood request is pattern-matched in full before the rate rule ever counts it. Put it first and most of the flood is dropped after one counter lookup. The verdict for the flood is the same either way. The work the WAF does to reach it is not.

AWS publishes the cost

AWS WAF prices rule complexity in web ACL capacity units (WCUs), its own measure of the resources a rule needs. An IP set match is 1 WCU and a rate-based rule starts at 2. The Amazon IP reputation list is 25. The core rule set is 700, and the SQL database and known bad inputs groups are 200 each. A web ACL's default budget is 1,500.

A WCU is a configuration measure, not a latency figure, so it does not say how long a request takes. It does say, in AWS's own units, how much inspection a request buys before it reaches a given rule. Add up the rules in front of the rate rule and the order becomes a number: 4 WCUs behind an IP set and a geo match, 1,102 behind the three big managed groups.

2026-11-17T07:05:50.553738 image/svg+xml Matplotlib v3.5.1, https://matplotlib.org/ 0 200 400 600 800 1000 1200 WCU IP set, geo, rate rule IP reputation, then rate Core rule set, then rate Core + SQL + bad inputs, then rate 4 WCU 27 WCU 702 WCU 1102 WCU AWS WAF WCUs a flood request passes before a rate rule blocks it Source: AWS WAF published WCU per rule; the four orders are illustrative Rule capacity paid before the block BlackNeuron™
Bar chart of the cumulative AWS WAF capacity units a flood request passes through before a rate-based rule blocks it, in four illustrative orders: 4 after an IP set and a geo match, 27 after the IP reputation list, 702 after the core rule set, and 1,102 after the core rule set plus the SQL database and known bad inputs groups

On a managed edge that work runs on the provider's machines, so it shows up as added latency, if at all, and the bill does not depend on the order. On AWS WAF the charge is per request processed, blocked or not, which is why a long flood shows up on the invoice even when every request was stopped. Measuring that invoice per meter is what EDoS testing does.

Anomaly scoring runs every rule

Self-hosted WAFs built on ModSecurity usually run the OWASP Core Rule Set in anomaly scoring mode. Each matching rule adds to a score, and the block decision is taken at the end of the request phase, after every rule in that phase has run. The default inbound threshold is 5, which one critical match reaches.

So in the default setup a flood request runs the whole ruleset before anything decides. Raising the paranoia level from 1 towards 4 adds rules and multiplies that work. CRS has an early-blocking setting that checks the score after the header phase too, and a test should know whether it is on.

On a self-hosted engine all of this is your CPU. With the ModSecurity connector for NGINX it is the worker process's CPU, so a saturated ruleset and a saturated proxy are the same event.

One pattern can cost a core

A regular expression with catastrophic backtracking turns one request into seconds of CPU. A WAF is a large collection of regular expressions, and one bad pattern in a ruleset update has taken a large provider's WAF down worldwide before. The mechanism and the fix (linear-time engines, match limits) are on the ReDoS page. For the test, the point is that a ruleset update is a change to the WAF's capacity, and deserves a re-run like any other capacity change.

The body the WAF stops reading

Every WAF inspects a request body only up to a limit. What happens to the rest is a setting, and under a flood it decides two things: how much memory the WAF spends, and what reaches the origin uninspected.

The limits

On AWS WAF, protections attached to an Application Load Balancer or AppSync inspect the first 8 KB of the body. CloudFront, API Gateway and a few other resource types inspect 16 KB by default, adjustable upwards to 64 KB. Each rule that reads the body carries an oversize setting: continue as if the part it saw was the whole body, treat the request as a match, or treat it as no match.

ModSecurity has the same decision in different words. SecRequestBodyLimit caps the body it will accept (the recommended configuration ships 13,107,200 bytes, SecRequestBodyNoFilesLimit caps bodies without file uploads at 131,072 bytes), and SecRequestBodyLimitAction chooses between Reject and ProcessPartial.

Why a flood cares

Continue and ProcessPartial let the part past the limit through without a look. That is a reasonable trade for legitimate uploads. Under a flood it means large-body requests that pass the first 8 KB of checks reach the application whole, and the application pays to parse them.

Reject and "treat as match" refuse oversize bodies outright. That protects the origin and turns away every legitimate client that sends a large body. Which side of that trade you are on is a decision; the test makes sure it was taken on purpose.

Buffering is the other half. A WAF that reads the body before deciding has to hold it, in memory up to SecRequestBodyInMemoryLimit and on disk after that. A slow-POST attack aimed at a buffering WAF occupies the WAF's memory and connections, not the origin's.

What the test does

The run sends a share of its requests with bodies just under the limit, just over it and far over it, at flood rate. It then reads the origin's logs to see which of them arrived and how large, and the WAF host's memory to see what the buffering cost.

When the WAF runs out first

If the WAF is the first component to saturate, it fails one of two ways. It fails closed and everyone waits, or it fails open and traffic reaches the origin without inspection. Each is a defensible design. A team that cannot say which design it runs has a gap.

When the WAF is the first thing to run out Both directions happen in production. Not knowing which one you have is the finding. Flood plus real users WAF at its limit CPU, memory, timeout Fails closed Requests queue or are refused at the WAF Origin: protected Real users: turned away as well Typical of in-process modules (ModSecurity inside NGINX) Fails open Requests skip inspection and reach the origin Origin: takes the flood uninspected Real users: served while the origin lasts Typical of inspection agents with a timeout, appliance bypass The test records the load where the WAF stopped keeping up, which way it failed, and whether an alert reached a person. BlackNeuron™
What happens when the WAF itself saturates: failing closed, requests queue or are refused at the WAF, so the origin is protected but legitimate users are turned away too; failing open, requests bypass inspection and reach the origin, so the service stays reachable but the flood arrives uninspected; a test records which way it fails, at what load and whether anyone was alerted

In-process modules fail closed

A WAF compiled into the proxy, like ModSecurity in NGINX, cannot be bypassed by its own load. When rule evaluation eats the worker CPU, requests queue and time out. The origin is safe and the site is down anyway.

Agents and sidecars often fail open

Designs where the proxy calls out to a separate inspection service usually carry a timeout and an action for when it fires. Many default to letting the request through, because an inspection service that takes the site down on a hiccup will not be kept for long. Under a flood, that timeout turns the WAF into a pass-through at exactly the moment it is needed.

Appliances have a bypass

Inline appliances often have a bypass mode that passes traffic when the box is overloaded or fails. The on-premise post covers appliance placement; for the WAF the questions are which threshold triggers the bypass and whether anyone is told.

Managed edges move the limit, not the question

A managed cloud WAF has no CPU of yours to exhaust. What a flood strains there is the per-request bill and the rules' effect on latency. The platform-specific behaviour is covered for AWS WAF rate-based rules, for Azure Front Door and its WAF policies and for Cloud Armor's Adaptive Protection.

What the test records

Three facts per WAF: the load at which it stopped keeping up, which way it failed, and whether any alert reached a person. The second one is the one teams most often get wrong when asked from memory.

The settings teams change mid-incident

During an attack, people change WAF settings fast. Each emergency setting is a guess about what the flood will do to legitimate traffic, and the guess can be tested in advance.

Tighter managed rules

The usual move on a CRS-based WAF is to raise the paranoia level or lower the anomaly threshold. Both catch more, and both block more real users. Run the legitimate traffic mix against each emergency setting before the incident and record the false-positive rate for each. Then the person on call knows what the next notch costs before they turn it.

A challenge for everyone

Turning on a challenge for all traffic stops scripted floods that cannot run JavaScript. It also stops every client that is not a browser: your API consumers, the mobile app's background calls, payment webhooks and your own monitoring. The API and mobile backend posts cover those clients in detail.

A solved challenge also lasts. AWS WAF's default immunity time for a challenge or CAPTCHA token is 300 seconds, so a client that solves once is let through for five minutes. Against a flood driven by real browsers, the test measures what a token is worth in requests.

Count to block

Flipping a rule group from count to block is the most common mid-incident change and the one already covered most thoroughly: the block versus count page and the AWS rate-rule post both treat it. The new question here is load. A group in count mode still runs every pattern, so switching it to block saves origin capacity, not WAF capacity.

The WAF's own evidence under flood

After the test, the WAF's logs are where most teams look for the result. Under a flood those logs are themselves under load.

Samples are not records

The AWS WAF console shows sampled requests, a small sample per rule from recent hours. It is useful for looking at examples and useless for counting. Counting needs full logging to CloudWatch Logs, S3 or Firehose, and at flood rates that is a large, delayed and billed stream.

Self-hosted audit logs write in the request path

ModSecurity's audit log, with SecAuditEngine RelevantOnly, records requests whose status matches a pattern, and by default that includes 4xx responses. In a flood every blocked request is a 403, so every one is written. With SecAuditLogType Serial they all go to one file. The disk becomes part of the WAF's capacity, and a slow disk shows up as request latency.

The number to check

Count blocks at three points: the blocked responses the test client received, the blocks in the WAF's logs and the requests that reached the origin. If the WAF's log count is short of what the client saw, the logging dropped data under load, and any report built on those logs undercounts the attack.

A WAF DDoS test, area by area

AreaWhat the run doesPasses when
Pre-request vectorsSends handshake and slow-header traffic alongside the request floodEach is met by the layer meant for it; the WAF is not credited for it
Rule orderSends valid-looking requests that only the rate rule will stopThe rate or reputation rule terminates them before the managed groups run, or the cost of the order is known and accepted
Ruleset costRepeats the flood at each paranoia level or managed group set in useWAF latency and CPU stay inside the budget at the planned level
Body limitsSends bodies under, at and over the inspection limitThe oversize action matches the documented decision; origin receives what it was meant to
SaturationRaises load on the WAF tier until it stops keeping upThe failure direction is the expected one and an alert reaches a person
Emergency settingsRuns the legitimate mix against each setting on the runbookFalse-positive rate per setting is recorded before it is needed
EvidenceCounts blocks at client, WAF log and originThe three counts agree within a stated margin

The test runs under the same authorisation and abort rules as any other flood. How to keep it off real users is covered in testing without disrupting production, and how WAF behaviour fits with the rest of the application layer in L7 DDoS testing.

FAQ

Is WAF testing part of DDoS testing?

Partly. Checking that rules match attack payloads is application security testing. Checking how the WAF behaves at flood rates (rule cost, inspection limits, failure mode, logging) is DDoS testing, because the WAF is one of the components a flood can exhaust.

Does a WAF stop SYN floods or UDP floods?

No. A WAF only acts on complete HTTP requests, so network-layer floods and TLS handshake floods have to be absorbed by the layers in front of it: the provider edge, scrubbing, and whatever terminates TLS. A test should record which layer met each vector.

Should a WAF fail open or fail closed?

It depends on what the service can afford to lose: availability or inspection. A payment flow may prefer to refuse traffic rather than pass it uninspected; a news site may prefer the opposite. The important thing is that the choice is written down and a test confirms it.

Do blocked requests still cost money on a managed WAF?

On usage-priced managed WAFs, generally yes: AWS WAF charges per request processed, whether it is allowed or blocked. A long flood that is fully stopped can still produce a large bill, so the test plan should include a look at the invoice afterwards.

The firewall is inside the blast radius

Teams tend to treat the WAF as the thing that stands outside the system and protects it. Under a flood it is not outside anything. It is the first server most HTTP traffic meets, with its own CPU, memory, disk and limits, and the flood is aimed at whatever runs out first.

A few things about a WAF stay true for years: what it can see and what it cannot, the order in which its rules run, how much body it reads, which way it fails. Thresholds, managed rule versions and paranoia levels change every quarter, and each change moves the WAF's capacity a little.

The question a WAF DDoS test answers is not whether the WAF recognises an attack. It is how long the WAF keeps up once it does.