Fail2Ban Favicon

Fail2Ban

Fail2Ban is a lightweight open-source intrusion prevention tool that monitors log files and dynamically bans IP addresses showing malicious behavior such as brute-force login attempts.

Endpoint Security open-source intrusion-prevention log-monitoring brute-force-protection

Overview

Fail2Ban is a free and open-source intrusion prevention framework written in Python that scans log files such as SSH auth logs, Apache and Nginx access logs, and mail server logs for patterns indicating brute-force attacks, credential stuffing, or abusive behavior. When a pattern matches a configured filter, Fail2Ban executes an action (ban) that blocks the offending IP address for a set duration using the host's firewall, such as iptables, nftables, or firewalld. Bans can be temporary or permanent, and jails can be configured per service with custom thresholds and ban durations. Fail2Ban is lightweight, runs on Linux, and integrates with systemd, Docker, and popular web hosting stacks. Recent releases have added support for nftables as a first-class backend and improved IPv6 handling.

Primary Use Cases

Protecting SSH servers from brute-force attacks by monitoring auth logs and banning offending IPs via iptables, nftables, or firewalld.
Defending web applications and CMS logins (Apache, Nginx, WordPress, Drupal) against credential stuffing and abusive request patterns by analyzing access logs.
Hardening mail servers (Postfix, Dovecot, Exim) against spam, relay abuse, and password guessing by banning abusive source IPs automatically.

Frequently Asked Questions

Yes. Fail2Ban is released under the GNU General Public License version 2 (GPL v2) and is free for both personal and commercial use. It is packaged in virtually all major Linux distributions.

As of September 2026, the current stable release is Fail2Ban 1.1.x, with continued improvements to nftables support, systemd integration, and compatibility with modern Python 3 versions.

A firewall applies static rules to allow or deny traffic based on addresses, ports, or protocols. Fail2Ban is dynamic: it watches logs for signs of abuse and then creates temporary firewall rules to block offending IPs. It works alongside the firewall rather than replacing it.

Yes. Fail2Ban ships with filters for many services including Apache, Nginx, Postfix, Dovecot, Exim, vsftpd, WordPress, and more. Custom filters can be written for any service that writes logs, making it highly extensible for on-premises and self-hosted environments.

Yes. Fail2Ban can run inside Docker containers, but the container needs access to the host's log files and the capability to modify the host firewall, or alternatively run in a sidecar pattern with shared volumes. Many deployments install Fail2Ban directly on the host and point it at container logs instead.

Metadata

Official Website Visit Website
Category Info

Endpoint Security covers tools that protect and monitor individual devices such as servers and workstations against brute-force attacks, malware, unauthorized access, and other host-level threats.

Added On

September 16, 2026

Last Updated

September 16, 2026

Threat Detection

MITRE ATT&CK Navigator is a free web-based tool for visualizing, annotating, and comparing coverage of adversary tactics and techniques from...

Penetration Testing

Impacket is a collection of Python classes for working with network protocols, widely used by penetration testers for Windows and Active Dir...

Identity Security

BloodHound is an open-source Active Directory and Azure AD attack path analysis tool that uses graph theory to reveal hidden privilege escal...