Skip to content

Implement UUID support in qrexec#135

Merged
marmarek merged 1 commit into
QubesOS:mainfrom
DemiMarie:uuid
Oct 9, 2024
Merged

Implement UUID support in qrexec#135
marmarek merged 1 commit into
QubesOS:mainfrom
DemiMarie:uuid

Conversation

@DemiMarie

@DemiMarie DemiMarie commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

Open questions:

  • How should dom0 be informed of the intended call target? Should it be SERVICE-NAME REMOTE-DOMAIN-NAME uuid UUID-OF-TARGET or SERVICE-NAME REMOTE-DOMAIN-NAME name @uuid:UUID-OF-TARGET?
  • Should the target be informed of the source VM’s UUID? This allows race-free “boomerang” calls, but requires an API change.
  • Probably more
    Fixes: Consider UUID syntax in qrexec policy qubes-issues#8510

@DemiMarie

Copy link
Copy Markdown
Contributor Author

PipelineRetryFailed

1 similar comment
@DemiMarie

Copy link
Copy Markdown
Contributor Author

PipelineRetryFailed

@marmarek

Copy link
Copy Markdown
Member
* [ ]  Should the target be informed of the source VM’s UUID?  This allows race-free “boomerang” calls, but requires an API change.

Definitely not instead of the name, as most(?) services needs actually the source name (things like subdir in QubesIncoming, or split-gpg prompt). As for extra data, its usefulness would also be limited (generally, the source qube is running during the connection, and the name cannot be changed while qube is running). And adding extra info to the protocol would be an API change anyway so needs to wait for R4.3.

@DemiMarie

DemiMarie commented Feb 12, 2024

Copy link
Copy Markdown
Contributor Author

This version is quite a bit simpler than I thought, but it has no fallback to the name if the UUID symlink is not present, and doesn’t set up the UUID symlink itself. Therefore, it does not work.

Would it be possible to use an environment variable @marmarek? That could help avoid circular dependencies during upgrade. Of course, an alternative is to use snapshots to make the entire upgrade atomic, which is probably a better solution as so many things can fail.

Comment thread qrexec/policy/parser.py Outdated
Comment thread qrexec/policy/parser.py Outdated
@marmarek

Copy link
Copy Markdown
Member

Forcing updating core-admin and core-qrexec at the same time via dependency is okay. There is no need to handle new qubesd starting old qrexec-daemon. Since it isn't necessary, I'd prefer to simply use a command line parameter for UUID, which is much cleaner than giving name via cmdline and UUID via environment.
And also, it's qrexec-daemon who should maintain the UUID symlink, since it maintain the other symlink already (again - consistency).
What might be useful (mostly for testing, as actual release upgrade needs reboot anyway) is to keep working with already running old qrexec-daemon - which basically means a fallback to name-based symlink.

@DemiMarie
DemiMarie force-pushed the uuid branch 2 times, most recently from d7e0f94 to 50fefe3 Compare February 16, 2024 21:37
@DemiMarie
DemiMarie requested a review from marmarek February 17, 2024 01:28
@DemiMarie
DemiMarie marked this pull request as ready for review February 17, 2024 01:28
Comment thread daemon/qrexec-daemon.c Outdated
Comment thread qrexec/policy/parser.py
Comment thread daemon/qrexec-daemon.c Outdated
Comment thread daemon/qrexec-daemon.c Outdated
@DemiMarie
DemiMarie force-pushed the uuid branch 2 times, most recently from 7036de0 to 9840d38 Compare March 15, 2024 05:53
Comment thread daemon/qrexec-daemon-common.c
Comment thread qrexec/tests/policy_parser.py
Comment thread daemon/qrexec-daemon.c Outdated
@DemiMarie
DemiMarie force-pushed the uuid branch 2 times, most recently from bb9a582 to a73a3bc Compare April 19, 2024 19:44
@DemiMarie
DemiMarie requested a review from marmarek April 19, 2024 19:49
Comment thread daemon/qrexec-daemon.c Outdated
@DemiMarie
DemiMarie force-pushed the uuid branch 2 times, most recently from 63b1172 to 1261d12 Compare July 28, 2024 02:33
Comment thread qrexec/policy/parser.py Outdated
Comment thread qrexec/policy/parser.py Outdated
Comment thread qrexec/policy/parser.py Outdated
Comment thread qrexec/policy/parser.py Outdated
Comment thread qrexec/policy/parser.py Outdated
Comment thread qrexec/policy/parser.py Outdated

@marmarek marmarek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to previous not addressed comments:

Comment thread qrexec/policy/parser.py Outdated
Comment thread qrexec/policy/parser.py
@marmarek

Copy link
Copy Markdown
Member

pylint complains (minor thing)

This allows using UUIDs in qrexec policy, using the syntax uuid:VM_UUID.
This works anywhere a VM name is expected.  Since ':' is not allowed in
VM names, there is no ambiguity.  This requires the corresponding change
to qubes-core-admin so that qubesd supports UUIDs in the admin and
internal APIs.

Fixes: QubesOS/qubes-issues#8510
@marmarek
marmarek merged commit 257c462 into QubesOS:main Oct 9, 2024
@DemiMarie
DemiMarie deleted the uuid branch October 14, 2024 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider UUID syntax in qrexec policy

4 participants