Hi,
The vault is supposed to be a secure, offline qube for sensitive data, and by default, it has no netvm. But if I accidentally or intentionally assign a netvm to it, it can connect to the internet. That doesn’t feel secure enough for a “vault”, it’s just a VM that’s offline until you give it a network.
Shouldn’t it refuse internet access even if a netvm is added? Maybe the system could at least warn you when assigning a netvm to vault, like it does for templates.
That’s my feature request! Meanwhile, I’ve been trying to lock it down myself.
First, in vault’s VM settings under “Firewall rules,” I set “Limit outgoing connections to …” to 127.0.0.1, then assigned a netvm to test. The browser couldn’t access the internet. But then I ran ping 8.8.8.8, and the pings went through. That’s unexpected, limiting outgoing connections to 127.0.0.1 should block external addresses like 8.8.8.8.
Is this a bug in Qubes’ firewall, or intended behavior? I’d love to understand why it didn’t fully work.
Next, I set rules inside vault. I created /rw/config/nftables.conf
with this to drop all traffic:
flush ruleset
table inet filter {
chain input {
type filter hook input priority 0; policy drop;
}
chain output {
type filter hook output priority 0; policy drop;
}
chain forward {
type filter hook forward priority 0; policy drop;
}
}
I made it persistent by adding this to /rw/config/rc.local
:
nft -f /rw/config/nftables.conf
I also made rc.local
executable since it was empty before. Was that needed, or is it executable by default?
After restarting vault, I tested ping 8.8.8.8 again. Packets dropped and ping failed. It seems to work, but is this enough? Are there side effects to dropping all traffic?
I’m still curious why the 127.0.0.1 rule in VM settings didn’t fully block pings.
Also, if I set the same “drop all” rules via qvm-firewall instead of inside vault, would it work the same? Which is better, qvm-firewall or local nftables?
Then I wondered: What if I remove network capabilities entirely with:
sudo modprobe -r xen_netfront
And persist it in /rw/config/rc.local? Simpler way to kill the network, right? But what’s the downside?
Well, that’s a bunch of questions in one post, but I’m really looking forward to your answers!
Thanks a lot in advance!