-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 prevents local-path provisioner PV dirs from being cleaned up #10130
Comments
The log doesnt make a lot of sense in my opinion, the denial is a read access from source (container_t) to (container_file_t) which should be available if container-selinux is available, can you check the following:
also
I need to see what version of container-selinux version is used and if the k3s-selinux is actually loaded not only installed |
Sure: |
Okay I think I have figured out the problem: the problem is related MCS labels, and multi container access on the same file:
As you can see local-path-provisioner started with MCS label
for more info https://www.redhat.com/en/blog/how-selinux-separates-containers-using-multi-level-security The fix is simply giving the helper pod more range of security context MCS categories, I have added a PR to fix that in local-path-provisioner to make it a permanent solution |
Reproduced with selinux in audit Validated with COMMIT=d9b8ba8d7109ca098c379d170eb412879c5ee94e
//showing expanded file categories
$ kg pv,pvc,pod -A
$ k delete -f pvc.yaml -f podpvc.yaml
$ sudo ausearch -m AVC,USER_AVC,SELINUX_ERR,USER_SELINUX_ERR -ts recent | grep -i denied
|
Environmental Info:
K3s Version:
v1.29.4+k3s1 (94e29e2e)
Node(s) CPU architecture, OS, and Version:
Linux l7-1 5.15.0-206.153.7.el9uek.x86_64 #2 SMP Thu May 9 15:59:05 PDT 2024 x86_64 x86_64 x86_64 GNU/Linux
k3s-selinux.noarch 1.5-1.el9
Cluster Configuration:
1 node / server
Describe the bug:
After applying changes from #9964, PV creates, but cannot be deleted - the helper pod fails. Therefore, PV stucks in Released state.
Steps To Reproduce:
helper-pod-delete-pvc-*
: in failed state.Expected behavior:
Actual behavior:
helper-pod-delete-pvc-*
.Additional context / logs:
#9833
setenforce 0
) helps with v0.26.The text was updated successfully, but these errors were encountered: