packaging: add initial SELinux policy and RPM hooks for smoo-gadget#15
Open
packaging: add initial SELinux policy and RPM hooks for smoo-gadget#15
Conversation
Add a permissive-but-scoped SELinux module for smoo-gadget covering FunctionFS, configfs, and ublk device/control interactions used during switchroot bring-up. Build the .pp in the RPM, install it in the gadget subpackage, and auto-install/remove it via %post/%postun hooks so SELinux-enabled systems can boot and iterate on tighter policy rules.
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.
Motivation
smoo-gadgetfrom initializing, so provide a minimal, scoped policy to unblock boot and enable iteration from AVC logs.Description
packaging/selinux/smoo_gadget.tewhich definessmoo_gadget_t/smoo_gadget_exec_tand allows the current FunctionFS/configfs/ublk interactions the gadget needs.packaging/selinux/smoo_gadget.fcto label/usr/bin/smoo-gadgetso it transitions into the new domain at exec time.smoo.specto add SELinux build/runtime deps (checkpolicy,selinux-policy-devel,policycoreutils), build the module (smoo_gadget.pp) during%build, install the.ppinto the gadget subpackage, and automatically install/remove the module in%post gadget/%postun gadgetusingsemodule.Testing
cargo fmt --all -- --checkand it succeeded.cargo check --workspace --lockedand it completed successfully.cargo clippy --workspaceand it completed successfully.rpmspec -P smoo.spec, butrpmspecis not available in this environment so that validation could not be performed here.Codex Task