From f7b42f4d0b72d1984c4537cc8492cfa28419091b Mon Sep 17 00:00:00 2001 From: "Mitchell Krog (Desktop)" Date: Sat, 17 Dec 2016 16:44:48 +0200 Subject: [PATCH] Changes to .conf file and jail.local settings to prevent hundreds of emails after a server reboot. --- README.md | 5 ++++- action.d/blacklist.conf | 5 +++-- filter.d/blacklist.conf | 7 +++---- jail.local | 1 + 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 064cc1d..52c6bf4 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,14 @@ recidive is set to enabled = false do not have both this jail and recidive running at the same time #####Author: Mitchell Krog -#####Version: 1.0 +#####Version: 1.1 ######GitHub: https://github.com/mitchellkrogza/Fail2Ban-Blacklist-JAIL-for-Repeat-Offenders-with-Perma-Extended-Banning ######Blog: https://ubuntu101.co.za/ ######Fail2Ban: http://www.fail2ban.org/wiki/index.php/Main_Page +### Changes Made +#### 2016-12-17 - Modified files to prevent hundreds of emails each time server starts up. + ####Tested On: Fail2Ban 0.91 ####Server: diff --git a/action.d/blacklist.conf b/action.d/blacklist.conf index 96b5b5f..b0d583c 100644 --- a/action.d/blacklist.conf +++ b/action.d/blacklist.conf @@ -2,7 +2,7 @@ # Fail2Ban Blacklist for Repeat Offenders (action.d) # # Author: Mitchell Krog -# Version: 1.0 +# Version: 1.1 # GitHub: https://github.com/mitchellkrogza/Fail2Ban-Blacklist-JAIL-for-Repeat-Offenders-with-Perma-Extended-Banning # Tested On: Fail2Ban 0.91 # Server: Ubuntu 16.04 @@ -25,12 +25,12 @@ # [blacklist] # enabled = true # logpath = /var/log/fail2ban.* +# filter = blacklist # banaction = blacklist # bantime = 31536000 ; 1 year # findtime = 31536000 ; 1 year # maxretry = 10 # -# [INCLUDES] before = iptables-common.conf @@ -77,6 +77,7 @@ actioncheck = -n -L | grep -q 'f2b-[ \t]' actionban = -I f2b- 1 -s -j DROP # Add the new IP ban to our ip.blacklist file echo '' >> /etc/fail2ban/ip.blacklist + curl http://www.badips.com/add/badbots// # Option: actionunban # Notes.: command executed when unbanning an IP. Take care that the diff --git a/filter.d/blacklist.conf b/filter.d/blacklist.conf index 9727a0d..bc75781 100644 --- a/filter.d/blacklist.conf +++ b/filter.d/blacklist.conf @@ -2,7 +2,7 @@ # Fail2Ban Blacklist for Repeat Offenders (filter.d) # # Author: Mitchell Krog -# Version: 1.0 +# Version: 1.1 # GitHub: https://github.com/mitchellkrogza/Fail2Ban-Blacklist-JAIL-for-Repeat-Offenders-with-Perma-Extended-Banning # Tested On: Fail2Ban 0.91 # Server: Ubuntu 16.04 @@ -36,12 +36,12 @@ # [blacklist] # enabled = true # logpath = /var/log/fail2ban.* +# filter = blacklist # banaction = blacklist # bantime = 31536000 ; 1 year # findtime = 31536000 ; 1 year # maxretry = 10 # -# [INCLUDES] @@ -59,11 +59,10 @@ _daemon = fail2ban\.actions\s* _jailname = blacklist failregex = ^(%(__prefix_line)s| %(_daemon)s%(__pid_re)s?:\s+)NOTICE\s+\[(?!%(_jailname)s\])(?:.*)\]\s+Ban\s+\s*$ - ignoreregex = [Init] journalmatch = _SYSTEMD_UNIT=fail2ban.service PRIORITY=5 -# Author: Mitchell Krog +# Author: Mitchell Krog \ No newline at end of file diff --git a/jail.local b/jail.local index 9efd2bb..9c2f1bd 100644 --- a/jail.local +++ b/jail.local @@ -10,6 +10,7 @@ [blacklist] enabled = true logpath = /var/log/fail2ban.* +filter = blacklist banaction = blacklist bantime = 31536000 ; 1 year findtime = 31536000 ; 1 year