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

Privileged Mode - Is it required? #2

Open
JohnOmernik opened this issue Jun 28, 2017 · 1 comment
Open

Privileged Mode - Is it required? #2

JohnOmernik opened this issue Jun 28, 2017 · 1 comment

Comments

@JohnOmernik
Copy link

First, thank you for putting this together, I was going to do this today, and googled it, and though I would try it out first.

I wanted to asked about the --privileged flag. Is it needed? Do we know why it's part of the run command? Ideally I like running my containers without it if possible.

John

@exsilium
Copy link
Owner

exsilium commented Jun 28, 2017

Hi! and Thanks!

This is a valid comment, --privileged is a lazy way out of it. The reasons for the privileged mode are tmpfs mounting, MongoDB and changing the process user/group when launching processes. Still, these can be controlled in a more detailed way through the --cap-add option.

Try the following instead of --privileged to see if it works:

--cap-add=SETUID
--cap-add=SETGID
--cap-add=SYS_ADMIN
--cap-add=DAC_READ_SEARCH
--cap-add=NET_BIND_SERVICE
--cap-add=SYS_PTRACE

Source: https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities

I'll keep the issue open until we can come to an agreement on what is the reasonable list of capabilities to give to the container and I'll commit the change.

Thanks for taking security seriously! 🥇 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants