-
Notifications
You must be signed in to change notification settings - Fork 456
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
Security context not respected #7
Comments
yes, I can confirm that too! |
I verified that the security context work in |
@aojea The examples there don't use PVCs. |
yeah, just wanted to confirm that security context works under |
@unguiculus @rimusz Unfortunately, it's something outside of provisioner's control. It's kubelet who created the directory. The
At the end of kubernetes/minikube#1990 there is a workaround provided. I also found a PR to add fsGroup support to hostpath volume, but it wasn't accepted. kubernetes/kubernetes#39438 |
This is unfortunate :( Does the security group info at least make it to the provisioner? We could probably fix this in a similar way to how cleanup is handled? side note: It might be nice to make the image used for cleanup configurable, we can probably use one of the standard kubernetes images in many cases to avoid needing another image to be pulled 😅 (and use a specific version to avoid |
@BenTheElder Yeah this should work. Let me give it a try. |
…beforehand The permission of directory is 0770, because when a user login as group e.g. group 1000, they're also belong to group 0. The default permission for host path is 0700, which prevent group 0 from accessing the directory. Fixes rancher#7 . Also added test case `security-context.yaml` derived from @unguiculus 's comment on the issue.
@BenTheElder @unguiculus @rimusz Alright, v0.0.3 has been released and the issue with security context should be fixed. @BenTheElder I've also thrown in an option for "helper image", which used for creating and deleting (cleanup) directories on the node now. |
Very cool, thank you! |
This is a follow-up PR for #7, since 3256bdf, unfortunately, did not fully fix the issue. The example I supplied is not ideal. It works with your fix because it uses Busybox which doesn't have group 1000 so the user runs with gid=0. I added `id` to the script which prints the following: `uid=1000 gid=0(root) groups=0(root),1000` Now, when I use an image that actually has a user with uid=1000, gid=1000, such as `jenkins/jenkins` it doesn't work because the user does not belong to group 0 in this case: `uid=1000 gid=0(root) groups=0(root),1000` This fixes the issue using `0777` as Minikube does.
Thanks to Reinhard Nägele <[email protected]>, one additional PR has been merged to correctly fix #7 . See commit message and #9 for details
Hate to ping on a super old issue, but there's #41 that seems to be the same thing that was fixed in this issue. Is this an entirely different thing? I'm currently experiencing troubles getting fsGroup to be respected, even though my config looks very similar to the example one contained in the fix (3256bdf). |
I'm trying to use
local-path-provisioner
with kind. While it seems to generally work with multi-node clusters, security contexts are not respected. Volumes are always mounted withroot
as group. Here's a simple example that demonstrates this:Here's the log from the container:
As can be seen, the mounted volume has
root
as group instead of1000
as specified by the security context. I also installedlocal-path-provisioner
on Docker4Mac. The result is the same, so it is not akind
issue. Using the default storage class on Docker4Mac, it works as expected.The text was updated successfully, but these errors were encountered: