SELinux policy changes in Bottlerocket 1.3.0 #1747
Replies: 5 comments 7 replies
-
I'm aware this will fix #1651 are there any AMIs published to test this build? Very exciting changes! |
Beta Was this translation helpful? Give feedback.
-
We don’t currently have a way for users to test official builds before release, but we have a couple things to suggest: Once the 1.3.0 release is ready, it’ll be rolling out slowly, over the course of about two weeks. You could test early in this cycle by setting All of the expected pull requests for the 1.3.0 have been merged, including #1733 that introduced the MCS changes, so you could also build your own test images. You can use them just like official ones, except that they won’t be able to upgrade to future official releases. |
Beta Was this translation helpful? Give feedback.
-
Is there ever an intention that pods should need to share resources using MCS? In my experience of how MCS is implemented that would be quite painful, as all categories need to be present to allow interaction. Example with 2 pods:
Is there a scenario where pod1 would need to access a process/file/etc.. in pod2?
Approach Approach What's the missing piece to my mental model? |
Beta Was this translation helpful? Give feedback.
-
Is there a way to get the same automatic MCS labels for all pods in the same namespace? Sometimes they share the same volume, and we think that this is the root cause for permissions errors we see. |
Beta Was this translation helpful? Give feedback.
-
Though I hate necro-posting, this is the only place I've been able to see any details about the implementation that seems to be blocking me. Our current situation is that we have an NFS server container which uses an This NFS container hosts temporary executables which are then used by pods created by a controller. It looks like the pods are unable to execute the files exposed via NFS due to the MCS labels being in-place:
I guess my questions are as follows:
I'm happy to provide logs or additional details if required, and appreciate any help you might be able to provide! |
Beta Was this translation helpful? Give feedback.
-
How is the SELinux policy changing?
In Bottlerocket 1.3.0, we will be enforcing Multi-Category Security (MCS) in the SELinux policy, which will add an additional layer of security between pods (Kubernetes) and tasks (Amazon ECS) on the same host.
What does this mean to me?
The majority of the use cases that work today will continue to work.
task
PID mode can be set so they will share the same MCS pair.emptyDir
and Amazon EBS volumes are automatically relabeled with the MCS pair when the pod is brought up, so containers in that pod can always read and write to them. Volume types likehostPath
and Amazon EFS volumes are not relabeled, which allows reads and writes from all containers.What could go wrong?
In certain cases, unprivileged containers will be unable to access files or processes that belong to other containers.
Can I turn it off?
No. Bottlerocket aims to constantly improve the security posture of the host OS, and it is important to ensure that unprivileged containers do not have access to unexpected resources.
Help! I found a problem!
All SELinux related access denials will be logged in
dmesg
and in the host’s journal. You can use these resources to verify an incompatibility with the new SELinux policy restrictions. In most cases, you can work around this by adding SELinux options to pod specs or task definitions.If you continue to have difficulty, you can downgrade to the previous Bottlerocket version, or pin to a specific Bottlerocket version in your update settings. Please reach out through AWS Premium Support or open a GitHub issue for further guidance.
Beta Was this translation helpful? Give feedback.
All reactions