-
Add a rate limit rule to the WAF’s
rules, in log-only mode. It counts each client IP’sPOSTs to/loginand records those over 20 in 5 minutes:{ "name": "login", "action": "rateLimit", "mode": "log", "rateLimit": { "limit": 20, "windowSeconds": 300 }, "conditions": [ { "type": "equals", "negate": false, "target": "path", "value": "/login", "caseSensitive": false }, { "type": "equals", "negate": false, "target": "method", "value": "POST", "caseSensitive": false } ] }Replace the WAF with UpdateWaf, sending the
ETagyou read inIf-Match. -
With logging on, see which clients went over:
ezgh obs search --environment production --service ezgh.waf --from 1d --contains '"terminatingRule":{"name":"login"' -
If only abusive clients show up, change the rule’s
modetoblock. Clients over the limit are answered403until their count in the last 5 minutes falls back under 20.
A client behind a shared address, such as an office’s network, shares its count with everyone there.
Exempt such an address with an allow rule above the limit.