Fail2Ban monitors log files like /var/log/pwdfail or /var/log/apache/error_log and bans failure-prone addresses. It updates firewall rules to reject the IP address or executes user defined commands.
Please see code and download from https://github.com/fail2ban/fail2ban . SF Fail2ban portal might not be up-to-date
Started as part of the Google Summer of Code 2005, this tool adjusts security settings on Linux systems, including firewall and SELinux policies. This tool aims to replace the system-config-securitylevel tool from Red Hat and Fedora Core systems.
This toolkit will provide seemless backend support for multiple Firewall and IDS systems deployment. The initial release will only support Snort and FreeBSD\\\'s ipfw, but future releases will expand the firewall selection. The main code is Python,