Yes, this is true. Sorry, I should have been more clear. I am asking more specifically about advice to change the firewall. It is possible to limit the outgoing IP addresses to 0.0.0.0 using documented methods in the wiki. Would you recommend that? Or perhaps a different place to put my firewall rules?
Furthermore, here is a great link to include in that page for data recovery from a bricked app qube.
I understand, I changed it to a user level systemd unit that runs after Whonix firewall. My rules are applied now without bricking the app qube.
If I were to phrase this as a feature request it would be “offline mode for Whonix firewall”.
Of course, the best option is to not install qubes-core-agent-networking and to not assign a NetVM. But in this case I’m not modifying a template and only want to prevent accidents if a NetVM were to be assigned.
Many options to accomplish that come to mind. All untested.
A)
You could disable the whonix-firewall using systemd.
And then implement your own firewall.
B)
A systemd drop-in config snippet for whonix-firewall.service which disables it.
ExecStart=
ExecStart=/path/to/custom/script
C)
An /etc/whonix_firewall.d configuration snippet perhaps. These are just parsed as bash scripts. Run your script from it. Then exit 0 to stop further execution of whonix-firewall. Not the cleanest solution but seems easy.
Sounds like a good solution to me. It doesn’t clear the qubes table, but I suppose that doesn’t matter.
#!/bin/sh
# run as root, reboot after first run then run again for settings to apply
# make /etc/whonix_firewall.d/ persistent
mkdir -p /rw/config/qubes-bind-dirs.d
touch /rw/config/qubes-bind-dirs.d/50_user.conf
echo "binds+=( '/etc/whonix_firewall.d/' )" > /rw/config/qubes-bind-dirs.d/50_user.conf
# write rules to user firewall conf
cat > '/etc/whonix_firewall.d/50_user.conf' << EOF
/usr/sbin/nft flush ruleset
/usr/sbin/nft add table inet reject-all
# uncomment line below to brick app qube
#/usr/sbin/nft add chain inet reject-all output '{ type filter hook output priority 0; policy drop; }'
exit 0
EOF
Unless you feel it’s important, you don’t need to waste your time debugging this. But I am a bit perplexed.
This script makes /etc/whonix_firewall.d/ persistent, then writes firewall rules to 50_user.conf. It requires a reboot to make the settings persist, on the second reboot after running it again the custom rules will load.
Adding my chain bricks the app qube however. Is there anything that sticks out to you as wrong?