-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SELinux options user/role/type break pod-wide SELinux level #41370
Comments
Hm, right, so the design for Lines 239 to 245 in 5c10ea6
At a glance, my concern would be that changing that behaviour would be a breaking change 🤔 That said, I'm not sure what is set as docker create --name=test --security-opt label=foobar hello-world
docker inspect --format='{{json .HostConfig.SecurityOpt}}' test
["label=foobar"] What does your situation show? Does the container's configuration have the "faulty" label set? (if so, it could be that the problem is higher up) |
That is true for this function. However, at a later time I believe, the missing label bits will be automatically added. Forcing a type like that should not impact the other options, and it effectively doesn't impact user and role, but does make categories container-specific, which doesn't make much sense...
Could you please be more specific on what would break?
Seem that "label=foobar" is not syntactically valid (https://docs.docker.com/engine/reference/run/#security-configuration)
Creating a k8s pod with 2 containers shows 3 lines in If I start a pod with no SELinux option, the docker inspect --format='{{json .HostConfig.SecurityOpt}}' 52209dfb9a4a
["seccomp=unconfined"]
docker inspect --format='{{json .HostConfig.SecurityOpt}}' 70bd872231db
["seccomp=unconfined","label=user:system_u","label=role:system_r","label=type:container_t","label=level:s0:c494,c667"]
docker inspect --format='{{json .HostConfig.SecurityOpt}}' 9886b796e542
["seccomp=unconfined","label=user:system_u","label=role:system_r","label=type:container_t","label=level:s0:c494,c667"] If I start a pod with "user" forced to "system_u" (the default value), I get: docker inspect --format='{{json .HostConfig.SecurityOpt}}' 4b9af4f8bcfd
["label=user:system_u","seccomp=unconfined"]
docker inspect --format='{{json .HostConfig.SecurityOpt}}' fc156f05b021
["label=user:system_u","seccomp=unconfined"]
docker inspect --format='{{json .HostConfig.SecurityOpt}}' 6af446c0ea81
["label=user:system_u","seccomp=unconfined"] However, the ProcessLabel (which was the same for all containers in the previous example) ends up being in this case: docker inspect --format='{{json .ProcessLabel}}' 4b9af4f8bcfd
"system_u:system_r:container_t:s0:c413,c531"
docker inspect --format='{{json .ProcessLabel}}' fc156f05b021
"system_u:system_r:container_t:s0:c141,c1004"
docker inspect --format='{{json .ProcessLabel}}' 6af446c0ea81
"system_u:system_r:container_t:s0:c286,c362" |
Intent of this change is to switch from using docker container engine to crio. The PR keeps the doors open for switching back to docker or any other CE if needed. There are two reasons to switch to crio: docker deprecation in k8s docker issue with selinux categories moby/moby#41370 Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com>
Intent of this change is to switch from using docker container engine to crio. There are two reasons to switch to crio: docker deprecation in k8s docker issue with selinux categories moby/moby#41370 Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com>
Intent of this change is to switch from using docker container engine to crio. There are two reasons to switch to crio: docker deprecation in k8s docker issue with selinux categories moby/moby#41370 Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com>
* Move k8s 1.20 to crio CE Intent of this change is to switch from using docker container engine to crio. There are two reasons to switch to crio: docker deprecation in k8s docker issue with selinux categories moby/moby#41370 Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com> * Use custom repository mirror Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com> * Symlink docker to podman Since docker is used outside kubevirtci, we still need to support it. crictl however doesn't provide the same functiontality as docker. In this commit, I'm linking docker to podman instead, which is designed to have the same API. Signed-off-by: Radim Hrazdil <rhrazdil@redhat.com>
A bug in docker (moby/moby#41370) forces us to implement a workaround in the SELinux options of virt-launcher. That workaround (disabling categories on non-compute containers) weakens the security of the project for all when it is only needed for a very specific use-case: deployments on clusters that have docker nodes with SELinux enforced on the system and enabled in the docker configuration (it is disabled by default). That bug was filed more than 2 years ago, so it is time to disable the workaround by default, with a feature gate for those who need it. Signed-off-by: Jed Lejosne <jed@redhat.com>
A bug in docker (moby/moby#41370) forces us to implement a workaround in the SELinux options of virt-launcher. This workaround (disabling categories on non-compute containers) weakens the security of the project for all when it is only needed for a very specific use-case: deployments on clusters that have docker nodes with SELinux enforced on the system and enabled in the docker configuration (it is disabled by default). That bug was filed more than 2 years ago, so it is time to disable the workaround by default, with a feature gate for those who need it. Signed-off-by: Jed Lejosne <jed@redhat.com>
A bug in docker (moby/moby#41370) forces us to implement a workaround in the SELinux options of virt-launcher. This workaround (disabling categories on non-compute containers) weakens the security of the project for all when it is only needed for a very specific use-case: deployments on clusters that have docker nodes with SELinux enforced on the system and enabled in the docker configuration (it is disabled by default). That bug was filed more than 2 years ago, so it is time to disable the workaround by default, with a feature gate for those who need it. Signed-off-by: Jed Lejosne <jed@redhat.com>
A bug in docker (moby/moby#41370) forces us to implement a workaround in the SELinux options of virt-launcher. This workaround (disabling categories on non-compute containers) weakens the security of the project for all when it is only needed for a very specific use-case: deployments on clusters that have docker nodes with SELinux enforced on the system and enabled in the docker configuration (it is disabled by default). That bug was filed more than 2 years ago, so it is time to disable the workaround by default, with a feature gate for those who need it. Signed-off-by: Jed Lejosne <jed@redhat.com>
A bug in docker (moby/moby#41370) forces us to implement a workaround in the SELinux options of virt-launcher. This workaround (disabling categories on non-compute containers) weakens the security of the project for all when it is only needed for a very specific use-case: deployments on clusters that have docker nodes with SELinux enforced on the system and enabled in the docker configuration (it is disabled by default). That bug was filed more than 2 years ago, so it is time to disable the workaround by default, with a feature gate for those who need it. Signed-off-by: Jed Lejosne <jed@redhat.com>
A bug in docker (moby/moby#41370) forces us to implement a workaround in the SELinux options of virt-launcher. This workaround (disabling categories on non-compute containers) weakens the security of the project for all when it is only needed for a very specific use-case: deployments on clusters that have docker nodes with SELinux enforced on the system and enabled in the docker configuration (it is disabled by default). That bug was filed more than 2 years ago, so it is time to disable the workaround by default, with a feature gate for those who need it. Signed-off-by: Jed Lejosne <jed@redhat.com>
A bug in docker (moby/moby#41370) forces us to implement a workaround in the SELinux options of virt-launcher. This workaround (disabling categories on non-compute containers) weakens the security of the project for all when it is only needed for a very specific use-case: deployments on clusters that have docker nodes with SELinux enforced on the system and enabled in the docker configuration (it is disabled by default). That bug was filed more than 2 years ago, so it is time to disable the workaround by default, with a feature gate for those who need it. Signed-off-by: Jed Lejosne <jed@redhat.com>
A bug in docker (moby/moby#41370) forces us to implement a workaround in the SELinux options of virt-launcher. This workaround (disabling categories on non-compute containers) weakens the security of the project for all when it is only needed for a very specific use-case: deployments on clusters that have docker nodes with SELinux enforced on the system and enabled in the docker configuration (it is disabled by default). That bug was filed more than 2 years ago, so it is time to disable the workaround by default, with a feature gate for those who need it. Signed-off-by: Jed Lejosne <jed@redhat.com>
A bug in docker (moby/moby#41370) forces us to implement a workaround in the SELinux options of virt-launcher. This workaround (disabling categories on non-compute containers) weakens the security of the project for all when it is only needed for a very specific use-case: deployments on clusters that have docker nodes with SELinux enforced on the system and enabled in the docker configuration (it is disabled by default). That bug was filed more than 2 years ago, so it is time to disable the workaround by default, with a feature gate for those who need it. Signed-off-by: Jed Lejosne <jed@redhat.com>
@thaJeztah Any updates on this? |
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
This introduces an annotation in the KubeVirt CR to handle the DockerSELinuxMCS bug: moby/moby#41370. Using an annotation instead of a dedicated field avoids locking this workaround into the v1 API, as the bug will likely be fixed in the future. Once resolved, we can simply remove the annotation without impacting the API. Signed-off-by: bmordeha <bmordeha@redhat.com>
Description
This bug was noticed in k8s environments, but should also apply to anything that has a notion of pods.
A k8s issue was filed there:
kubernetes/kubernetes#90759
It was recently fixed in cri-o:
cri-o/cri-o#4071
In moby, I suspect the issue is in or around
generateSecurityOpt()
More information can be found under the k8s issue, but here's a short summary:
On an SELinux-enabled setup, when creating a basic non-privileged pod (sandbox in moby?) with multiple containers and no SELinux option,
2 random categories X and Y are calculated, and all processes of all containers run as the same
system_u:system_r:container_t:s0:cX,cY
.That's all good.
Now if an SELinux option is set on the pod, one would expect the same behavior as above, except with that option overridden.
For example, if
type
is set tomy_custom_container_t
, all containers should run assystem_u:system_r:my_custom_container_t:s0:cX,cY
.And it almost works, except that every container now gets a different category pair! (level)
Steps to reproduce the issue:
type: "container_t"
, notice all containers get a different SELinux levelDescribe the results you received:
Within the same pod, every container gets a different set of categories
Describe the results you expected:
All containers of a given pod should have the same categories
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Bare-metal
The text was updated successfully, but these errors were encountered: