Skip to content

units: Use DynamicUser=yes + polkit by default - #147

Open
mvo5 wants to merge 2 commits into
systemd:mainfrom
mvo5:dynamic-user-by-default
Open

mvo5 wants to merge 2 commits into
systemd:mainfrom
mvo5:dynamic-user-by-default

Conversation

@mvo5

@mvo5 mvo5 commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Instead of running as root we should really prefer to run unprivileged. This can be done by using the DynamicUser=yes in the unit and by having a polkit rule that allows the bridge to talk to the various varlink services.

This is hardening, effectively the bridge is still root because it can start processes as root via varlink. The other nice benefit of it is that by using polkit we can potentially limit the usage more fine-grained. We also plan to add more features to polkit and systemd to carry more information from the bridge so that we can take data from the bridge authentication into account when making the authorization decisions.

mvo5 added 2 commits October 3, 2026 14:00
Instead of running as root we should really prefer to run
unprivileged. This can be done by using the DynamicUser=yes
in the unit and by having a polkit rule that allows the bridge
to talk to the various varlink services.

This is hardening, effectively the bridge is still root because
it can start processes as root via varlink. The other nice benefit
of it is that by using polkit we can potentially limit the usage
more fine-grained. We also plan to add more features to polkit
and systemd to carry more information from the bridge so that
we can take data from the bridge authentication into account when
making the authorization decisions.
The bridge now runs without root so we need to make sure the
import-ssh keys are readable by non-root. As those are pub-keys
writing with 0644 is fine.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant