Will we again discover Qubes Air? ![]()
32 posts were split to a new topic: Terminology: admin qube, AdminVM,
I don’t see why not. Forward an SSH port to some-qube, install qubes-core-admin-client in it(s template), and configure dom0 policy to give some-qube the appropriate permissions. E.g. if some-qube should be able to run qvm-run other-qube echo hello world, allow it to invoke qubes.VMExec on other-qube, and maybe some other necessary services. (I’m only using qvm-run as an example because @ssh1 mentioned it in their initial post. You don’t really need the qubes-core-admin-client package for this use case: qvm-run-vm would be more appropriate, although it still calls the old qubes.VMShell service.)
I am not familiar with the intricacies of qrexec. My idea was to simply watch for “calls” generated inside the “admin qube” (a domU) and execute them (or not) in dom0 accordingly based on checks. I am not aware of a policy that allows such mechanism, as per the diagram.
That’s the admin API!
A qube can make the same admin API method calls to dom0 that dom0 makes to itself, using the same qvm-foo and qubes-bar tools installed through the same qubes-core-admin-client package (or alternatively, using raw qrexec-client-vm invocations), and dom0 policy decides if those requests from the qube are granted.
OK, so I have reinvented the wheel ![]()
Now, the question is what policy is necessary to allow e.g. “execute command X in dom0 and return to me (to ‘admin qube’) the result”.
Seems like @qubist wants arbitrary code execution in dom0 without direct ssh connection.
I wonder if it’s possible to somehow call the equivalent of qvm-run with --localcmd "bash -i" from admin client qube back to itself in order to get a reverse shell in dom0. That could be fun.
That wouldn’t work with qvm-run in an admin client qube. dom0 can’t be used as a destination (it doesn’t offer qubes.VMShell or qubes.VMExec), and --localcmd would run in the admin client qube itself.
But the admin API isn’t needed at all to set up a dom0 qrexec service for arbitrary code execution in dom0 from a specific qube running SSH (forwarded over qrexec from sys-net to that qube)… A qrexec connection (in this case, from the SSH qube to dom0) is even enough to get a passable interactive shell using the script utility, like here:
But then the “admin client qube” won’t be able to function as “dom0 managed over ssh”. AFAIK, you can’t e.g. qvm-create ... in a domU, so the “admin client qube” will simply not function as such. Or am I missing other options?
Not completely arbitrary. The service in dom0 that reads the command queue through polling the “admin qube” domU can check if particular commands are allowed and act accordingly.
I can, and it is explained already? Insisting on dom0 is the wrong premise.
So, that is what I have been missing in my earlier post and @rustybird is probably right - my idea could work with the existing tools.
It was the very first point in the topic I quoted from @fepitre around 40 messages earlier: