Avenger84
Lt. Commander
- Registriert
- Feb. 2008
- Beiträge
- 1.608
Hallo, nachdem ich meinen Nginx erfolgreich in fail2ban eingerichtet habe, würde ich gern noch FlashMQ dazu nehmen.
Hier mal ein Auszug vom flashmq.log:
ich möchte gern im Beispiel 199.45.155.91 bannen, nachdem er 3x einen [ERROR] mit "Problem accepting SSL" provoziert hat.
Da ich kein Regex Experte bin, hier mein fehlerhafter Vorschlag:
Mein Regex für Nginx sieht so aus:
hab den aus einem YT Video und etwas modifiziert, funktioniert perfekt.
Hier mal ein Auszug vom flashmq.log:
Code:
[2025-01-13 08:26:36.017] [NOTICE] [main] Accepting connection from: address='199.45.155.91', transport='TCP/Websocket/SSL', fd=20
[2025-01-13 08:26:36.339] [NOTICE] [T 1] Removing client '[ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]'. Reason(s): Hang up, Connection reset by peer
[2025-01-13 08:26:36.589] [NOTICE] [main] Accepting connection from: address='199.45.155.91', transport='TCP/Websocket/SSL', fd=20
[2025-01-13 08:26:36.973] [NOTICE] [T 0] Removing client '[ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]'. Reason(s): Hang up, Connection reset by peer
[2025-01-13 08:26:37.240] [NOTICE] [main] Accepting connection from: address='199.45.155.91', transport='TCP/Websocket/SSL', fd=20
[2025-01-13 08:26:37.250] [ERROR] [T 1] Packet read/write error: Problem accepting SSL socket: error:0A0000C1:SSL routines::no shared cipher. Removing client [ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]
[2025-01-13 08:26:37.250] [NOTICE] [T 1] Removing client '[ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]'. Reason(s): Problem accepting SSL socket: error:0A0000C1:SSL routines::no shared cipher
[2025-01-13 08:26:37.758] [NOTICE] [main] Accepting connection from: address='199.45.155.91', transport='TCP/Websocket/SSL', fd=20
[2025-01-13 08:26:38.058] [NOTICE] [T 0] Removing client '[ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]'. Reason(s): Hang up, Connection reset by peer
[2025-01-13 08:26:38.314] [NOTICE] [main] Accepting connection from: address='199.45.155.91', transport='TCP/Websocket/SSL', fd=20
[2025-01-13 08:26:38.345] [ERROR] [T 1] Packet read/write error: Problem accepting SSL socket: error:0A000102:SSL routines::unsupported protocol. Removing client [ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]
[2025-01-13 08:26:38.345] [NOTICE] [T 1] Removing client '[ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]'. Reason(s): Problem accepting SSL socket: error:0A000102:SSL routines::unsupported protocol
[2025-01-13 08:26:38.938] [NOTICE] [main] Accepting connection from: address='199.45.155.91', transport='TCP/Websocket/SSL', fd=20
[2025-01-13 08:26:39.217] [NOTICE] [T 0] Removing client '[ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]'. Reason(s): Hang up, Connection reset by peer
[2025-01-13 08:26:39.480] [NOTICE] [main] Accepting connection from: address='199.45.155.91', transport='TCP/Websocket/SSL', fd=20
[2025-01-13 08:26:39.802] [NOTICE] [T 1] Removing client '[ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]'. Reason(s): Hang up, Connection reset by peer
[2025-01-13 08:26:40.077] [NOTICE] [main] Accepting connection from: address='199.45.155.91', transport='TCP/Websocket/SSL', fd=20
[2025-01-13 08:26:40.078] [ERROR] [T 0] Packet read/write error: Problem accepting SSL socket: error:0A0000C1:SSL routines::no shared cipher. Removing client [ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]
[2025-01-13 08:26:40.078] [NOTICE] [T 0] Removing client '[ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]'. Reason(s): Problem accepting SSL socket: error:0A0000C1:SSL routines::no shared cipher
[2025-01-13 08:26:40.639] [NOTICE] [main] Accepting connection from: address='199.45.155.91', transport='TCP/Websocket/SSL', fd=20
[2025-01-13 08:26:40.640] [ERROR] [T 1] Packet read/write error: Problem accepting SSL socket: error:0A00006C:SSL routines::bad key share. Removing client [ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]
[2025-01-13 08:26:40.640] [NOTICE] [T 1] Removing client '[ClientID='', username='', fd=20, keepalive=10s, transport='TCP/Websocket/SSL', address='199.45.155.91', prot=none, clean=0]'. Reason(s): Problem accepting SSL socket: error:0A00006C:SSL routines::bad key share
Da ich kein Regex Experte bin, hier mein fehlerhafter Vorschlag:
Code:
failregex = ^<[ERROR]>.*"Problem accepting SSL".*<HOST>.*$
Mein Regex für Nginx sieht so aus:
Code:
failregex = ^<HOST>.*"(GET|POST|PUT).*" (400|403|404).*$