selinux: Ship policy module for install_t domain transitions - #2366
Open
gursewak1997 wants to merge 1 commit into
Open
selinux: Ship policy module for install_t domain transitions#2366gursewak1997 wants to merge 1 commit into
gursewak1997 wants to merge 1 commit into
Conversation
Add transition rules from initrc_t and unconfined_service_t to install_t via install_exec_t, so wrapper systemd services can gain mac_admin capability. Assisted-by: AI Signed-off-by: gursewak1997 <gursmangat@gmail.com>
gursewak1997
force-pushed
the
selinux-install-t-transition
branch
from
August 4, 2026 23:43
159537d to
a87253a
Compare
Collaborator
|
Thanks for working on this! I think we need an integration test for this. Also it'd be good to "crosscheck" that the test fails without this patch. I'm OK shipping this here but IMO it actually has nothing to do with bootc at all - this is purely a (Fedora?) SELinux policy issue and as I said in the Jira I think it could affect e.g. dnf too. I'd like to at least spend some time/tokens on what a patch for the base selinux-policy would look like. |
Contributor
Author
I opened fedora-selinux/selinux-policy#3327 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When systemd directly runs a binary labeled
install_exec_t, the SELinux policy transitions the process toinstall_t(which grantsmac_admin). But when users wrap bootc in their own systemd services, the wrapper runs asinitrc_torunconfined_service_t, and there are no transition rules from those domains — so bootc never getsinstall_t. This silently breaks cross-major-version updates that need to write arbitrary SELinux labels.This has been a pain point since the ostree days. Unlike rpm-ostree (a daemon where systemd handled the transition), bootc encourages users to wrap it in custom services where the entrypoint binary won't be
install_exec_t.Repro (from the issue):
Solution
Ship a small SELinux policy module that adds the missing
type_transitionrules frominitrc_tandunconfined_service_ttoinstall_tviainstall_exec_t. The module is built during the RPM build and loaded viasemodulein%post.Ref: RHEL-117256
Assisted-by: AI