Lab note · · 8 min read

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.

DDoSAnomaly detectionMeasurement

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

  1. A behavioural baseline: it learns the normal shape of traffic across different hours, not one number.
  2. Additional dimensions: inter-request timing, navigation path, page diversity and session behaviour.
  3. Behavioural fingerprints: grouping requests into behavioural clusters instead of judging each request alone.
  4. A graduated response: challenge, then limit, then confirmed block — the graduation gives legitimate users a path to finish what they were doing.
The metric I care about most: the cost of a false positive is far higher than the cost of a delay. That is why thresholds were tuned towards "one more challenge" rather than "an early block".

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.