Compare commits
2 Commits
1771fba57b
...
c17489376e
Author | SHA1 | Date | |
---|---|---|---|
c17489376e | |||
6059c3c0ba |
@ -80,6 +80,10 @@
|
|||||||
source = ../modules/services/server/fail2ban/filter/gitea.conf;
|
source = ../modules/services/server/fail2ban/filter/gitea.conf;
|
||||||
mode = "0444";
|
mode = "0444";
|
||||||
};
|
};
|
||||||
|
"fail2ban/filter.d/nextcloud.conf" = {
|
||||||
|
source = ../modules/services/server/fail2ban/filter/nextcloud.conf;
|
||||||
|
mode = "0444";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
systemPackages = with pkgs; [ # Default packages install system-wide
|
systemPackages = with pkgs; [ # Default packages install system-wide
|
||||||
vim
|
vim
|
||||||
@ -116,16 +120,23 @@
|
|||||||
fail2ban = {
|
fail2ban = {
|
||||||
enable = true;
|
enable = true;
|
||||||
maxretry = 5;
|
maxretry = 5;
|
||||||
|
extraSettings = {
|
||||||
|
findtime = "15m";
|
||||||
|
bantime = "1h";
|
||||||
|
};
|
||||||
jails = {
|
jails = {
|
||||||
gitea = ''
|
gitea = ''
|
||||||
enabled = true
|
enabled = true
|
||||||
filter = gitea
|
filter = gitea
|
||||||
backend = systemd
|
backend = systemd
|
||||||
maxretry = 10
|
|
||||||
findtime = 3600
|
|
||||||
bantime = 900
|
|
||||||
action = iptables-allports
|
action = iptables-allports
|
||||||
'';
|
'';
|
||||||
|
nextcloud = ''
|
||||||
|
backend = auto
|
||||||
|
enabled = true
|
||||||
|
filter = nextcloud
|
||||||
|
logpath = /var/lib/nextcloud/data/nextcloud.log
|
||||||
|
action = iptables-allports
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
[Definition]
|
[Definition]
|
||||||
failregex = .*(Failed authentication attempt|invalid credentials|Attempted access of unknown user).* from <HOST>
|
failregex = .*(Failed authentication attempt|invalid credentials|Attempted access of unknown user).* from <HOST>
|
||||||
ignoreregex =
|
ignoreregex =
|
||||||
|
#journalmatch = _SYSTEMD_UNIT=gitea.servie
|
||||||
|
journalmatch =
|
||||||
|
6
modules/services/server/fail2ban/filter/nextcloud.conf
Normal file
6
modules/services/server/fail2ban/filter/nextcloud.conf
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[Definition]
|
||||||
|
_groupsre = (?:(?:,?\s*"\w+":(?:"[^"]+"|\w+))*)
|
||||||
|
failregex = ^\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Login failed:
|
||||||
|
^\{%(_groupsre)s,?\s*"remoteAddr":"<HOST>"%(_groupsre)s,?\s*"message":"Trusted domain error.
|
||||||
|
datepattern = ,?\s*"time"\s*:\s*"%%Y-%%m-%%d[T ]%%H:%%M:%%S(%%z)?"
|
||||||
|
journalmatch =
|
@ -8,11 +8,13 @@
|
|||||||
package = pkgs.nextcloud26;
|
package = pkgs.nextcloud26;
|
||||||
enableBrokenCiphersForSSE = false;
|
enableBrokenCiphersForSSE = false;
|
||||||
database.createLocally = false;
|
database.createLocally = false;
|
||||||
|
logType = "file";
|
||||||
caching = {
|
caching = {
|
||||||
redis = true;
|
redis = true;
|
||||||
apcu = false;
|
apcu = false;
|
||||||
};
|
};
|
||||||
extraOptions = {
|
extraOptions = {
|
||||||
|
logfile = "nextcloud.log";
|
||||||
redis = {
|
redis = {
|
||||||
host = "/run/redis-nextcloud/redis.sock";
|
host = "/run/redis-nextcloud/redis.sock";
|
||||||
port = 0;
|
port = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user