-
-
Notifications
You must be signed in to change notification settings - Fork 116
Support using UUIDs instead of VM names #574
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
Conversation
29b2cfa to
21c1bf2
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #574 +/- ##
==========================================
+ Coverage 69.35% 69.36% +0.01%
==========================================
Files 58 58
Lines 11919 11949 +30
==========================================
+ Hits 8266 8289 +23
- Misses 3653 3660 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
ef50609 to
d00e1a6
Compare
| async def create_disposable(self): | ||
| async def create_disposable(self, untrusted_payload): | ||
| self.enforce(not self.arg) | ||
| if untrusted_payload not in (b"", b"uuid"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the description you said it should be given in the argument, not the payload. So, which one is it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Payload. The caller, not qrexec policy, gets to decide whether the name or UUID is returned to the caller.
0f5ef5a to
86bfa69
Compare
86bfa69 to
8e1b63a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks okay now, but I'll merge it only together with other related PRs
That turned out to be a good idea, because the API isn’t sufficient for what qrexec needs. qrexec needs not only the UUID of the created VM, but also its Xen domain ID. This is needed to connect to the VM’s qrexec daemon in a race-free way. Marked as draft. |
The domain cannot change its name while running, this is non-issue. The race you consider would require a domain to be stopped, removed, re-created and started, all between qrexec-policy-daemon getting info from qubesd and calling qrexec-client (or otherwise connecting to it) which is very much unrealistic to happen. In fact, I'd strongly prefer to not return Xen ID in the system info structure, exactly because it changes on qube restart, which will make any kind of caching (if happen at some point) less effective. What can be done at some point (not R4.2, as will likely have compatibility issues) is to create a uuid->xid symlink to qrexec socket (in addition to name->xid) and use that for connections. |
There should not be any compatibility issues. All that is needed is for qubesd to either create the symlink itself or tell |
|
Please don't. Qrexec is too critical part to risk it. |
Ack. This will still be useful for the builder, where the race window is much larger. |
Simpler solution:
|
|
I still don't like changes like this in a stable release. To be clear: backporting feature or an API change to a stable release should be considered exception not a rule. Based on risk-benefit analysis I do not grant exception for this case. |
8e1b63a to
83816eb
Compare
3dd1045 to
8315e54
Compare
|
This got some conflicts too, and is needed for QubesOS/qubes-core-qrexec#135 |
8315e54 to
88b00a7
Compare
|
Test fails. And also pylint complains about too long lines (others look as false positives) |
88b00a7 to
8181be5
Compare
This supports using UUIDs (instead of VM names) in the Admin API. It also provides the UUIDs to qrexec-policy-daemon, which will use them to support the
@uuid:keyword.All admin APIs now support UUIDs as source and destination. Specific APIs changed include:
admin.vm.CreateDisposable: if the "uuid" argument is used, the VM UUID is returned instead of the name.admin.vm.List: the UUID is included in the returned list.internal.GetSystemInfo: the UUID is returned in theuuidkey of each VM's JSON object.Fixes: QubesOS/qubes-issues#8862