A TemplateVM without a NetVM is not completely cut off from the Internet. Qubes OS exposes 127.0.0.1:8082 through qubes.UpdatesProxy, and any proxy-aware process can use it to access the internet - this is commonly used to install flatpaks, for example. But it gives me OCD, I only want templateVMs to be able to talk to my apt proxy and thats it.
My sys-gateway runs apt-cacher-ng with ordinary HTTP blocked, CONNECT disabled, SOAP forwarding disabled, redirects disabled, and upstream TLS verification enabled.
ForceManaged: 0
ForwardBtsSoap: 0
AllowUserPorts: 443
RedirMax: 0
PassThroughPattern: ^$
CApath: /etc/ssl/certs
NoSSLChecks: 0
Even with those restrictions, ForceManaged: 0 lets a process request an arbitrary URL using http://HTTPS///host/path, or send plaintext HTTP to port 443. The update proxy therefore still provides limited GET-based egress from an otherwise offline TemplateVM.
Is there a Qubes-native or apt-cacher-ng-supported way to permit package repositories without leaving this general-purpose path open?
My dumbest idea so far would be to enable ForceManaged: 1 and write a small helper that parses apt-cacher-ng’s rejection log, and then prompt the user if he wan’ts to accept thoes, and from those decisions create config files in acng so they only have to confirm/deny once. However this would mean that every first apt action inside a template would fail, which sucks.
I understand that I could list all “known” Debian repos here, but as this is for kuhbs, this enduser config management thing I’m working on, this isn’t realistic, as I can not possibly know every small custom debian repo the enduser might want to put into his “kuhb” (a definition on how to build Qubes OS VMs).
I could chain my gateway VM with apt-cacher-ng through my new Qubes-Snitch, a firewall that asks you live as traffic appears if you want to accept or deny it, but my network chain has the firewall BEFORE the gateway, like:
kuhbs-net-nic ← kuhbs-net-gateway (which also owns VPN) ← kuhbs-firewall ← application-vms
So not sure what to do here now.
Is there a Qubes way, or has anybody found a solution other than managing a strict list of repos, that lets me do this?
I can kinda answer my own question - from what I know this isn’t possible with acng nor with the qrexec service that the apt proxy mechanism uses… But asking is free, maybe you guys have an idea.
What I’d ultimately need would be sth like “only apt repo traffic allowed” or “interactively select allowed traffic” (the latter I could code myself, but the only viable solutions I see are ugly, and I don’t really want to cause I have enough complexity in kuhbs already).
Sidenote: it kinda doesn’t matter to much, as TemplateVMs are trusted and its HIGHLY unlikely that they will be compromised during setup, but the fact that they have no netvm and can still “surf the web” so to speak still gives me OCD lol.