feat(selinux): make Trivalent policy role-agnostic#1593
Merged
RoyalOughtness merged 2 commits intosecureblue:livefrom Nov 11, 2025
Merged
feat(selinux): make Trivalent policy role-agnostic#1593RoyalOughtness merged 2 commits intosecureblue:livefrom
RoyalOughtness merged 2 commits intosecureblue:livefrom
Conversation
Currently the Trivalent SELinux policy implicitly assumes that the user is unconfined, and doesn't work for confined users. This modifies the policy to work for confined users as well. The `trivalent_t` and `trivalent_script_t` domains are replaced by `trivalent_domain` and `trivalent_script_domain` attributes, containing domains `$1_trivalent_t` and `$1_trivalent_script_t`, respectively, for each role `$1_r` permitted to run Trivalent. The use of domain prefixes allows for role-dependent domain transitions, so for example `staff_trivalent_t` can be authorized to run something as `staff_$2_t`. This will be useful once the new flatpak policy is in use, and I included commented-out lines that will allow for Trivalent-flatpak integration to keep working after we switch to that policy. Signed-off-by: Daniel Hast <[email protected]>
WavyEbuilder
requested changes
Nov 10, 2025
Collaborator
There was a problem hiding this comment.
Welcome change to me. The use of a typeattribute here isn't a huge deal, but it's expensive for something you don't need it for (typeattributes are expensive). Why not just put all accesses in the trivalent_role_template template, and grant $1_trivalent_t access? Same applies for the trivalent script domain.
WavyEbuilder
approved these changes
Nov 10, 2025
Collaborator
WavyEbuilder
left a comment
There was a problem hiding this comment.
Approved because of rationale for wanting to provide trivalent_domain to make it easier for others to add rules.
RoyalOughtness
approved these changes
Nov 11, 2025
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.
Currently the Trivalent SELinux policy implicitly assumes that the user is unconfined, and doesn't work for confined users. This modifies the policy to work for confined users as well.
The
trivalent_tandtrivalent_script_tdomains are replaced bytrivalent_domainandtrivalent_script_domainattributes, containing domains$1_trivalent_tand$1_trivalent_script_t, respectively, for each role$1_rpermitted to run Trivalent.The use of domain prefixes allows for role-dependent domain transitions, so for example
staff_trivalent_tcan be authorized to run something asstaff_$2_t. This will be useful once the new flatpak policy is in use, and I included commented-out lines that will allow for Trivalent-flatpak integration to keep working after we switch to that policy.