Ban hosts that cause multiple authentication errors
open sourceGPL-2.0-or-laterself-hostablefree
Fail2Ban is a daemon that scans log files such as /var/log/auth.log and bans IP addresses that show malicious signs, like too many failed logins, by adding firewall rules that reject their connections for a configurable time. It comes with filters and jails for many standard services (sshd, Apache and more) and can be pointed at any log file and any error pattern, reading logs by polling, inotify or the systemd journal. It matches IPv6 addresses as well as IPv4, and is run and inspected with fail2ban-client. It's written in Python, GPLv2+, and packaged by most Linux distributions.
Problems it solves
- my server's SSH log is full of brute-force login attempts from random IPs
- automatically block an IP address after a few failed logins
- bots keep hammering the login page of my self-hosted app
- temporarily ban hosts that trigger errors in any log file I choose
- add firewall rules automatically when someone attacks my mail server
- cut down the noise of password-guessing attacks on my VPS
- ban abusive IPv6 addresses as well as IPv4
- protect my home server's exposed services without a commercial security product
Features
- scans log files and bans IPs with too many failures
- updates firewall rules to reject banned IPs for a configurable time
- ready-made filters for standard services such as sshd and Apache
- custom filters for any log file and any error pattern
- IPv6 matching since v0.10
- polling, pyinotify or systemd journal backends
- fail2ban-client to control and inspect jails
Capabilities
| Has a command line tool | plan not known |
|---|
Alternatives
The same job
These do what Fail2Ban does.
- CrowdSec Open-source IDS/IPS, WAF and bot detection with a crowdsourced blocklist of malicious IPs
