From b6956dd32fbe4bd6a83336a66c3ff73ec47c7b9c Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 11 Sep 2024 00:52:32 -0700 Subject: Bump: i2p --- modules/software/networking/firewall/default.nix | 11 +++++++++++ modules/software/networking/firewall/fail2ban.nix | 20 ++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 modules/software/networking/firewall/default.nix create mode 100644 modules/software/networking/firewall/fail2ban.nix (limited to 'modules/software/networking/firewall') diff --git a/modules/software/networking/firewall/default.nix b/modules/software/networking/firewall/default.nix new file mode 100644 index 0000000..074f398 --- /dev/null +++ b/modules/software/networking/firewall/default.nix @@ -0,0 +1,11 @@ +{ + imports = [ ./fail2ban.nix ]; + + networking.firewall = { + enable = true; + allowPing = false; + logReversePathDrops = true; + logRefusedConnections = false; + checkReversePath = "loose"; + }; +} diff --git a/modules/software/networking/firewall/fail2ban.nix b/modules/software/networking/firewall/fail2ban.nix new file mode 100644 index 0000000..6311b14 --- /dev/null +++ b/modules/software/networking/firewall/fail2ban.nix @@ -0,0 +1,20 @@ +{ pkgs, lib, ... }: +{ + services.fail2ban = { + enable = false; + banaction = "nftables-multiport"; + banaction-allports = lib.mkDefault "nftables-allport"; + + 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" + ]; + }; +} -- cgit v1.2.3