Navigation Menu

Skip to content
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

Support privileged with user namespaces #17409

Closed
mrunalp opened this issue Oct 27, 2015 · 8 comments
Closed

Support privileged with user namespaces #17409

mrunalp opened this issue Oct 27, 2015 · 8 comments
Assignees
Labels
area/security/userns area/security kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny

Comments

@mrunalp
Copy link
Contributor

mrunalp commented Oct 27, 2015

Currently, privileged isn't supported when user namespaces are on. However, there are many use cases where one would want to run privileged containers side by side with user namespaced containers.

How about we disable (don't apply) user namespace mappings when --privileged is passed, so we can have privilege mean the same whether user namespaces are in use or not?

@mrunalp
Copy link
Contributor Author

mrunalp commented Oct 27, 2015

@estesp @crosbymichael @LK4D4 ping

@coolljt0725
Copy link
Contributor

+1 for this, if use the --userns-remap, we can't access to the device add by --device on docker run/create, I think we should add a flag on docker run/create to disable user namespace mapping

@rhatdan
Copy link
Contributor

rhatdan commented Oct 30, 2015

Yes --privileged should mean disable all container separation including user namespace.

@rhatdan
Copy link
Contributor

rhatdan commented Oct 30, 2015

If you want to disable some separation then you need to do

--securityopt label:disabled
or

--cap-add all

But --privileged should mean root==root

@estesp estesp self-assigned this Dec 11, 2015
@estesp estesp added kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny area/security labels Dec 11, 2015
liron-l pushed a commit to twistlock/docker that referenced this issue Mar 14, 2016
Following moby#19995 and moby#17409 this PR enables skipping userns re-mapping
when creating a container (or when executing a command). Thus, enabling
privileged containers running side by side with userns remapped
containers.

The feature is enabled by specifying ```--userns:host```, which will not
remapped the user if userns are applied. If this flag is not specified,
the existing behavior (which blocks specific privileged operation)
remains.

Signed-off-by: Liron Levin <liron@twistlock.com>
@LK4D4
Copy link
Contributor

LK4D4 commented Sep 16, 2016

This was fixed as far as I know.

@LK4D4 LK4D4 closed this as completed Sep 16, 2016
@ziermmar
Copy link

How was this fixed? I don't seem to be able to use privileged mode with user namespaces on the latest stable release yet.

@thaJeztah
Copy link
Member

@ziermmar running --privileged on a container with userns enabled will never work (because the container's user doesn't have privileges on the host), that will never change as that's the intent of running with userns enables.

However, #20111 allows you to disable userns remapping for a single container, so that you can start a privileged container if userns is enabled on the daemon. That was previously not possible, and is implemented by #20111

@ziermmar
Copy link

Ah, thanks for clearing that up! In my case, I was just missing --userns=host for the container I wanted to run in -privileged mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/security/userns area/security kind/feature Functionality or other elements that the project doesn't currently have. Features are new and shiny
Projects
None yet
Development

No branches or pull requests

7 participants