treewide: Add fail2ban

This commit is contained in:
Tristan Daniël Maat 2022-10-14 01:11:15 +01:00
parent 325e8a0ea1
commit c4fa991b62
Signed by: tlater
GPG key ID: 49670FD774E43268
3 changed files with 63 additions and 0 deletions
configuration

View file

@ -84,5 +84,26 @@
acceptTerms = true;
};
services.fail2ban = {
enable = true;
extraPackages = [pkgs.ipset];
banaction = "iptables-ipset-proto6-allports";
bantime-increment.enable = true;
jails = {
nginx-botsearch = ''
enabled = true
logpath = /var/log/nginx/access.log
'';
};
ignoreIP = [
"127.0.0.0/8"
"10.0.0.0/8"
"172.16.0.0/12"
"192.168.0.0/16"
];
};
system.stateVersion = "20.09";
}