container-test-run-user-firewall-nftables
default.checks.aarch64-linux.nixos-test-user-firewall-nftables
· build #267
· raw
1additionally exposed symbols:2 machine, router,3 start_all, machines, driver, Machine, wait_for_signal4Starting machine5Starting router6789<<< NixOS Stage 2 >>>1011booting system configuration /nix/store/c9jf2bjmp7ck69jf8m0rlj2a3chrcbi1-nixos-system-machine-test12running activation script...13setting up /etc...142: host0@if3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100015 link/ether 0e:74:26:22:81:c2 brd ff:ff:ff:ff:ff:ff link-netnsid 016starting systemd...17systemd 260.1 running in system mode (+PAM +AUDIT -SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK -BTF -XKBCOMMON +UTMP +LIBARCHIVE)18Detected virtualization systemd-nspawn.19Detected architecture arm64.20Detected first boot.21Initializing machine ID from container UUID.22Applying preset policy.23Populated /etc with preset unit settings.24Queued start job for default target Multi-User System.25262728<<< Welcome to NixOS test (aarch64) - console >>>29+ systemd-run /bin/sh -c '/nix/store/9bhf1ff1kwhmyynws5jkjp8k7pkh6kix-coreutils-9.11/bin/sleep 999999999 && echo 865952f7-1eb4-41f9-aeab-0292e5c12d99'30Running as unit: run-p219-i79008130.service; invocation ID: 10ca900adceb4294bbba0f991950e0ff31To attach to container machine run on the same machine that runs the test:32 sudo nsenter --user --target $(\pgrep -f '^/bin/sh.*865952f7-1eb4-41f9-aeab-0292e5c12d99') --mount --uts --ipc --net --pid --cgroup /bin/sh -c bash 3334To inject external network and continue test, run:35sudo /nix/store/lqn6mbgzzdrqq2qkwddcmxj9z6amdd86-python3-3.13.13/bin/python3.13 /nix/store/k80c70ilhg1wazhgfy5gy7hmlcjrjal1-test-driver-0.0.1/lib/python3.13/site-packages/test_driver/inject_network.py 865952f7-1eb4-41f9-aeab-0292e5c12d993637<<< NixOS Stage 2 >>>3839booting system configuration /nix/store/r1bb5d4zqrvgrikcqb2mwpq39ddijxnv-nixos-system-router-test40running activation script...41setting up /etc...422: host0@if4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 100043 link/ether a6:24:31:fe:b9:6d brd ff:ff:ff:ff:ff:ff link-netnsid 044starting systemd...45systemd 260.1 running in system mode (+PAM +AUDIT -SELINUX +APPARMOR +IMA +IPE +SMACK +SECCOMP +GCRYPT -GNUTLS +OPENSSL +ACL +BLKID +CURL +ELFUTILS +FIDO2 +IDN2 +KMOD +LIBCRYPTSETUP +LIBCRYPTSETUP_PLUGINS +LIBFDISK +PCRE2 +PWQUALITY +P11KIT +QRENCODE +TPM2 +BZIP2 +LZ4 +XZ +ZLIB +ZSTD +BPF_FRAMEWORK -BTF -XKBCOMMON +UTMP +LIBARCHIVE)46Detected virtualization systemd-nspawn.47Detected architecture arm64.48Detected first boot.49Initializing machine ID from container UUID.50Applying preset policy.51Populated /etc with preset unit settings.52Queued start job for default target Multi-User System.53545556<<< Welcome to NixOS test (aarch64) - console >>>57+ systemd-run /bin/sh -c '/nix/store/9bhf1ff1kwhmyynws5jkjp8k7pkh6kix-coreutils-9.11/bin/sleep 999999999 && echo a712f4bf-ddd6-4575-aae5-318e4d152ff1'58Running as unit: run-p202-i79008140.service; invocation ID: c9947115dc1849d0832d8687f64a15fd59To attach to container router run on the same machine that runs the test:60 sudo nsenter --user --target $(\pgrep -f '^/bin/sh.*a712f4bf-ddd6-4575-aae5-318e4d152ff1') --mount --uts --ipc --net --pid --cgroup /bin/sh -c bash 6162To inject external network and continue test, run:63sudo /nix/store/lqn6mbgzzdrqq2qkwddcmxj9z6amdd86-python3-3.13.13/bin/python3.13 /nix/store/k80c70ilhg1wazhgfy5gy7hmlcjrjal1-test-driver-0.0.1/lib/python3.13/site-packages/test_driver/inject_network.py a712f4bf-ddd6-4575-aae5-318e4d152ff164+ systemctl --no-pager show multi-user.target65+ systemctl --no-pager show nginx.service66+ systemctl --no-pager show multi-user.target67+ systemctl --no-pager show nginx.service68+ ip -4 addr show eth169+ grep -oP '(?<=inet\s)\d+(\.\d+){3}'70+ ip -6 addr show eth171+ grep -oP '(?<=inet6\s)[0-9a-f:]+'72+ grep -v '^fe80'73+ head -174Router IPv4: 192.168.1.275Router IPv6: 2001:db8:1::276+ systemctl restart nftables77+ systemctl --no-pager show nftables.service78+ nft list table inet user-firewall79table inet user-firewall {80 chain output {81 type filter hook output priority filter; policy accept;82 oifname "lo" counter packets 0 bytes 0 accept comment "allow lo"83 oifname "tun*" counter packets 0 bytes 0 accept comment "allow tun*"84 oifname "tap*" counter packets 0 bytes 0 accept comment "allow tap*"85 oifname "wg*" counter packets 0 bytes 0 accept comment "allow wg*"86 oifname "tailscale*" counter packets 0 bytes 0 accept comment "allow tailscale*"87 oifname "zt*" counter packets 0 bytes 0 accept comment "allow zt*"88 oifname "vpn*" counter packets 0 bytes 0 accept comment "allow vpn*"89 oifname "ipsec*" counter packets 0 bytes 0 accept comment "allow ipsec*"90 oifname "nebula*" counter packets 0 bytes 0 accept comment "allow nebula*"91 oifname "tinc*" counter packets 0 bytes 0 accept comment "allow tinc*"92 oifname "edge*" counter packets 0 bytes 0 accept comment "allow edge*"93 oifname "hyprspace" counter packets 0 bytes 0 accept comment "allow hyprspace"94 oifname "ham0" counter packets 0 bytes 0 accept comment "allow ham0"95 oifname "easytier" counter packets 0 bytes 0 accept comment "allow easytier"96 oifname "mycelium" counter packets 0 bytes 0 accept comment "allow mycelium"97 meta skuid 1002 counter packets 0 bytes 0 reject comment "blocked user bob"98 }99}100machine: waiting for success: runuser -u alice -- curl -s http://127.0.0.1:8080101+ runuser -u alice -- curl -s http://127.0.0.1:8080102(finished: waiting for success: runuser -u alice -- curl -s http://127.0.0.1:8080, in 0.02 seconds)103+ runuser -u alice -- curl -s http://192.168.1.2104+ runuser -u alice -- curl -s 'http://[2001:db8:1::2]'105+ runuser -u bob -- curl -s http://127.0.0.1:8080106+ runuser -u bob -- curl -s --connect-timeout 2 http://192.168.1.2107+ echo EXIT_CODE=7108+ runuser -u bob -- curl -s --connect-timeout 2 'http://[2001:db8:1::2]'109+ echo EXIT_CODE=7110+ nft list table inet user-firewall111+ systemctl --no-pager show setup-wg0-interface.service112+ systemctl --no-pager show nginx.service113machine: waiting for success: nc -z 10.100.0.2 8081114+ nc -z 10.100.0.2 8081115Connection to 10.100.0.2 8081 port [tcp/sunproxyadmin] succeeded!116(finished: waiting for success: nc -z 10.100.0.2 8081, in 0.01 seconds)117+ ip link show wg0118+ ip addr show wg0119+ runuser -u alice -- curl -s --interface wg0 http://10.100.0.2:8081/120+ runuser -u alice -- curl -s --interface wg0 'http://[fd00::2]:8081/'121+ runuser -u bob -- curl -s --interface wg0 http://10.100.0.2:8081/122+ runuser -u bob -- curl -s --interface wg0 'http://[fd00::2]:8081/'123+ nft list table inet user-firewall124+ grep -E 'oifname.*wg'125 oifname "wg*" counter packets 0 bytes 0 accept comment "allow wg*"126127