mirror of
https://github.com/harryssecret/homelab-nix.git
synced 2025-08-09 23:20:18 +02:00
fix: fail2ban config & try to fix extraApps problem
This commit is contained in:
parent
2c17ed2d3e
commit
0b6399027c
2 changed files with 20 additions and 29 deletions
|
@ -4,6 +4,25 @@
|
|||
enable = true;
|
||||
ignoreIP = [ "192.168.1.0/24" ];
|
||||
extraPackages = [ ];
|
||||
jails = { };
|
||||
jails = {
|
||||
nextcloud = ''
|
||||
enabled = true;
|
||||
filter = nextcloud
|
||||
port = http,https
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
"fail2ban/filter.d/nextcloud.conf".text = ''
|
||||
[Definition]
|
||||
_groupsre = (?:(?:,?\s*"\w+":(?:"[^"]+"|\w+))*)
|
||||
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:
|
||||
^[^{]*\{%(_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:
|
||||
journalmatch = _SYSTEMD_UNIT=phpfpm-nextcloud.service
|
||||
'';
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue