depot/modules/fail2ban/default.nix

20 lines
382 B
Nix
Raw Normal View History

{ config, hosts, ... }:
2021-10-16 15:31:10 +03:00
{
services.fail2ban = {
enable = true;
2022-05-16 20:39:04 +03:00
banaction = "iptables-multiport[blocktype=DROP]";
2021-10-16 15:31:10 +03:00
jails.sshd = ''
enabled = true
port = 22
mode = aggressive
'';
ignoreIP = [
"10.0.0.0/8"
hosts.${config.networking.hostName}.interfaces.primary.addr
];
bantime-increment = {
enable = true;
};
2021-10-16 15:31:10 +03:00
};
}