Fail2ban
Reads log files, looks for patterns that resemble failed logins and blocks the source IP in the firewall for a while. Written in Python by Cyril Jaquier in 2004.
It's configured as "jails", one per service: a filter with regular expressions matching the log lines, plus rules for how many hits within what time window earn how long a ban. The default sshd jail is where everyone starts, but the same model works for Postfix, nginx, Apache and applications with their own logs. The main benefit is that logs become readable — the noise from automated scanning disappears. Against a targeted attack it helps marginally, and it never replaces key-based authentication with password login disabled. Alternatives: CrowdSec, which also shares observations between installations, and sshguard.