Fail2ban Explained

Fail2Ban
Fail2Ban
Logo Size:200px
Author:Cyril Jaquier
Programming Language:Python
Platform:POSIX
Genre:Intrusion prevention
License:GNU GPL v2

Fail2Ban is an intrusion prevention software framework. Written in the Python programming language, it is designed to prevent brute-force attacks.[1] It is able to run on POSIX systems that have an interface to a packet-control system or firewall installed locally, such as iptables or TCP Wrapper.[2]

Functionality

Fail2ban operates by monitoring log files (e.g.,, etc.) for selected entries and running scripts based on them.[3] Most commonly this is used to block selected IP addresses that may belong to hosts that are trying to breach the system's security. It can ban any host IP address that makes too many login attempts or performs any other unwanted action within a time frame defined by the administrator. It includes support for both IPv4 and IPv6.[4] [5] Optionally longer bans can be custom-configured for "recidivist" abusers that keep coming back. Fail2Ban is typically set up to unban a blocked host within a certain period, so as to not "lock out" any genuine connections that may have been temporarily misconfigured. However, an unban time of several minutes is usually enough to stop a network connection being flooded by malicious connections, as well as reducing the likelihood of a successful dictionary attack.

Fail2Ban can perform multiple actions whenever an abusive IP address is detected:[6] update Netfilter/iptables or PF firewall rules, TCP Wrapper's table, to reject an abuser's IP address; email notifications; or any user-defined action that can be carried out by a Python script.

The standard configuration ships with popular filters, including Apache, Lighttpd, sshd, vsftpd, qmail, Postfix and Courier Mail Server.[7] [8] Filters are defined by Python regexes, which may be conveniently customized by an administrator familiar with regular expressions. A combination of a filter and an action is known as a "jail" and is what causes a malicious host to be blocked from accessing specified network services. As well as the examples that are distributed with the software, a "jail" may be created for any network-facing process that creates a log file of access.[9]

Integrations

Fail2Ban can be integrated with many APIs, including blocklist.de and AbuseIPDB.[10] [11]

Shortcomings

See also

External links

Notes and References

  1. Web site: Server Hardening Linux Journal. Bledsoe. Greg. 2016-01-14. Linux Journal. en. 2018-09-22.
  2. Web site: How to protect your GNU/Linux computer from remote attacks with Fail2ban. Jordan. Jeff. 2015-06-16. Free Software Magazine. en. 2018-09-22.
  3. News: Defending Against Apache Web Server DDoS Attacks. Van Impe. Koen. 2015-12-09. IBM's Security Intelligence. 2018-09-22. en-US.
  4. Web site: 0.10.0 (2017/08/09) - long-awaited 0.10th version. G. Brester. Sergey. 2017-08-09. GitHub. en. 2018-09-22.
  5. News: IPv6 support finally arrive in Fail2Ban 0.10. Aleksandersen. Daniel. 2016-05-31. Ctrl blog. 2018-09-22. en.
  6. Web site: ducea.com . Using Fail2Ban to Block Brute Force Attacks . 2006-07-03.
  7. Web site: fail2ban/config/filter.d . GitHub.
  8. News: How to protect secure shell on CentOS 7 with Fail2ban. Wallen. Jack. 2016-12-23. TechRepublic. 2018-09-22. en.
  9. News: Casey . Brad . 2016-02-17 . Three server security tools you might not know . en-US . . 2018-09-22 . https://web.archive.org/web/20160217072739/https://searchdatacenter.techtarget.com/tip/Three-server-security-tools-you-might-not-know . 2016-02-17.
  10. Web site: Integrating AbuseIPDB with Fail2Ban . AbuseIPDB . 31 August 2021.
  11. Web site: www.blocklist.de -- Fail2Ban-Reporting Service (we sent Reports from Attacks on Postfix, SSH, Apache-Attacks, Spambots, irc-Bots, Reg-Bots, DDos and more) from Fail2Ban via X-ARF . Blocklist.de . 31 August 2021.