added fail2ban filter for immich

This commit is contained in:
Leyla Becker 2025-03-18 18:32:57 -05:00
parent 2a1259cbfa
commit 9bc13861b4

View file

@ -46,6 +46,16 @@ in {
datepattern = ^%%Y-%%m-%%d %%H:%%M:%%S
'')
);
"fail2ban/filter.d/immich.local".text = lib.mkIf config.services.immich.enable (
pkgs.lib.mkDefault (pkgs.lib.mkAfter ''
[INCLUDES]
before = common.conf
[Definition]
failregex = immich-server.*Failed login attempt for user.+from ip address\s?<ADDR>
journalmatch = CONTAINER_TAG=immich-server
'')
);
};
services.fail2ban = {
@ -108,6 +118,11 @@ in {
bantime = 600;
maxretry = 5;
};
immich-iptables.settings = lib.mkIf config.services.immich.enable {
enabled = true;
filter = "immich";
backend = "systemd";
};
# TODO; figure out if there is any fail2ban things we can do on searx
# searx-iptables.settings = lib.mkIf config.services.searx.enable {};
};