diff options
Diffstat (limited to 'modules/core/networking/firewall')
| -rw-r--r-- | modules/core/networking/firewall/default.nix | 10 | ||||
| -rw-r--r-- | modules/core/networking/firewall/fail2ban.nix | 18 |
2 files changed, 28 insertions, 0 deletions
diff --git a/modules/core/networking/firewall/default.nix b/modules/core/networking/firewall/default.nix new file mode 100644 index 0000000..2da2502 --- /dev/null +++ b/modules/core/networking/firewall/default.nix @@ -0,0 +1,10 @@ +{ + imports = [ ./fail2ban.nix ]; + + networking.firewall = { + allowPing = false; + logReversePathDrops = true; + logRefusedConnections = false; + checkReversePath = "loose"; + }; +} diff --git a/modules/core/networking/firewall/fail2ban.nix b/modules/core/networking/firewall/fail2ban.nix new file mode 100644 index 0000000..606b725 --- /dev/null +++ b/modules/core/networking/firewall/fail2ban.nix @@ -0,0 +1,18 @@ +{ pkgs, ... }: +{ + services.fail2ban = { + enable = false; + + extraPackages = with pkgs; [ + nftables + ipset + ]; + + ignoreIP = [ + "10.0.0.0/8" + "172.16.0.0/12" + "100.64.0.0/16" + "192.168.0.0/16" + ]; + }; +} |