Behavioural analysis or rate limiting? Lessons from stopping a volumetric attack
A fixed threshold fails in both directions: it blocks legitimate peaks and lets a quiet attack through. Behaviour, not volume, is what separates them.
On my first encounter with a traffic attack the intuitive answer was a single number, a threshold and a block. The first experiment exposed the problem clearly: during a legitimate peak hour the number reached exactly the same level as an attack during a quiet hour. A threshold alone cannot tell them apart.
Why a single number fails
- Legitimate peaks resemble attacks in shape: many requests from many addresses in a short window — that describes a successful marketing campaign as accurately as an attack.
- Smart attacks lower their number: spreading requests across many addresses and paths keeps the total modest.
- Thresholds rot: natural growth in usage turns yesterday's threshold into a blocker for new visitors.
What we added instead of a higher number
- A behavioural baseline: it learns the normal shape of traffic across different hours, not one number.
- Additional dimensions: inter-request timing, navigation path, page diversity and session behaviour.
- Behavioural fingerprints: grouping requests into behavioural clusters instead of judging each request alone.
- A graduated response: challenge, then limit, then confirmed block — the graduation gives legitimate users a path to finish what they were doing.
What did not work
Using request rate as the sole decision signal was rejected after measuring its false positives: it rose unacceptably during legitimate peaks. The other dimensions are what made the decision trustworthy.
Three numbers I would always track
- Response time during peaks, not the daily average.
- The share of requests challenged, not the number blocked.
- Time to return to normal after an attack ends — the most neglected number with the largest user impact.