Fail2ban on CentOS 6.5 - rharmonson/richtech GitHub Wiki

#Fail2ban on CentOS 6.5

Fail2Ban is used to monitor logs for inappropriate activity and update iptables to block the offender's IP address.

Prior to installing Fail2ban, the EPEL repository needs to install. See the article below for EPEL installation instructions.

https://github.com/rharmonson/techwiki/wiki/EPEL-Repository-on-CentOS-6.5

##Install Fail2ban and dependencies

# yum install fail2ban

Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
  Installing : ed-1.1-3.3.el6.x86_64                                        1/4
  Installing : gamin-python-0.1.10-9.el6.x86_64                             2/4
  Installing : python-inotify-0.9.1-1.el6.noarch                            3/4
  Installing : fail2ban-0.8.11-2.el6.noarch                                 4/4
  Verifying  : fail2ban-0.8.11-2.el6.noarch                                 1/4
  Verifying  : python-inotify-0.9.1-1.el6.noarch                            2/4
  Verifying  : gamin-python-0.1.10-9.el6.x86_64                             3/4
  Verifying  : ed-1.1-3.3.el6.x86_64                                        4/4

Installed:
  fail2ban.noarch 0:0.8.11-2.el6

Dependency Installed:
  ed.x86_64 0:1.1-3.3.el6                 gamin-python.x86_64 0:0.1.10-9.el6
  python-inotify.noarch 0:0.9.1-1.el6

##Configure Fail2ban A number of default filters exist under /etc/fail2ban/filter.d/. I would advise reviewing them and visit Fail2ban's website at http://www.fail2bain.org. In addition, Fail2ban wiki has a number of configuration examples for specific applications.

http://www.fail2ban.org/wiki/index.php/Category:Configuration
http://www.fail2ban.org/wiki/index.php/HOWTOs

For nginx, I found this site useful, but some of the information was either incorrect or out dated.

http://snippets.aktagon.com/snippets/554-how-to-secure-an-nginx-server-with-fail2ban