Add option to control ownership of containerd socket#11786
Conversation
|
Hi @viccie30. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
AkihiroSuda
left a comment
There was a problem hiding this comment.
This is insecure and should not be implemented, at least for Linux.
This matches what buildkit does and also Windows' default ACL for named pipes.
BuildKit is not comparable here, as BuiltKit does not allow privileged operations by default
What is insecure about it? For Linux the only change is that besides accepting numeric uids and gids, the code now also accepts and parses user and group names?
With this change containerd won't either. Default access is restricted to Administrators and Local System as well, unless explicitly changed by the configuration or command line. |
Sorry, I forgot we have been already supporting uids and gids. This probably should be deprecated though. |
Can I ask why? Giving selected users access to use containerd without requiring them to have root access otherwise seems useful. |
Because an access to the socket equates to the root, and some users do not know this fact. Why not just use sudo explicitly? |
This is correct. Access to the socket means a user can create a container that has no restrictions, at least on Linux. |
|
I agree that this PR will add first class support for restricting access to certain users on Windows. |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Adds support for setting the ownership (for Unix) or access rights (for Windows) for containerd's sockets using user and group names. Also adds a
--groupflag to containerd, similar to buildkitd.Would close #10454.
ACL for Windows named pipe
The named pipe is accessible to Administrators and Local System, in addition to a user or group specified by the configuration or on the command line. This matches what buildkit does and also Windows' default ACL for named pipes. Windows' default also adds read access for all authenticated and anonymous users (see below), but I didn't think that'd be appropriate here.
Discovering default ACL
I got the default ACL for named pipes using the following Go program:
And parsed it using winsddl: