global: actually set firewall configs

Changed files
+20 -4
global
+1
global/programs/security/default.nix
···
./crypto.nix
./sudo.nix
./pam.nix
+
./firewall.nix
];
}
+9 -4
global/programs/security/firewall.nix
···
{...}: {
+
imports = [
+
./ip-bans.nix
+
];
+
networking.firewall = {
enable = true;
-
trustedInterfaces = [
-
"tailscale0"
-
];
+
# this was never needed because ts has been bypassing the firewall anyways. (by being higher on the list.)
+
# trustedInterfaces = [
+
# "tailscale0"
+
# ];
};
-
services.openssh.openFirewall = false;
+
# services.openssh.openFirewall = false;
}
+10
global/programs/security/ip-bans.nix
···
+
{lib, ...}: let
+
banned = {
+
ip = [
+
"156.229.232.142" # added 2025-04-10: minecraft server scanner with 30m intervals
+
];
+
ip6 = [];
+
};
+
in {
+
networking.firewall.extraCommands = builtins.concatStringsSep "\n" (lib.flatten (lib.mapAttrsToList (family: ips: builtins.map (ip: "${family}tables -w -I INPUT -s ${ip} -j DROP") ips) banned));
+
}