From 96c5ccc7c2fdad289ee3de6c44e2ba49ca9568c2 Mon Sep 17 00:00:00 2001 From: clover caruso Date: Sat, 17 Oct 2026 00:18:50 -0700 Subject: [PATCH] Limit SMB access to local networks and Tailscale Replace the physical interface port exception with source-scoped IPv4 LAN, IPv6 link-local, and ULA permits. Preserve Tailscale access and public service ports. Validated the evaluated NixOS start/reload/stop scripts and 13 TCP paths in isolated network namespaces. Assisted-by: gpt-6.1-sol --- nixos/snowglobe.nix | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/nixos/snowglobe.nix b/nixos/snowglobe.nix index 679d6671b16000ed64f9ba8306ee7bec0768622c..840364077639983737ca16e47df9492fa8a97945 100644 --- a/nixos/snowglobe.nix +++ b/nixos/snowglobe.nix @@ -26,7 +26,12 @@ in networking.firewall.allowedTCPPorts = [ 80 443 ] ++ xmppTCPPorts; networking.firewall.allowedUDPPorts = xmppUDPPorts; networking.firewall.allowedUDPPortRanges = [{ from = xmppNetwork.relay_first; to = xmppNetwork.relay_last; }]; - networking.firewall.interfaces.enp4s0.allowedTCPPorts = [ 445 ]; + networking.firewall.extraCommands = lib.concatMapStrings ({ address, prefixLength, ... }: '' + iptables -A nixos-fw -i enp4s0 -s ${address}/${toString prefixLength} -p tcp --dport 445 -j nixos-fw-accept + '') config.networking.interfaces.enp4s0.ipv4.addresses + '' + ip6tables -A nixos-fw -i enp4s0 -s fe80::/10 -p tcp --dport 445 -j nixos-fw-accept + ip6tables -A nixos-fw -i enp4s0 -s fc00::/7 -p tcp --dport 445 -j nixos-fw-accept + ''; systemd.services.xmpp-nat = { wantedBy = [ "multi-user.target" ]; -- 2.54.1