fail2ban
A Linux tool that watches log files for repeated failed logins and temporarily blocks the addresses they come from.
In more detail
It reads logs such as the SSH authentication log, counts failures per address, and adds a firewall rule to ban an address that fails too often within a time window. Its behaviour is set in jails, each with its own thresholds and an ignore list of addresses that are never banned. It is both a detective and a corrective control, and it slows guessing but does not replace strong authentication.
Example
fail2ban-client status sshdRelated terms
- jail — In fail2ban, a named rule set that ties one log file and filter to the ban settings and actions used for one service, such as SSH.
- jail.local — The file where you put your own fail2ban settings, which override the packaged defaults in jail.conf.
- brute force attack — Trying many passwords against one account until one works.
- auth.log — The Linux log file that records logins, SSH sessions, sudo use and other authentication events.
Taught in
- Defense-in-Depth & Security Control Categories — Cybersecurity Fundamentals, GRC & Cryptography