fix w trackerze
This commit is contained in:
@@ -150,6 +150,10 @@ class LogMonDaemon:
|
||||
ip: Adres IP atakującego
|
||||
score: Punkty za dane niepowodzenie (domyślnie 1)
|
||||
"""
|
||||
if ip in self.banned_ips:
|
||||
self.logger.debug(f"IP {ip} already banned, ignoring")
|
||||
return
|
||||
|
||||
now = datetime.now()
|
||||
|
||||
# Dodaj wpis do trackera
|
||||
@@ -175,10 +179,9 @@ class LogMonDaemon:
|
||||
)
|
||||
|
||||
# Sprawdź czy przekroczono limit
|
||||
if total_score >= max_failures and ip not in self.banned_ips:
|
||||
if total_score >= max_failures:
|
||||
self.ban_ip(ip)
|
||||
elif total_score >= max_failures and ip in self.banned_ips:
|
||||
self.logger.debug(f"IP {ip} already banned, ignoring")
|
||||
|
||||
|
||||
def ban_ip(self, ip):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user