widen access to filesystem relabel in SELinux policy #2738
Merged
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.
Issue number:
#2556, #2656
Description of changes:
Adjust the default label for filesystems using extended attributes to store SELinux labels from
any_t
tolocal_t
, partly for consistency with the rest of the policy, and partly because I'm more comfortable allowing a "no-op" relabel fromlocal_t
tolocal_t
than allowing an actual label change.Split out filesystem relabel permissions into a separate permission set, so they can be granted independently from the systems management permissions.
Add a rule to allow containers to use filesystem mount options to "relabel" from
local_t
tolocal_t
. A filesystem relabeled with thecontext=
option won't be subsequently relabeled bycontainerd
.This can be useful in cases like #2556, where relabeling files isn't permitted by the SELinux policy, and in cases like #2656, where relabeling files may take an excessively long time.
Testing done:
Verified that
aws-k8s-1.24
andaws-ecs-1
can boot and run containers with no AVC denials.Confirmed that the EBS CSI driver could create
ext4
andxfs
volumes where the context is specified as a mount option in the storage class, like this:Verified that other context options, such as
context=system_u:object_r:any_t:s0
, are blocked by the SELinux policy.Terms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.