Host your own email and enhance your privacy
Fired by Prometheus rule IMAPAuthFailureSpike — more than 25 Dovecot “auth failed” log lines on the imap tier in the last 5 minutes, sustained for 5 minutes.
Dovecot’s IMAP login process logged failed authentication attempts at a sustained rate of >5/min. The most common cause is a brute-force or credential-stuffing attempt against the public IMAP listener (port 993). Real users typing the wrong password rarely produce this volume.
Failed auth attempts don’t directly affect anyone — Dovecot rejects them and the attacker moves on. The risks are:
aws logs tail /ecs/cabal-imap --since 10m --filter-pattern '"auth failed"' \
| grep -oE 'rip=[0-9.]+' | sort | uniq -c | sort -rn | head
A small number of source IPs producing the bulk of attempts is a brute-force; many distinct IPs is a credential-stuffing campaign (harder to mitigate at the network layer).
aws logs tail /ecs/cabal-imap --since 10m --filter-pattern '"auth failed"' \
| grep -oE 'user=<[^>]+>' | sort | uniq -c | sort -rn | head
One user in particular → escalate that user’s password rotation and check whether their address is exposed publicly. Many users → spray.
imap-login: Login:
aws logs tail /ecs/cabal-imap --since 10m --filter-pattern '"imap-login: Login"' | head -20
Successful logins from the same IP-range as the failures = compromise. Treat as critical even though this alert is warning.
aws ec2 authorize-security-group-ingress --group-id <imap-listener-sg> --protocol tcp --port 993 --cidr 0.0.0.0/0 # already there
# SGs don't allow deny rules; use NACLs instead, on the public subnet:
aws ec2 create-network-acl-entry --network-acl-id <nacl> --rule-number 90 --protocol tcp --port-range From=993,To=993 --cidr-block <bad-ip>/32 --rule-action deny
supervisord.conf files. Re-enable, build, and redeploy. Once active, fail2ban will start banning at the iptables layer.auth_cache_negative_ttl and imap_login_processes_count_throttle settings) and to check user passwords for re-use against known-leaked lists.warning because most spikes are background noise. Promote to critical (manually, in your head) if any of the third-check signals come back positive.