mirror of https://github.com/fail2ban/fail2ban
small optimization for manually (via client / protocol) signaled attempt (performBan only if maxretry gets reached)
parent
9f1c6f1617
commit
68f827e1f3
|
@ -457,9 +457,9 @@ class Filter(JailThread):
|
||||||
logSys.info(
|
logSys.info(
|
||||||
"[%s] Attempt %s - %s", self.jailName, ip, datetime.datetime.fromtimestamp(unixTime).strftime("%Y-%m-%d %H:%M:%S")
|
"[%s] Attempt %s - %s", self.jailName, ip, datetime.datetime.fromtimestamp(unixTime).strftime("%Y-%m-%d %H:%M:%S")
|
||||||
)
|
)
|
||||||
self.failManager.addFailure(ticket, len(matches) or 1)
|
attempts = self.failManager.addFailure(ticket, len(matches) or 1)
|
||||||
|
|
||||||
# Perform the ban if this attempt is resulted to:
|
# Perform the ban if this attempt is resulted to:
|
||||||
|
if attempts >= self.failManager.getMaxRetry():
|
||||||
self.performBan(ip)
|
self.performBan(ip)
|
||||||
|
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Reference in New Issue