services: photoprism: add fail2ban rules

This commit is contained in:
Antoine Martin 2022-10-13 11:47:24 +02:00
parent 00df5ff49b
commit f05c2a3644

View file

@ -91,5 +91,23 @@ in {
"${cfg.home}/storage"
];
};
services.fail2ban.jails = {
photoprism = ''
enabled = true
filter = vaultwarden
port = http,https
maxretry = 3
logpath = /var/log/nginx/photoprism_access.log
'';
};
environment.etc = {
"fail2ban/filter.d/photoprism.conf".text = ''
[Definition]
failregex = ^<HOST> -.*"POST \/api\/v1\/session HTTP[^"]*" 400 .*$
ignoreregex =
'';
};
};
}