[packages/fail2ban] lag-visibility: append age also to 'already banned' lines small age = IP still hits the log despite
arekm
arekm at pld-linux.org
Wed Jul 22 11:39:43 CEST 2026
commit d56d3d6efbe7176fa01f7baf4ab8f89888c33c44
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Jul 22 10:24:08 2026 +0200
lag-visibility: append age also to 'already banned' lines
small age = IP still hits the log despite ban, large = backlog processing
fail2ban-lag-visibility.patch | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
---
diff --git a/fail2ban-lag-visibility.patch b/fail2ban-lag-visibility.patch
index 892acf3..c2019d9 100644
--- a/fail2ban-lag-visibility.patch
+++ b/fail2ban-lag-visibility.patch
@@ -1,6 +1,6 @@
diff -ru a/fail2ban/server/actions.py b/fail2ban/server/actions.py
---- a/fail2ban/server/actions.py 2026-07-22 09:05:36.238602309 +0200
-+++ b/fail2ban/server/actions.py 2026-07-22 09:05:36.239475119 +0200
+--- a/fail2ban/server/actions.py 2026-07-22 10:20:01.701693349 +0200
++++ b/fail2ban/server/actions.py 2026-07-22 10:20:01.702622778 +0200
@@ -503,7 +503,10 @@
# report ticket to observer, to check time should be increased and hereafter observer writes ban to database (asynchronous)
if Observers.Main is not None and not bTicket.restored:
@@ -13,9 +13,21 @@ diff -ru a/fail2ban/server/actions.py b/fail2ban/server/actions.py
# do actions :
for name, action in self._actions.items():
try:
+@@ -537,7 +540,10 @@
+ ll = logging.DEBUG if diftm < 3 \
+ else logging.NOTICE if diftm < 60 \
+ else logging.WARNING
+- logSys.log(ll, "[%s] %s already banned", self._jail.name, ip)
++ # small age = IP still reaches the log despite the ban (action not
++ # effective?); large age = just processing a log backlog
++ age = '' if ticket.restored else ' (age %ds)' % max(0, int(MyTime.time() - ticket.getTime()))
++ logSys.log(ll, "[%s] %s already banned%s", self._jail.name, ip, age)
+ # if long time after ban - do consistency check (something is wrong here):
+ if bTicket.banEpoch == self.banEpoch and diftm > 3:
+ # avoid too often checks:
diff -ru a/fail2ban/server/filter.py b/fail2ban/server/filter.py
---- a/fail2ban/server/filter.py 2026-07-22 09:05:36.238824391 +0200
-+++ b/fail2ban/server/filter.py 2026-07-22 09:05:36.240029235 +0200
+--- a/fail2ban/server/filter.py 2026-07-22 10:20:01.701886387 +0200
++++ b/fail2ban/server/filter.py 2026-07-22 10:20:01.703064899 +0200
@@ -606,12 +606,12 @@
if self.__ignoreCache: c.set(key, False)
return False
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/fail2ban.git/commitdiff/74083ff58ee91ed27548f48338c086408de24f7f
More information about the pld-cvs-commit
mailing list