The Journal

The Bots Come Knocking: Surviving a Credential-Stuffing Storm

Every public-facing mail server lives a double life. To me it is a carefully maintained service with healthy graphs. To a rotating cast of automated credential stuffers it is a door worth trying several thousand times a day. For a long stretch my Dovecot and Postfix logs showed nonstop authentication failures from a handful of subnets, and it was time to stop describing the problem and start designing a response I could trust.

Principle one: a ban is a policy, not a mood. I wrote the policy down before writing any rules. Three authentication failures within an hour earns a one-day ban. A repeat offense within thirty days earns a longer stay. Attackers from regions that have no business authenticating to my personal network at all get banned permanently on the first strike, with explicit carve-outs for the address ranges I administer from and my own infrastructure, permanently. United States and Canadian addresses are never geo-banned outright; if a domestic address looks hostile, it has to earn its way through the same ladder as everyone else, because someday the hostile address will be my own laptop from a hotel.

Principle two: alerting should tell me what the ladder already handled. The part I did not want was a pager that treats normal internet noise as news. The alert rule that earns my attention is a rate: if a single source crosses fifty failed attempts within an hour, that is a campaign, not noise, and I get a message on my phone describing who it was and how hard they were trying. Everything slower than that dies quietly in the ladder. The first live alert arrived within days of deployment and told me exactly what I wanted to know: two addresses hammering well over a hundred attempts an hour, already banned by the time the alert mentioned them. The alert described history. The ladder handled the present.

The surprise: volume is not the enemy. After the big offenders were permanently gone, the raw failure count barely moved. Smaller actors kept arriving at a steady drip, the way rain does. That reframed monitoring for me: the number that matters is never yesterday’s total volume, it is whether any single source is accelerating. Volume is weather. Acceleration is news.

What I check anyway. Trust, but verify, with boring rituals: make sure the enforcement service is actually running and has been since boot, that the permanent list is intact, and that every service the bans protect is still listening where it should be. An alarm system you never test is a decoration. The whole design has one goal: failures I can see, escalation I wrote down in advance, and silence I can actually trust.

#security#fail2ban#mail#linux