Field Note 007 / Availability

The flood is the noise.

The application-layer request that triggers an unindexed join is the signal. Most outages we're called in for weren't bandwidth. They were one expensive endpoint, hit cheaply, a few hundred times a second.

Cost asymmetry

A denial-of-service attack works when it costs the attacker much less to send a request than it costs you to answer it. A raw bandwidth flood needs a large botnet. A search endpoint that runs an unindexed query needs a laptop.

Search with a leading wildcard, reports over an unbounded date range, exports, password hashing on login, image resizing, deep pagination. Each is a legitimate feature and each is an amplifier.

Why the edge does not save you

Upstream scrubbing is built to recognize traffic that is abnormal in volume or shape. A few hundred well-formed requests per second, from many addresses, to a real URL, looks like a busy afternoon. It reaches your application, and your database falls over while the bandwidth graph stays flat.

The fix is in the application

Measure what every endpoint costs. Add the index, cap the range, paginate, cache, and put a timeout on every query. Give each client a budget based on cost and not only on request count. Decide in advance what the system stops doing when it is saturated, so the critical path survives. Then test it yourself before someone else does.

Related: DDoS counter-measures →Penetration testing & audits →

← Note 006All field notesNote 008 →

Have this problem
for real?

Book a callSend a message