Skip to content

Commit

Permalink
Changes to .conf file and jail.local settings to prevent hundreds of …
Browse files Browse the repository at this point in the history
…emails after a server reboot.
  • Loading branch information
mitchellkrogza committed Dec 17, 2016
1 parent c741611 commit f7b42f4
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 7 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 <mitchellkrog@gmail.com>
#####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:
Expand Down
5 changes: 3 additions & 2 deletions action.d/blacklist.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Fail2Ban Blacklist for Repeat Offenders (action.d)
#
# Author: Mitchell Krog <mitchellkrog@gmail.com>
# 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
Expand All @@ -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
Expand Down Expand Up @@ -77,6 +77,7 @@ actioncheck = <iptables> -n -L <chain> | grep -q 'f2b-<name>[ \t]'
actionban = <iptables> -I f2b-<name> 1 -s <ip> -j DROP
# Add the new IP ban to our ip.blacklist file
echo '<ip>' >> /etc/fail2ban/ip.blacklist
curl http://www.badips.com/add/badbots/<ip>/

# Option: actionunban
# Notes.: command executed when unbanning an IP. Take care that the
Expand Down
7 changes: 3 additions & 4 deletions filter.d/blacklist.conf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Fail2Ban Blacklist for Repeat Offenders (filter.d)
#
# Author: Mitchell Krog <mitchellkrog@gmail.com>
# 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
Expand Down Expand Up @@ -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]
Expand All @@ -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+<HOST>\s*$

ignoreregex =

[Init]

journalmatch = _SYSTEMD_UNIT=fail2ban.service PRIORITY=5

# Author: Mitchell Krog
# Author: Mitchell Krog
1 change: 1 addition & 0 deletions jail.local
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
[blacklist]
enabled = true
logpath = /var/log/fail2ban.*
filter = blacklist
banaction = blacklist
bantime = 31536000 ; 1 year
findtime = 31536000 ; 1 year
Expand Down

0 comments on commit f7b42f4

Please sign in to comment.