modules: services: gitea: add fail2ban jail
This commit is contained in:
parent
d647830911
commit
b9f6c5d534
|
@ -126,5 +126,21 @@ in
|
|||
config.services.gitea.repositoryRoot
|
||||
];
|
||||
};
|
||||
|
||||
services.fail2ban.jails = {
|
||||
gitea = ''
|
||||
enabled = true
|
||||
filter = gitea
|
||||
action = iptables-allports
|
||||
'';
|
||||
};
|
||||
|
||||
environment.etc = {
|
||||
"fail2ban/filter.d/gitea.conf".text = ''
|
||||
[Definition]
|
||||
failregex = ^.*(Failed authentication attempt|invalid credentials|Attempted access of unknown user).* from <HOST>$
|
||||
journalmatch = _SYSTEMD_UNIT=gitea.service
|
||||
'';
|
||||
};
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue