container-test-run-user-firewall-nftables
aarch64-linux.nixos-test-user-firewall-nftables
· build #179
· raw
1Machine state will be reset. To keep it, pass --keep-machine-state2start all VLans3(finished: start all VLans, in 0.00 seconds)45Test will time out and terminate in 3600 seconds6run the VM test script7additionally exposed symbols:8 machine, router,9 vlan1,10 start_all, test_script, machines, machines_qemu, machines_nspawn, vlans, driver, log, os, create_machine, subtest, run_tests, join_all, retry, serial_stdout_off, serial_stdout_on, polling_condition, BaseMachine, QemuMachine, NspawnMachine, t, debug, dump_machine_ssh11start all VMs12router: systemd-nspawn running (pid 52)13machine: systemd-nspawn running (pid 53)14router: Waiting for journal at /build/vm-state-router/var/log/journal...15machine: Waiting for journal at /build/vm-state-machine/var/log/journal...16(finished: start all VMs, in 0.00 seconds)17router: waiting for unit multi-user.target18nixos-nspawn(machine): TAP vde-tap1 not found; container will be isolated from VDE19nixos-nspawn(machine): A common reason for this is that /dev/net is not available in the Nix sandbox. Try adding /dev/net to extra-sandbox-paths.20nixos-nspawn(router): TAP vde-tap1 not found; container will be isolated from VDE21nixos-nspawn(router): A common reason for this is that /dev/net is not available in the Nix sandbox. Try adding /dev/net to extra-sandbox-paths.22Note: in a future version of systemd-nspawn the default set of permitted socket address families will be restricted to AF_INET, AF_INET6 and AF_UNIX. Use --restrict-address-families= to configure the set of permitted socket address families, or set RestrictAddressFamilies= in a .nspawn file.23Note: in a future version of systemd-nspawn the default set of permitted socket address families will be restricted to AF_INET, AF_INET6 and AF_UNIX. Use --restrict-address-families= to configure the set of permitted socket address families, or set RestrictAddressFamilies= in a .nspawn file.24░ Spawning container machine on /build/vm-state-machine.25░ Spawning container router on /build/vm-state-router.26router # No journal files were found.27router # No journal boot entry found for the specified boot (+0).28machine # No journal files were found.29machine # No journal boot entry found for the specified boot (+0).30machine # [4440911.058733] machine systemd-journald[57]: Journal started31machine # [4440911.058851] machine systemd-journald[57]: Runtime Journal (/run/log/journal/6e65257a675540d1bdbc5a7a216c7961) is 8M, max 2.5G, 2.4G free.32machine # [4440911.072237] machine systemd[1]: Finished Apply Kernel Variables.33machine # [4440911.086068] machine systemd[1]: Finished Create Static Device Nodes in /dev gracefully.34machine # [4440911.103697] machine systemd[1]: Starting Flush Journal to Persistent Storage...35machine # [4440911.105184] machine systemd[1]: Starting Create Static Device Nodes in /dev...36machine # [4440911.115254] machine systemd-journald[57]: Time spent on flushing to /var/log/journal/6e65257a675540d1bdbc5a7a216c7961 is 3.728ms for 6 entries.37machine # [4440911.115254] machine systemd-journald[57]: System Journal (/var/log/journal/6e65257a675540d1bdbc5a7a216c7961) is 8M, max 4G, 3.9G free.38machine # [4440911.124761] machine systemd[1]: Finished Create Static Device Nodes in /dev.39machine # [4440911.125889] machine systemd[1]: Reached target Preparation for Local File Systems.40machine # [4440911.126040] machine systemd[1]: Reached target Local File Systems.41machine # [4440911.126952] machine systemd[1]: Listening on Boot Loader Control Service Socket.42machine # [4440911.127012] machine systemd[1]: Update Boot Loader Random Seed skipped, unmet condition check ConditionVirtualization=!container43machine # [4440911.128242] machine systemd[1]: Starting Save Transient machine-id to Disk...44machine # [4440911.128297] machine systemd[1]: Rule-based Manager for Device Events and Files skipped, unmet condition check ConditionPathIsReadWrite=/sys45machine # [4440911.190961] machine systemd[1]: Finished Flush Journal to Persistent Storage.46machine # [4440911.192246] machine systemd[1]: Starting Create System Files and Directories...47machine # [4440911.209984] machine systemd-tmpfiles[69]: Cannot set file attributes for '/var/empty', value=0x00000010, mask=0x00000010, ignoring: Operation not permitted48machine # [4440911.210204] machine systemd-tmpfiles[69]: fchmod() of /var/log/journal failed: Operation not permitted49machine # [4440911.210360] machine systemd-tmpfiles[69]: fchmod() of /var/log/journal/6e65257a675540d1bdbc5a7a216c7961 failed: Operation not permitted50machine # [4440911.210583] machine systemd-tmpfiles[69]: fchmod() of /run/log/journal failed: Operation not permitted51machine # [4440911.213256] machine systemd[1]: Finished Create System Files and Directories.52machine # [4440911.215475] machine systemd[1]: Starting Rebuild Journal Catalog...53machine # [4440911.216440] machine systemd[1]: Starting Record System Boot/Shutdown in UTMP...54machine # [4440911.229373] machine systemd[1]: Finished Record System Boot/Shutdown in UTMP.55machine # [4440911.249171] machine systemd[1]: Finished Rebuild Journal Catalog.56machine # [4440911.250633] machine systemd[1]: Starting Update is Completed...57machine # [4440911.262537] machine systemd[1]: Finished Update is Completed.58machine # [4440911.262729] machine systemd[1]: Reached target System Initialization.59machine # [4440911.262835] machine systemd[1]: Discard unused filesystem blocks once a week skipped, unmet condition check ConditionVirtualization=!container60machine # [4440911.262876] machine systemd[1]: Started Daily Cleanup of Temporary Directories.61machine # [4440911.262898] machine systemd[1]: Reached target Timer Units.62machine # [4440911.263109] machine systemd[1]: Listening on D-Bus System Message Bus Socket.63machine # [4440911.263262] machine systemd[1]: Listening on Nix Daemon Socket.64machine # [4440911.263371] machine systemd[1]: Listening on Virtual Machine and Container Registration Service Socket.65machine # [4440911.263401] machine systemd[1]: Reached target Socket Units.66machine # [4440911.263445] machine systemd[1]: Reached target Basic System.67machine # [4440911.264907] machine systemd[1]: Starting Import lastlog data into lastlog2 database...68machine # [4440911.265943] machine systemd[1]: Starting nftables firewall...69machine # [4440911.267007] machine systemd[1]: Starting Name Service Cache Daemon (nsncd)...70machine # [4440911.286165] machine systemd[1]: Finished Import lastlog data into lastlog2 database.71machine # [4440911.341686] machine systemd[1]: Finished nftables firewall.72machine # [4440911.341859] machine systemd[1]: Reached target Preparation for Network.73machine # [4440911.343016] machine systemd[1]: Starting Address configuration of eth1...74machine # [4440911.344175] machine systemd[1]: Starting Extra networking commands....75machine # [4440911.345067] machine systemd[1]: Starting Setup wg0 dummy interface...76machine # [4440911.359582] machine network-addresses-eth1-start[94]: adding address 192.168.1.1/24... done77machine # [4440911.361964] machine network-addresses-eth1-start[94]: adding address 2001:db8:1::1/64... done78machine # [4440911.364604] machine systemd[1]: Finished Setup wg0 dummy interface.79machine # [4440911.367786] machine systemd[1]: Finished Address configuration of eth1.80machine # [4440911.376887] machine systemd[1]: Finished Save Transient machine-id to Disk.81machine # [4440911.404992] machine systemd[1]: nscd.service: Deactivated successfully.82machine # [4440911.405198] machine systemd[1]: Stopped Name Service Cache Daemon (nsncd).83machine # [4440911.408652] machine systemd[1]: Starting Name Service Cache Daemon (nsncd)...84machine # [4440911.409322] machine systemd[1]: Finished Extra networking commands..85machine # [4440911.409964] machine systemd[1]: Reached target Network.86machine # [4440911.411298] machine systemd[1]: Starting Nginx Web Server...87machine # [4440911.569834] machine nsncd[165]: Jul 30 08:58:57.622 INFO started, config: Config { ignored_request_types: {}, worker_count: 8, handoff_timeout: 10s }, path: "/var/run/nscd/socket"88machine # [4440911.569952] machine systemd[1]: Started Name Service Cache Daemon (nsncd).89machine # [4440911.570006] machine systemd[1]: Reached target Host and Network Name Lookups.90machine # [4440911.570054] machine systemd[1]: Reached target User and Group Name Lookups.91machine # [4440911.571223] machine systemd[1]: Starting User Login Management...92machine # [4440911.572112] machine systemd[1]: Starting Permit User Sessions...93machine # [4440911.619921] machine systemd[1]: Finished Permit User Sessions.94machine # [4440911.621441] machine systemd[1]: Started Console Getty.95machine # [4440911.621497] machine systemd[1]: Getty on tty1 skipped, unmet condition check ConditionPathExists=/dev/tty096machine # [4440911.621522] machine systemd[1]: Reached target Login Prompts.97router # [4440911.058433] router systemd-journald[57]: Journal started98router # [4440911.058563] router systemd-journald[57]: Runtime Journal (/run/log/journal/8ba156dc3d084773994f7b4fba97597e) is 8M, max 2.5G, 2.4G free.99router # [4440911.072236] router systemd[1]: Finished Apply Kernel Variables.100router # [4440911.086070] router systemd[1]: Finished Create Static Device Nodes in /dev gracefully.101router # [4440911.103697] router systemd[1]: Starting Flush Journal to Persistent Storage...102router # [4440911.105814] router systemd[1]: Starting Network Name Resolution...103router # [4440911.108661] router systemd[1]: Starting Create Static Device Nodes in /dev...104router # [4440911.115251] router systemd-journald[57]: Time spent on flushing to /var/log/journal/8ba156dc3d084773994f7b4fba97597e is 4.022ms for 7 entries.105router # [4440911.115251] router systemd-journald[57]: System Journal (/var/log/journal/8ba156dc3d084773994f7b4fba97597e) is 8M, max 4G, 3.9G free.106router # [4440911.134412] router systemd[1]: Finished Create Static Device Nodes in /dev.107router # [4440911.135496] router systemd[1]: Reached target Preparation for Local File Systems.108router # [4440911.135650] router systemd[1]: Reached target Local File Systems.109router # [4440911.136633] router systemd[1]: Listening on Boot Loader Control Service Socket.110router # [4440911.136691] router systemd[1]: Update Boot Loader Random Seed skipped, unmet condition check ConditionVirtualization=!container111router # [4440911.137850] router systemd[1]: Starting Save Transient machine-id to Disk...112router # [4440911.137894] router systemd[1]: Rule-based Manager for Device Events and Files skipped, unmet condition check ConditionPathIsReadWrite=/sys113router # [4440911.139346] router systemd[1]: Starting Network Management...114router # [4440911.191088] router systemd[1]: Finished Flush Journal to Persistent Storage.115router # [4440911.193375] router systemd[1]: Starting Create System Files and Directories...116router # [4440911.209974] router systemd-tmpfiles[73]: Cannot set file attributes for '/var/empty', value=0x00000010, mask=0x00000010, ignoring: Operation not permitted117router # [4440911.210204] router systemd-tmpfiles[73]: fchmod() of /var/log/journal failed: Operation not permitted118router # [4440911.210360] router systemd-tmpfiles[73]: fchmod() of /var/log/journal/8ba156dc3d084773994f7b4fba97597e failed: Operation not permitted119router # [4440911.210584] router systemd-tmpfiles[73]: fchmod() of /run/log/journal failed: Operation not permitted120router # [4440911.213266] router systemd[1]: Finished Create System Files and Directories.121router # [4440911.214794] router systemd[1]: Starting Rebuild Journal Catalog...122router # [4440911.216047] router systemd[1]: Starting Record System Boot/Shutdown in UTMP...123router # [4440911.229378] router systemd[1]: Finished Record System Boot/Shutdown in UTMP.124router # [4440911.248938] router systemd[1]: Finished Rebuild Journal Catalog.125router # [4440911.250299] router systemd[1]: Starting Update is Completed...126router # [4440911.262530] router systemd[1]: Finished Update is Completed.127router # [4440911.375411] router systemd[1]: Finished Save Transient machine-id to Disk.128machine # [4440912.041819] machine systemd[1]: etc-machine\x2did.mount: Deactivated successfully.129router # [4440912.051206] router systemd[1]: etc-machine\x2did.mount: Deactivated successfully.130router # [4440912.068548] router systemd-networkd[69]: Failed to increase receive buffer size for general netlink socket, ignoring: Operation not permitted131router # [4440912.068646] router systemd-networkd[69]: Failed to increase receive buffer size for nftables netlink socket, ignoring: Operation not permitted132router # [4440912.077835] router systemd-networkd[69]: lo: Link UP133router # [4440912.077841] router systemd-networkd[69]: lo: Gained carrier134router # [4440912.078050] router systemd-networkd[69]: eth1: Configuring with /etc/systemd/network/40-eth1.network.135router # [4440912.078471] router systemd[1]: Started Network Management.136router # [4440912.078555] router systemd-networkd[69]: eth1: Link UP137router # [4440912.078785] router systemd-networkd[69]: eth1: Gained carrier138router # [4440912.080661] router systemd[1]: Starting Enable Persistent Storage in systemd-networkd...139router # [4440912.153099] router systemd[1]: Finished Enable Persistent Storage in systemd-networkd.140machine # [4440912.436876] machine nginx-pre-start[192]: nginx: the configuration file /nix/store/jw0x0fh56f0qr75i6x84skjbylckfbh4-nginx.conf syntax is ok141machine # [4440912.439257] machine nginx-pre-start[192]: nginx: configuration file /nix/store/jw0x0fh56f0qr75i6x84skjbylckfbh4-nginx.conf test is successful142machine # [4440912.444025] machine systemd[1]: Started Nginx Web Server.143machine # [4440912.484070] machine systemd-logind[182]: New seat seat0.144machine # [4440912.486378] machine systemd[1]: Starting D-Bus System Message Bus...145machine # [4440912.486504] machine systemd[1]: Started User Login Management.146machine # [4440912.487390] machine systemd[1]: Starting linger-users.service...147machine # [4440912.497785] machine systemd[1]: linger-users.service: Deactivated successfully.148machine # [4440912.498000] machine systemd[1]: Finished linger-users.service.149machine # [4440912.498205] machine systemd[1]: Reached target Multi-User System.150router # [4440912.591245] router systemd-resolved[64]: Positive Trust Anchors:151router # [4440912.591256] router systemd-resolved[64]: . IN DS 20326 8 2 e06d44b80b8f1d39a95c0b0d7c65d08458e880409bbc683457104237c7f8ec8d152router # [4440912.591259] router systemd-resolved[64]: . IN DS 38696 8 2 683d2d0acb8c9b712a1948b27f741219298d0a450d612c483af444a4c0fb2b16153router # [4440912.591294] router systemd-resolved[64]: Negative trust anchors: home.arpa 10.in-addr.arpa 16.172.in-addr.arpa 17.172.in-addr.arpa 18.172.in-addr.arpa 19.172.in-addr.arpa 20.172.in-addr.arpa 21.172.in-addr.arpa 22.172.in-addr.arpa 23.172.in-addr.arpa 24.172.in-addr.arpa 25.172.in-addr.arpa 26.172.in-addr.arpa 27.172.in-addr.arpa 28.172.in-addr.arpa 29.172.in-addr.arpa 30.172.in-addr.arpa 31.172.in-addr.arpa 170.0.0.192.in-addr.arpa 171.0.0.192.in-addr.arpa 168.192.in-addr.arpa d.f.ip6.arpa ipv4only.arpa resolver.arpa corp home internal intranet lan local private test154router # [4440912.612980] router systemd-resolved[64]: Using system hostname 'router'.155router # [4440912.614344] router systemd[1]: Started Network Name Resolution.156router # [4440912.614426] router systemd[1]: Reached target Network.157router # [4440912.614492] router systemd[1]: Reached target System Initialization.158router # [4440912.614536] router systemd[1]: Discard unused filesystem blocks once a week skipped, unmet condition check ConditionVirtualization=!container159router # [4440912.614560] router systemd[1]: Started Daily Cleanup of Temporary Directories.160router # [4440912.614577] router systemd[1]: Reached target Timer Units.161router # [4440912.614697] router systemd[1]: Listening on D-Bus System Message Bus Socket.162router # [4440912.614825] router systemd[1]: Listening on Nix Daemon Socket.163router # [4440912.614930] router systemd[1]: Listening on Virtual Machine and Container Registration Service Socket.164router # [4440912.614952] router systemd[1]: Reached target Socket Units.165router # [4440912.614987] router systemd[1]: Reached target Basic System.166router # [4440912.616070] router systemd[1]: Starting Import lastlog data into lastlog2 database...167router # [4440912.616947] router systemd[1]: Starting Nginx Web Server...168router # [4440912.617866] router systemd[1]: Starting Name Service Cache Daemon (nsncd)...169router # [4440912.619008] router systemd[1]: Starting D-Bus System Message Bus...170router # [4440912.680949] router systemd[1]: Finished Import lastlog data into lastlog2 database.171machine # [4440912.818945] machine dbus-broker-launch[198]: Looking up NSS user entry for 'systemd-timesync'...172machine # [4440912.819489] machine dbus-broker-launch[198]: NSS returned no entry for 'systemd-timesync'173machine # [4440912.819489] machine dbus-broker-launch[198]: Invalid user-name in /nix/store/5hqqmkpzi67977m9lszd3mqss5nmpffm-system-path/share/dbus-1/system.d/org.freedesktop.timesync1.conf +16: user="systemd-timesync"174machine # [4440912.819885] machine systemd[1]: Started D-Bus System Message Bus.175machine # [4440912.826761] machine dbus-broker-launch[198]: Ready176machine # [4440912.827211] machine systemd[1]: Startup finished in 2.427s.177router # [4440912.852853] router nsncd[87]: Jul 30 08:58:58.905 INFO started, config: Config { ignored_request_types: {}, worker_count: 8, handoff_timeout: 10s }, path: "/var/run/nscd/socket"178router # [4440912.853027] router systemd[1]: Started Name Service Cache Daemon (nsncd).179router # [4440912.853085] router systemd[1]: Reached target Host and Network Name Lookups.180router # [4440912.853138] router systemd[1]: Reached target User and Group Name Lookups.181router # [4440912.854280] router systemd[1]: Starting User Login Management...182router # [4440912.855121] router systemd[1]: Starting Permit User Sessions...183router # [4440912.863614] router systemd[1]: Finished Permit User Sessions.184router # [4440912.865118] router systemd[1]: Started Console Getty.185router # [4440912.865157] router systemd[1]: Getty on tty1 skipped, unmet condition check ConditionPathExists=/dev/tty0186router # [4440912.865175] router systemd[1]: Reached target Login Prompts.187router # [4440913.028200] router dbus-broker-launch[88]: Looking up NSS user entry for 'systemd-timesync'...188router # [4440913.028905] router dbus-broker-launch[88]: NSS returned no entry for 'systemd-timesync'189router # [4440913.028905] router dbus-broker-launch[88]: Invalid user-name in /nix/store/x8bxwyzx2758y1g0228zx6qpxic7nv5l-system-path/share/dbus-1/system.d/org.freedesktop.timesync1.conf +16: user="systemd-timesync"190router # [4440913.029328] router systemd[1]: Started D-Bus System Message Bus.191router # [4440913.036171] router dbus-broker-launch[88]: Ready192router # [4440913.668281] router nginx-pre-start[117]: nginx: the configuration file /nix/store/wdw2jh1hlsnq5ypgs0xsg9lpqp9c51wv-nginx.conf syntax is ok193router # [4440913.668629] router nginx-pre-start[117]: nginx: configuration file /nix/store/wdw2jh1hlsnq5ypgs0xsg9lpqp9c51wv-nginx.conf test is successful194router # [4440913.675929] router systemd[1]: Started Nginx Web Server.195router # [4440913.711256] router systemd-logind[106]: New seat seat0.196router # [4440913.711755] router systemd[1]: Started User Login Management.197router # [4440913.713287] router systemd[1]: Starting linger-users.service...198router # [4440913.723795] router systemd[1]: linger-users.service: Deactivated successfully.199router # [4440913.724060] router systemd[1]: Finished linger-users.service.200router # [4440913.724536] router systemd[1]: Reached target Multi-User System.201router # [4440913.724759] router systemd[1]: Startup finished in 3.324s.202router: (finished: waiting for unit multi-user.target, in 4.15 seconds)203router: waiting for unit nginx.service204router: (finished: waiting for unit nginx.service, in 0.02 seconds)205machine: waiting for unit multi-user.target206machine: (finished: waiting for unit multi-user.target, in 0.02 seconds)207machine: waiting for unit nginx.service208machine: (finished: waiting for unit nginx.service, in 0.01 seconds)209router: must succeed: ip -4 addr show eth1 | grep -oP '(?<=inet\s)\d+(\.\d+){3}'210router: (finished: must succeed: ip -4 addr show eth1 | grep -oP '(?<=inet\s)\d+(\.\d+){3}', in 0.01 seconds)211router: must succeed: ip -6 addr show eth1 | grep -oP '(?<=inet6\s)[0-9a-f:]+' | grep -v '^fe80' | head -1212router: (finished: must succeed: ip -6 addr show eth1 | grep -oP '(?<=inet6\s)[0-9a-f:]+' | grep -v '^fe80' | head -1, in 0.01 seconds)213Router IPv4: 192.168.1.2214Router IPv6: 2001:db8:1::2215machine: must succeed: systemctl restart nftables216router # [4440914.020163] router systemd-networkd[69]: eth1: Gained IPv6LL217machine # [4440914.131649] machine systemd[1]: Stopping nftables firewall...218machine # [4440914.266074] machine systemd[1]: nftables.service: Deactivated successfully.219machine # [4440914.266281] machine systemd[1]: Stopped nftables firewall.220machine # [4440914.267907] machine systemd[1]: Starting nftables firewall...221machine: (finished: must succeed: systemctl restart nftables, in 0.31 seconds)222machine: waiting for unit nftables.service223machine: (finished: waiting for unit nftables.service, in 0.01 seconds)224machine: must succeed: nft list table inet user-firewall >&2225table inet user-firewall {226 chain output {227 type filter hook output priority filter; policy accept;228 oifname "lo" counter packets 0 bytes 0 accept comment "allow lo"229 oifname "tun*" counter packets 0 bytes 0 accept comment "allow tun*"230 oifname "tap*" counter packets 0 bytes 0 accept comment "allow tap*"231 oifname "wg*" counter packets 0 bytes 0 accept comment "allow wg*"232 oifname "tailscale*" counter packets 0 bytes 0 accept comment "allow tailscale*"233 oifname "zt*" counter packets 0 bytes 0 accept comment "allow zt*"234 oifname "vpn*" counter packets 0 bytes 0 accept comment "allow vpn*"235 oifname "ipsec*" counter packets 0 bytes 0 accept comment "allow ipsec*"236 oifname "nebula*" counter packets 0 bytes 0 accept comment "allow nebula*"237 oifname "tinc*" counter packets 0 bytes 0 accept comment "allow tinc*"238 oifname "edge*" counter packets 0 bytes 0 accept comment "allow edge*"239 oifname "hyprspace" counter packets 0 bytes 0 accept comment "allow hyprspace"240 oifname "ham0" counter packets 0 bytes 0 accept comment "allow ham0"241 oifname "easytier" counter packets 0 bytes 0 accept comment "allow easytier"242 oifname "mycelium" counter packets 0 bytes 0 accept comment "allow mycelium"243 meta skuid 1002 counter packets 0 bytes 0 reject comment "blocked user bob"244 }245}246machine: (finished: must succeed: nft list table inet user-firewall >&2, in 0.01 seconds)247machine: waiting for success: runuser -u alice -- curl -s http://127.0.0.1:8080248machine: (finished: waiting for success: runuser -u alice -- curl -s http://127.0.0.1:8080, in 0.02 seconds)249machine: must succeed: runuser -u alice -- curl -s http://192.168.1.2250machine: output: 251!!! Traceback (most recent call last):252!!! File "<string>", line 22, in <module>253!!! machine.succeed(f"runuser -u alice -- curl -s http://{router_ip}")254!!! 255!!! RequestedAssertionFailed: command `runuser -u alice -- curl -s http://192.168.1.2` failed (exit code 7)256cleanup257kill NspawnMachine (pid 53)258kill NspawnMachine (pid 52)259Container machine terminated by signal KILL.260Container router terminated by signal KILL.261(finished: cleanup, in 0.48 seconds)