-
Notifications
You must be signed in to change notification settings - Fork 21
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
NSM_LISTEN_ON unix socket file permissions #510
Labels
Comments
zolug
added
enhancement
New feature or request
question
Further information is requested
labels
Jun 28, 2022
/сс @edwarnicke, @fkautz |
I think that is a good suggestion and can be done in v1.5.0. @edwarnicke, @fkautz Do you have any thoughts on that? |
I think the os.ModePerm is the right solution here. |
9 tasks
Should be resovled with networkservicemesh/sdk#1320 @zolug Feel free to reopen if we missed something. |
zolug
added a commit
to Nordix/Meridio
that referenced
this issue
Aug 8, 2022
Since NSM v1.5 CAP_DAC_OVERRIDE capability is no longer required to interact with the nsm-sock mounted as hostPath volume. networkservicemesh/cmd-nsmgr#510 Affected images: proxy, load-balancer, TAPA, NSC (The official NSM cmd-nsc image can be used again. No need for a custom Dockerfile, unless e.g. ping is required to work.)
11 tasks
zolug
added a commit
to Nordix/Meridio
that referenced
this issue
Aug 9, 2022
Since NSM v1.5 CAP_DAC_OVERRIDE capability is no longer required to interact with the nsm-sock mounted as hostPath volume. networkservicemesh/cmd-nsmgr#510 Affected images: proxy, load-balancer, TAPA, NSC (The official NSM cmd-nsc image can be used again. No need for a custom Dockerfile, unless e.g. ping is required to work.) Note: New images will NOT work on older NSM versions
zolug
added a commit
to Nordix/Meridio
that referenced
this issue
Aug 10, 2022
Since NSM v1.5 CAP_DAC_OVERRIDE capability is no longer required to interact with the nsm-sock mounted as hostPath volume. networkservicemesh/cmd-nsmgr#510 Affected images: proxy, load-balancer, TAPA, NSC (The official NSM cmd-nsc image can be used again. No need for a custom Dockerfile, unless e.g. ping is required to work.) Note: New images will NOT work on older NSM versions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This item is related to using nsm from an nsc app running as non-root.
Currently the unix listenOn socket gets created with file permissions that do not grant write access for others:
Since the socket gets created in a hostPath volume, nsm users mounting it can't rely for example on fsGroup to change group ownership. To workaround this, either an init container could be applied changing file permission/ownership, or CAP_DAC_OVERRIDE capability could be utilized by the nsc binary to bypass permission checks.
A more user friendly approach could be setting os.ModePerm file permissions in nsmgr when the socket is created, as it would not put additional requirements on the nsc application (to run as non-root).
This behaviour would match how Spire handles their unix listener:
https://github.com/spiffe/spire/blob/07219c7aed188820ebe5ffb67125fdbf69d00286/pkg/agent/endpoints/endpoints_posix.go#L31
What do you think?
nsmgr:
cmd-nsmgr/internal/manager/manager.go
Line 205 in 90a32f8
https://github.com/networkservicemesh/sdk/blob/main/pkg/tools/grpcutils/listen_and_serve.go#L66
The text was updated successfully, but these errors were encountered: