server: nextcloud: enable fail2ban
This commit is contained in:
parent
6059c3c0ba
commit
c17489376e
@ -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
|
||||||
@ -127,6 +131,12 @@
|
|||||||
backend = systemd
|
backend = systemd
|
||||||
action = iptables-allports
|
action = iptables-allports
|
||||||
'';
|
'';
|
||||||
|
nextcloud = ''
|
||||||
|
backend = auto
|
||||||
|
enabled = true
|
||||||
|
filter = nextcloud
|
||||||
|
logpath = /var/lib/nextcloud/data/nextcloud.log
|
||||||
|
action = iptables-allports
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
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