It’s 3:12am. Nobody on your team is awake, and your login endpoint is taking 8,000 requests a minute.
Nobody is typing them. A script is.
Automated attacks are a different problem
They’re not clever. They’re fast, cheap and patient. A script downloads your app, unpacks it, lists every endpoint it can find, and starts working through password lists leaked from other companies’ breaches. It runs at 3am precisely because that’s when nobody responds.
So every part of your defence has to assume nobody is awake. Three controls do that, in order of how much they change the outcome:

How does rate limiting stop a bot?
It takes the speed away, and speed is the only advantage the bot has. At 8,000 tries a minute, a password list is done in hours. At 10 a minute, it takes years, and the attacker goes looking for an easier target.
ASP.NET Core has this built in:
builder.Services.AddRateLimiter(o =>
o.AddFixedWindowLimiter("login", w => {
w.PermitLimit = 10;
w.Window = TimeSpan.FromMinutes(1);
}));
In Azure API Management, the equivalent is rate-limit-by-key keyed on the subscription or caller IP. Front Door WAF also has a rate-limit rule, and blocking at the edge costs you nothing at all: that’s the outermost layer in the five-layer request flow.
What smart lockout and MFA add
They make a correct guess useless. Microsoft Entra ID’s smart lockout is on by default and knows familiar locations from unfamiliar ones, so it can lock out the bot without locking out Priya on her usual phone. Add MFA through Conditional Access and a right password on its own stops being enough.
Credential stuffing only works because people reuse passwords. MFA is what makes that reuse survivable.
What to alert on
The rate of 401 and 403 responses, not individual errors. A sudden spike in 401s is somebody trying credentials, and it’s the earliest signal you’ll ever get. Wire the alert to a phone, not an inbox. An inbox at 3am is no alert at all.
Why doesn’t a CAPTCHA help?
This is the most common mistake. A CAPTCHA protects a web form. The bot isn’t using your web form. It’s calling the same API your app calls, straight from a server, and it never renders a single pixel of your UI. The control has to live at the API.
One small thing worth doing
Return the same response, and the same timing, for “no such user” and “wrong password”. If those differ, the script can work out which of your users exist, and a list of real accounts is worth more to an attacker than the guesses.
Key takeaways
- Automated attacks win on volume and persistence, not cleverness — design as if nobody is awake.
- Rate limiting, partitioned per user or IP, is the control that changes the economics of the attack.
- Entra ID smart lockout plus MFA neutralises a correct guess, which rate limiting alone can’t.
- Alert on the rate of 401/403s, and send it to a phone.
- A CAPTCHA protects a UI the bot never uses; the real control belongs at the API.
Official documentation: Entra smart lockout and API Management rate limiting.
Earlier in this series: Azure Key Vault Explained: The One Secret Tutorials Never Remove and Secure a Mobile API in Five Steps: The Order Is the Whole Point.
