-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Docker service support for: --userns=host #37560
Comments
…eve this is the best way to secure Docker containers and services transparently but unfortunantely this won't work until Docker supports disabling this for services. moby/moby#37560
I think this should also be possible for stacks using However some core services like traefik need to be run as privileged user and this is only possible in combination with the userns flag as described here. Unfortunately the userns-remap feature (called
@thaJeztah could you maybe share some insights why this is not (yet) possible? (I'm pretty sure that there is a good reason for that). |
I don't know about this particular option specific, but the primary reason for not every option being available as option for swarm services, is that not all of the options on There are many options on In situations where decisions are not trivial, maintainers stick to the "no is temporary; yes is forever" saying, which means that in doubt, the safe choice is to not implement a feature. Adding a feature is easier than removing, or changing a feature (both will break users; including those that run this in production), so an initial "no" can change into a "yes" in future (if more insight is gained). Looking for a more portable/generic approach, including where possible, cross-platform portability, work was started on defining "entitlements" for containers (see #32801). Entitlements are still on the (long term) roadmap, but got out-prioritised by other work 😅. Back to this feature; I can see this being useful (given that user namespaces are a daemon-level option). Having said that, I'd be interested to check with some other maintainers to see if;
|
We got the same requirements here as @Finkes. Running Docker Swarm mode we want to deploy a stack for administration and monitoring purpose. The userns remap prevents access to some host resources. |
We would also like this to implemented to support running cAdvisor in swarm from a stack. |
Chiming in too... the only workaround we have right now is to have a few nodes within our cluster run without the userns enabled, label them appropriately, and only schedule specific workloads on it. Definitely a workaround/hack, but can suffice for right now. Would be nice to not have special nodes and have services support this directly. |
|
But that would only work if userns was not remapped on the Docker engine that the socket is being mounted from, right? Because the user inside the container would not have permissions to connect to the socket, the whole point of userns... |
I'd still be ok with having this implemented. I don't think "entitlements" are moving fast, and given that we have this option for |
Adding further input to this feature request. This feature would be extremely valuable for certain stacks that require userns_mode set to host and deployment set to global. |
We’ve moved onto neonKUBE. |
Let me keep this one open, as it's still possible that it will be added |
Any news on this? |
Is there any update on this request ? regards, |
Still waiting for an update |
very curious about this. If not implemented is there an alternative? |
FEATURE REQUEST
Description
--userns for docker service create and update would be useful.
I'm trying to use userns-remap to secure my cluster containers and services transparently by default but I have a few services that need to mount files from the Docker host and I was hoping to use docker service create --userns=host ... for these few services but there doesn't appear to be a way to do this using the normal command line. I suppose I could deploy a stack but I'd rather not because it mangles the service name to be stack-service instead of just service.
I was hoping to use --user=ID to explicitly run the service with a specific host user but this doesn't work because (I believe) the container's file system restricts access to only the root user. I might be able to work around this by modifying the Dockerfiles by adding a USER and setting the container filesystem permissions, but this breaks my hope for transparency.
Specifically, I'm requesting support for:
This will make it possible to secure Docker service by default without needing to munge Dockerfiles for any exceptions.
Related issue: #25303
Related PR (
docker run
): #20111Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Running on Windows 10/Pro on local Hyper-V Ubuntu 16.04 VMs.
The text was updated successfully, but these errors were encountered: