-
Notifications
You must be signed in to change notification settings - Fork 349
Complete SELinux support #1195
Comments
@randomvariable The proposal sounds good to me. Would you like to contribute a PR for this? I'll help you review and get it in. :) |
@randomvariable One question about your proposal. When Selinux option is set in pod security context https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#assign-selinux-labels-to-a-container, containerd should set the label correspondingly right? Do you expect that even when no SELINUX option is set for the pod, containerd still allocate a random label? |
Yes, that's right. If the user is explicit in the pod spec, follow what they've asked for, otherwise allocate a random label. I could work on this, but may take a little while. Wanted to check my thinking in any case. |
@randomvariable Keeping behavior identical with Docker SGTM. |
Hey all, any updates on this? I just found this out the hard way xD edit: i see it marked as a 1.4 milestone. So I assume when 1.4 drops I can try this out again? |
I assume this should have been closed when #1487 was merged; however, it will not be available generally until 1.4 is released. It should be available to be tested using the latest 1.4 beta release today. @crosbymichael should this be closed? Is there anything left to implement? |
Yeah, we should close this out. Try the beta releases, rc and ga will be soon. |
Follow up to #199
Hi, so I've been looking into what it would take to complete SELinux support on containerd, and have come up with the following, after looking at CRI-O and Docker today:
ContainerD MCS SELinux Support
Goals
Requirements
Functional
When not specified, containerd MUST use MCS to assign containers their own individual categories
Non-functional
and then in relation to kubernetes/kubeadm#279
Current state
Containerd includes minimal support for SELinux. More accurately, it contains support to run ON systems using SELinux, but it does not make use of SELinux to improve container security.
All containers run with the
system_u:system_r:container_runtime_t:s0
label, but no further segmentation is madeWhat do others do?
Both docker and cri-o will allocate random MCS categories to each container to improve isolation of processes. A container running with category
c113,c196
, will not be able to read files in a file system labelledc114,c197
, preventing a class of host path escape attacks.Proposed SELinux MCS design for containerd
Modify the sandbox.Store to contain a SELinux MCS map, of categories (strings), to a (int) count of the number of sandboxes running at that label, similar to what CRI-O and Docker are doing today. Updates to the store must be performed via a mutex. This store would be used in two scenarios:
On sandbox creation
On sandbox destruction
The text was updated successfully, but these errors were encountered: