add vpn addresses to fail2ban whitelist

This commit is contained in:
Fabian Montero 2025-01-25 00:15:24 -06:00
parent 4a7bda944f
commit 7f692459a9
Signed by: fabian
GPG key ID: 1FFAC35E1798174F

View file

@ -3,7 +3,9 @@
pkgs,
...
}:
with lib; {
with lib; let
inherit (config.local.sys) nets;
in {
networking = {
nftables.enable = false; # learn how to use this later
firewall = {
@ -52,7 +54,11 @@ with lib; {
fail2ban = {
enable = true;
bantime = "10m";
ignoreIP = ["37.205.12.34"]; # Never ban the server's own IP
ignoreIP = [
nets.default.hosts.vps.v6.cidr
nets.default.hosts.vps.v4.address
nets.vpn.v6.cidr
];
bantime-increment = {
enable = true;
formula = "ban.Time * math.exp(float(ban.Count+1)*banFactor)/math.exp(1*banFactor)";