diff --git a/config/action.d/mail.conf b/config/action.d/mail.conf index 5d06c121..88cbae25 100644 --- a/config/action.d/mail.conf +++ b/config/action.d/mail.conf @@ -43,7 +43,7 @@ actioncheck = # actionban = echo -en "Hi,\n The IP has just been banned by Fail2Ban after - attempts against
.\n + attempts against .\n Regards,\n Fail2Ban"|mail -s "[Fail2Ban] : banned " diff --git a/config/jail.conf b/config/jail.conf index ef876714..04adac31 100644 --- a/config/jail.conf +++ b/config/jail.conf @@ -10,8 +10,9 @@ enabled = true filter = sshd action = hostsdeny[file=/tmp/hosts.deny] + mail[name=SSH,dest=cyril.jaquier@bluewin.ch] maxretry = 2 -bantime = 5 +bantime = 10 [ssh] diff --git a/server/actions.py b/server/actions.py index eb0fb2c3..145560a7 100644 --- a/server/actions.py +++ b/server/actions.py @@ -134,6 +134,7 @@ class Actions(JailThread): aInfo = dict() bTicket = BanManager.createBanTicket(ticket) aInfo["ip"] = bTicket.getIP() + aInfo["failures"] = bTicket.getTime() logSys.info("Ban %s" % aInfo["ip"]) for action in self.actions: action.execActionBan(aInfo)