Back to sketch

SYSTEM DESIGN SKETCHBOOK / PRACTICE SHEET / NO. 52

Design defensive detection and containment of coordinated bot traffic

Expert · 50 min · Security & reliability

A large consumer web service is being hit by automated traffic: credential stuffing on login, scraping of listing pages, and waves of fake signups. The traffic is spread across so many IP addresses and devices that each one looks harmless on its own, so simple per-IP rate limits stopped working. You are designing the defensive system that detects these coordinated campaigns and contains them while real users carry on normally.

Requirements

  • Score each request to sensitive endpoints (login, signup, listing and search pages) for automation risk, using both signals from the request itself and aggregate behaviour across IPs, devices and accounts.
  • Apply graduated responses: allow, add friction (a challenge or step-up verification), throttle, or block, per request and per detected campaign.
  • Give analysts a view of detected campaigns, with the ability to tune, roll back and audit containment rules, and to review false-positive appeals.
  • Continuously measure how often real users are wrongly challenged or blocked.

Constraints and assumptions

  • 300,000 requests/s at peak overall, of which 20,000/s hit login and signup.
  • Inline decisions may add at most 5 ms p99 at the edge. If the scoring service is unavailable, the edge must degrade gracefully rather than take the site down.
  • Campaigns rotate across 100,000+ residential IP addresses, each sending 1-5 requests an hour, and change tactics within minutes of being blocked.
  • Wrongly challenged or blocked logins must stay under 0.1% of legitimate sessions; a new campaign should be contained within 5 minutes of starting.
  • Raw IP addresses and device signals may be retained for at most 30 days.

Out of scope for the first sketch

Network-layer volumetric DDoS mitigation · Building the internals of the machine learning models · Takedown or legal action against attack infrastructure · Account recovery for already-compromised users

Draw your design

Rough math and notes

Done on paper? Compare with the worked approaches