Compare commits

..

3 commits

Author SHA1 Message Date
Bruno BELANYI 4e093fbff3 nixos: services: nextcloud: add fail2ban jail
All checks were successful
ci/woodpecker/push/check Pipeline was successful
2024-09-22 01:37:34 +02:00
Bruno BELANYI f24cf2e16d nixos: services: audiobookshelf: add fail2ban jail 2024-09-22 01:37:34 +02:00
Bruno BELANYI cedac6bbf4 nixos: services: mealie: add fail2ban jail 2024-09-22 01:37:34 +02:00
3 changed files with 5 additions and 5 deletions

View file

@ -47,7 +47,7 @@ in
environment.etc = { environment.etc = {
"fail2ban/filter.d/audiobookshelf.conf".text = '' "fail2ban/filter.d/audiobookshelf.conf".text = ''
[Definition] [Definition]
failregex = ERROR: \[Auth\] Failed login attempt for username ".*" from ip <ADDR> failregex = ^.*ERROR: \[Auth\] Failed login attempt for username ".*" from ip <ADDR>
journalmatch = _SYSTEMD_UNIT=audiobookshelf.service journalmatch = _SYSTEMD_UNIT=audiobookshelf.service
''; '';
}; };

View file

@ -83,7 +83,7 @@ in
environment.etc = { environment.etc = {
"fail2ban/filter.d/mealie.conf".text = '' "fail2ban/filter.d/mealie.conf".text = ''
[Definition] [Definition]
failregex = ^ERROR.*Incorrect username or password from <HOST> failregex = ^.*ERROR.*Incorrect username or password from <HOST>
journalmatch = _SYSTEMD_UNIT=mealie.service journalmatch = _SYSTEMD_UNIT=mealie.service
''; '';
}; };

View file

@ -101,9 +101,9 @@ in
[Definition] [Definition]
_groupsre = (?:(?:,?\s*"\w+":(?:"[^"]+"|\w+))*) _groupsre = (?:(?:,?\s*"\w+":(?:"[^"]+"|\w+))*)
datepattern = ,?\s*"time"\s*:\s*"%%Y-%%m-%%d[T ]%%H:%%M:%%S(%%z)?" datepattern = ,?\s*"time"\s*:\s*"%%Y-%%m-%%d[T ]%%H:%%M:%%S(%%z)?"
failregex = \{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Login failed: failregex = ^[^{]*\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Login failed:
\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Trusted domain error. ^[^{]*\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Trusted domain error.
\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Two-factor challenge failed: ^[^{]*\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Two-factor challenge failed:
journalmatch = _SYSTEMD_UNIT=phpfpm-nextcloud.service journalmatch = _SYSTEMD_UNIT=phpfpm-nextcloud.service
''; '';
}; };