CDNPSRockSolid CDN

The numbers I check first during a CC attack

ArticlesCDNPS

When the alert fires, the first move is not turning on the 5-second shield. Spend two minutes figuring out who is hitting you, what they are hitting and whether the origin is coping, so the fix does not take out real users too.

A little after ten at night, the alert channel lights up with "site is down!!!"

It is very tempting to crank every protection to the max right away. I used to do exactly that. Turn on the 5-second shield, attack blocked, and the customer's mobile app dies with it, because API calls from an app cannot run a JavaScript challenge. That night was worse than the attack.

So now, no matter how urgent it feels, I spend two minutes on a few numbers first.

Request rate compared with the same time yesterday. Not the absolute value. A site that normally does 300 requests a second at night and is now at 3,000 is in trouble. One that normally does 2,500 and is now at 3,000 might just be running a promotion. Comparing with yesterday at the same hour tells you more than staring at the graph.

How concentrated the traffic is by IP and by range. Normal traffic is spread out; the top 10 IPs rarely add up to 5%. If the top 10 are half of everything, or a big chunk comes from one /24, you have found it. Then check whether those IPs belong to data centers. Traffic from cloud servers looks nothing like home broadband or mobile users.

Which URLs are being hit. CC attacks rarely spread evenly across a site. They lean on one or two expensive endpoints: search, login, or the home page with random parameters to dodge the cache. If 90% of requests land on /search?q=random, rate-limit that path on its own. Far better than raising the level for the whole site.

Then the origin. If the share of 5xx responses from the origin and the origin response time are both climbing, the origin is going under and you need to act now. If block counts at the edge are rising but origin metrics look normal, protection is already doing its job and there is no need to start changing settings in a panic.

Last, a glance at user agents. Plenty of scripts never bother to change theirs, so you see a wall of python-requests or a dozen Chrome builds with the exact same version string.

After that the response is usually obvious:

  • A few IPs or ranges: block the range, and it drops within seconds
  • Mostly data-center IPs: JavaScript-challenge IDC sources instead of banning them, so legitimate API callers hosted in the cloud still get through
  • One URL under fire: rate-limit just that path

I keep the site-wide 5-second shield for last, and only after checking whether an app or a third party calls the site's API.

Our nodes have a lazy shortcut for this. If two or more nodes ban the same IP within 10 minutes, the control plane promotes it to a network-wide ban: 30 minutes first, then 6 hours, then 24. Quite often, by the time I finish reading these numbers, most of the attack has already been handled, and the only thing left for a human is deciding whether a rule might hit real users.