horstvogel
Goto Top

Fail2ban für apache guacmole regex für die filter.d Datei

Hallo, ich möchte gerne meinen guacmole mit fail2ban absichern.


Die Ausgabe in der Apache Logdatei sieht so aus. Ziel ist es die jeweilige IP zu sperren.

23:58:49.431 [https-openssl-nio-8443-exec-10] WARN  o.a.g.r.auth.AuthenticationService - Authentication attempt from [51.218.293.90, 192.168.103.1] for user "max" failed  
.


und die Filter.d Guacamole.conf sieht so aus, bzw. ich habe das schon etwas probiert. die 192.1168.103.1 ist mein Pfsense, die ich vor dem Apache Tomcat als Reverse Proxy mit dem HAProxy nutze.
wie müsste die Config aussehen?


# Fail2Ban configuration file for guacamole
#
# Author: Steven Hiscocks
#

[Definition]

# Option: failregex
# Notes.: regex to match the password failures messages in the logfile.
# Values: TEXT
#
#failregex = ^.*\nWARNING: Authentication attempt from <HOST> for user "[^"]*" failed\.$  
#failregex = ^.*\Authentication attempt from \[<HOST>(?:,.*)?\] for user ".*" failed\.$  
failregex = ^.*\Authentication attempt from \[<HOST>, 192.168.103.1] for user ".*" failed\.$  
# Option:  ignoreregex
# Notes.:  regex to ignore. If this regex matches, the line is ignored.
# Values:  TEXT
#
ignoreregex =

# "maxlines" is number of log lines to buffer for multi-line regex searches  
maxlines = 2

datepattern = ^%%b %%d, %%ExY %%I:%%M:%%S %%p
              ^WARNING:()**
              {^LN-BEG}

Danke! der Horst

Content-Key: 529915

Url: https://administrator.de/contentid/529915

Ausgedruckt am: 28.03.2024 um 21:03 Uhr

Mitglied: qschulz
qschulz 27.04.2020 um 10:07:53 Uhr
Goto Top
Hallo,
bei mir hat so funktioniert: failregex = Authentication attempt from \[<HOST>, 192.168.103.1] for user "[^"]*" failed\.$