-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
unable to run envoy proxy with selinux enforcing #2240
Comments
In my initial assessment I thought that this was a policy miss in k3s-selinux: https://github.com/rancher/k3s-selinux/blob/470ebf7dc1f53ffcf9020521d6a263bf9f79f4bd/k3s.fc#L16 But, of course, there is no transition yet defined for the shm path as there is for rke2: https://github.com/rancher/rke2-selinux/blob/v0.2.testing.2/rke2.if#L21 Turns out, the transition is in container-selinux: https://github.com/containers/container-selinux/blob/RHEL7.5/container.te#L191 |
With attempt to verify this on Fedora 32 on the chance that updated policy solves this (el7 ~ 2.119, f32 ~ 2.144) |
This won't make it into the initial 1.19 release, but we'll address it in a follow up. |
@dweomer Are you actually working on a fix now and have a way forward? Or should we put this in the backlog for now? |
@davidnuzik backlog I think but likely high-ish priority. Can maybe get to it later this week. |
We plan to take SELinux out of experimental in docs after the fix for this is in. |
Addresses #2240 Signed-off-by: Jacob Blain Christen <[email protected]>
Addresses #2240 Signed-off-by: Jacob Blain Christen <[email protected]>
see k3s-io/cri#7 addresses #2240 for 1.18 backport of #2478 to 1.3.x Signed-off-by: Jacob Blain Christen <[email protected]>
Address an issue originally seen in the k3s 1.3 and 1.4 forks of containerd/cri, k3s-io/k3s#2240. This is a backport of containerd/containerd#4699 Even with updated container-selinux policy, container-local /dev/shm will get mounted with container_runtime_tmpfs_t because it is a tmpfs created by the runtime and not the container (thus, container_runtime_t transition rules apply). The relabel mitigates such, allowing envoy proxy to work correctly (and other programs that wish to write to their /dev/shm) under selinux.
Address an issue originally seen in the k3s 1.3 and 1.4 forks of containerd/cri, k3s-io/k3s#2240. This is a backport of containerd/containerd#4699 Even with updated container-selinux policy, container-local /dev/shm will get mounted with container_runtime_tmpfs_t because it is a tmpfs created by the runtime and not the container (thus, container_runtime_t transition rules apply). The relabel mitigates such, allowing envoy proxy to work correctly (and other programs that wish to write to their /dev/shm) under selinux. Signed-off-by: Jacob Blain Christen <[email protected]>
Validated using Commit ID c72c186 in CentOS 7.8 as well as RHEL 8.2 on SELinux Enforced systems.
|
Address an issue originally seen in the k3s 1.3 and 1.4 forks of containerd/cri, k3s-io/k3s#2240. This is a backport of containerd/containerd#4699 Even with updated container-selinux policy, container-local /dev/shm will get mounted with container_runtime_tmpfs_t because it is a tmpfs created by the runtime and not the container (thus, container_runtime_t transition rules apply). The relabel mitigates such, allowing envoy proxy to work correctly (and other programs that wish to write to their /dev/shm) under selinux. Signed-off-by: Jacob Blain Christen <[email protected]>
Address k3s-io/k3s#2240. Cherry-pick of containerd#1605 Signed-off-by: Jacob Blain Christen <[email protected]>
Addresses k3s-io/k3s#2240 Adapted from 6af326d Signed-off-by: Jacob Blain Christen <[email protected]>
Validated the fix using commit 2c666af on rhel 7.8 as well rhel 8.2
|
Addresses k3s-io#2240 Signed-off-by: Jacob Blain Christen <[email protected]>
Addresses k3s-io/k3s#2240 Adapted from 6af326d Signed-off-by: Jacob Blain Christen <[email protected]>
Environmental Info:
k3s version v1.18.8+k3s1 (6b59531)
k3s version v1.19.1-rc1+k3s1 (041f18f)
Node(s) CPU architecture, OS, and Version:
Single-node amd64, CentOS 7:
Describe the bug:
Unable to run envoy proxy with SELinux=Enforcing.
Steps To Reproduce
kubectl get pod envoy
Expected behavior:
The pod runs without crashing
Actual behavior:
The pod is in a crash loop.
Additional context / logs:
sudo ausearch -ts recent -m avc
The text was updated successfully, but these errors were encountered: