nixos-config/hosts/falkenstein/modules/fail2ban/default.nix

30 lines
574 B
Nix
Raw Normal View History

2023-11-25 23:22:16 +01:00
{ lib, ... }:
2023-10-22 15:45:30 +02:00
{
services.fail2ban = {
enable = true;
bantime = "10m";
bantime-increment = {
enable = true;
};
jails = {
2023-11-25 23:22:16 +01:00
sshd = lib.mkForce ''
enabled = true
port = ssh
filter= sshd[mode=aggressive]
'';
2023-10-22 15:45:30 +02:00
dovecot = ''
enabled = true
# aggressive mode add blocking for aborted connections
filter = dovecot[mode=aggressive]
maxretry = 3
'';
postfix = ''
enabled = true
filter = postfix[mode=aggressive]
maxretry = 3
'';
};
};
}