2022-05-16 19:21:31 +02:00
|
|
|
{ config, hosts, ... }:
|
2021-10-16 14:31:10 +02:00
|
|
|
{
|
|
|
|
services.fail2ban = {
|
|
|
|
enable = true;
|
2022-05-16 19:39:04 +02:00
|
|
|
banaction = "iptables-multiport[blocktype=DROP]";
|
2021-10-16 14:31:10 +02:00
|
|
|
jails.sshd = ''
|
|
|
|
enabled = true
|
|
|
|
port = 22
|
|
|
|
mode = aggressive
|
|
|
|
'';
|
2022-05-16 19:21:31 +02:00
|
|
|
ignoreIP = [
|
|
|
|
"10.0.0.0/8"
|
|
|
|
hosts.${config.networking.hostName}.interfaces.primary.addr
|
|
|
|
];
|
2022-05-17 10:40:35 +02:00
|
|
|
bantime-increment = {
|
|
|
|
enable = true;
|
2022-05-18 01:22:35 +02:00
|
|
|
maxtime = "48h";
|
2022-05-17 10:40:35 +02:00
|
|
|
};
|
2021-10-16 14:31:10 +02:00
|
|
|
};
|
|
|
|
}
|