-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
implement qrexec based updates proxy #1854
Comments
Could this be implemented similar to qubes-download-dom0-updates / qubes-download-dom0-updates.sh? |
In theory yes, but in practice it's a lot more work to do. Because you have various distributions in Template VMs and each of them have different repository format, different signing scheme etc. This mechanism should support all of them... |
It would be awesome if the qrexec based updates proxy could be implemented with Whonix stream isolation in mind. https://forums.whonix.org/t/improve-apt-get-stream-isolation |
Do you know an application that accept HTTP PROXY stream on stdin and relay it through SOCKS? For HTTP CONNECT requests it should be trivial (just replace one header with another), but that's not all unfortunately. |
Just throwing some thoughts in... There are polipo and privoxy that can listen for http and forward it to socks. However, these are probably better avoided for security since these are not applications specialized for this simple use case? https://github.com/mischief/http2socks looks great with under 50 lines of code. (untested by me) Quote https://www.whonix.org/wiki/Tunnels/Connecting_to_Tor_before_a_proxy#Tools
Search terms are "http2socks" and "http 2 socks". Should I look if there are better choices nowadays? Maybe we could throw socat into the mix to listen on STDIN and forward it to a http2socks shim? |
I'm talking about forwarding stdin to socks directly from qrexec service (with the translation described above), instead of some single service, because in qrexec service we have access to |
Will this work for Whonix TemplateVMs / sys-whonix? With stream isolation? Any changes in Whonix required? |
Policy needs to be adjusted to direct Whonix templates to sys-whonix (instead of sys-net). Task for salt formulas used to install Whonix. As for stream isolation - by default no - it is still going through the same tinyproxy instance regardless of source VM and tinyproxy don't support stream isolation itself. See above discussion - one possibility is to modify http2socks to support this, but unfortunately I don't know Go... |
As for changes in Whonix - I think not strictly required. Another thing is updates proxy is now configured to 127.0.0.1:8082. Probably no change in Whonix required here. |
Since we have qrexec-based updates proxy, we can even stronger isolate templates from outside threats. QubesOS/qubes-issues#1854
Since we have qrexec-based updates proxy, we can even stronger isolate templates from outside threats. QubesOS/qubes-issues#1854
Since we have qrexec-based updates proxy, we can even stronger isolate templates from outside threats. QubesOS/qubes-issues#1854
Since we have qrexec-based updates proxy, we can even stronger isolate templates from outside threats. QubesOS/qubes-issues#1854
Since we have qrexec-based updates proxy, we can even stronger isolate templates from outside threats. QubesOS/qubes-issues#1854
Since we have qrexec-based updates proxy, we can even stronger isolate templates from outside threats. QubesOS/qubes-issues#1854
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
Automated announcement from builder-github The package
|
- there are many netcat versions (openbsd, nmap, ...), which behave differently - especially while handling EOF - Debian jessie doesn't have nmap-ncat (which handle EOFs sufficiently good) QubesOS/qubes-issues#1854
When I do a sudo dnf update --verbose in a template I upgraded from 3.2, I see this: "Cannot download 'https://mirrors.fedoraproject.org/metalink?repo=updates-released-f26&arch=x86_64': Cannot prepare internal mirrorlist: Curl error (7): Couldn't connect to server for https://mirrors.fedoraproject.org/metalink?repo=updates-released-f26&arch=x86_64 [Failed to connect to 127.0.0.1 port 8082: Connection refused]." I've modified http to be https in the .repo files. In a 4.0 fedora template (didn't upgrade it from old qubes), sudo dnf update seems to work fine. Both have "proxy=http://127.0.0.1:8082/" in /etc/dnf/dnf.conf, and .repo files look the same to me. Where should I look next? |
Do you have qubes-agent-* packages updated to 4.0.* version, or still at 3.2 there? |
I think 3.2? Not sure how to tell, or how to upgrade them. |
rpm -q qubes-core-agent qubes-core-vm If that's 3.2.x, you don't have qrexec based proxy there, so you need to enable network for this template (set netvm to sys-firewall in template settings).
After that, shutdown the template and set netvm back to none. Short version:
You might hit a problem with |
Ok. I did have to run the update for qubes-core-agent twice as you said, but it appeared to install correctly. After I finished that install, the template vm started behaving like sudo was disabled (great power great responsibility blah blah prompt). I stupidly restarted the template vm at that point, and now when I start it I am unable to run anything (e.g. from a launcher, or from a dom0 terminal using "qvm-run fedora-26-mytemplate gnome-terminal"). So for now I seem to be locked out of that VM. The guest-fedora-26-mytemplate.log file from /var/log/xen mentions starting the Qubes remote exec agent. Not sure what else to look for in there, or if there are other logs to look at. |
Have you installed |
I believe I did, had to do a couple other things (e.g. comment out the /etc/dnf/dnf.conf proxy), so I did not copy/paste your short version commands verbatim. But not totally sure and can't get back in to check it. |
It looks like I might not have done the qubes-vm-recommended install. I had another similar template VM that I just upgraded per your instructions, and it seems to be working ok now. I may have to just delete that other template I tried to upgrade, unless I can find some way to access a terminal on it. |
Try |
"sudo xl console" is what I was trying to do. Thank you, seems all is good now. |
Seems like I spoke too soon. I did install the qubes-vm-recommended on the upgraded VM, but when I run qvm-run TEMPLATE_NAME xterm, the command still hangs and nothing else happens. Currently the only way I can access that VM is via xl console. |
Check status of qubes-gui-agent and qubes-qrexec-agent services there. |
Qubes-gui-agent was not enabled or running. Now I can launch stuff from dom0. |
Seems there are still problems with updating this template. This one was still on fedora 25, when I tried to do an upgrade to fedora 26 like this:
I get this message:
|
I tried turning off the localhost proxy in dnf.conf, and using sys-net for NetVM and same thing. Strange thing is that I set a VM to use this template, and ran the same dnf command as above, and it seemed to have no troubles with dependency resolution and upgrade. But obviously I want to upgrade the actual template. |
Check firewall settings of the template (vm settings -> firewall tab). |
Firewall looks OK. When I switch the upgraded template's NetVM from (none) to sys-net, an IP address is shown for that template in the Qubes Manager, but if I type ip route in a terminal, nothing is shown and I can't ping anything. On the non-upgraded 4.0 template VM, ip route shows what I'd expect ("default via ", etc). So it seems like some network service might not be running in my upgraded template. After some time a route did get assigned (not sure how), but when I noticed that I tried switching back to (none) and then sys-net, and no route again. The other problem I ran into was that the upgraded qubes-r4.repo file had http instead of https in it. Your documentation for upgrading from 3.2 to 4.0 should include a sed for that in the steps. |
Quote @marmarek:
The text was updated successfully, but these errors were encountered: