Compare commits
3 commits
129d4b3a5a
...
7922fc0196
Author | SHA1 | Date | |
---|---|---|---|
Bruno BELANYI | 7922fc0196 | ||
Bruno BELANYI | 22f0c2bfb4 | ||
Bruno BELANYI | c218a9f2cf |
|
@ -35,5 +35,21 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.fail2ban.jails = {
|
||||
audiobookshelf = ''
|
||||
enabled = true
|
||||
filter = audiobookshelf
|
||||
port = http,https
|
||||
'';
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
"fail2ban/filter.d/audiobookshelf.conf".text = ''
|
||||
[Definition]
|
||||
failregex = ERROR: \[Auth\] Failed login attempt for username ".*" from ip <ADDR>
|
||||
journalmatch = _SYSTEMD_UNIT=audiobookshelf.service
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -71,5 +71,21 @@ in
|
|||
};
|
||||
};
|
||||
};
|
||||
|
||||
services.fail2ban.jails = {
|
||||
mealie = ''
|
||||
enabled = true
|
||||
filter = mealie
|
||||
port = http,https
|
||||
'';
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
"fail2ban/filter.d/mealie.conf".text = ''
|
||||
[Definition]
|
||||
failregex = ^ERROR.*Incorrect username or password from <HOST>
|
||||
journalmatch = _SYSTEMD_UNIT=mealie.service
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
|
@ -87,5 +87,26 @@ in
|
|||
"${config.services.nextcloud.home}/data/appdata_*/preview"
|
||||
];
|
||||
};
|
||||
|
||||
services.fail2ban.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…
Reference in a new issue