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

Docker labs security says that images cannot have files with capabilities set; what gives? #1

Closed
thediveo opened this issue Jul 28, 2020 · 4 comments

Comments

@thediveo
Copy link

https://github.com/docker/labs/tree/master/security/capabilities#tips says:

Docker images cannot have files with capability bits set. This reduces the risk of Docker containers using capabilities to escalate privileges.

Is the Docker labs security information outdated then, as it is in conflict with your blog post and example? Are there different filesystems used when unpacking a container image for execution, so file capabilities might get ignored?

@amouat
Copy link
Contributor

amouat commented Aug 12, 2020

I'd have to look into it to be sure, but I think your thought on file-systems is probably correct - capabilities do require file system support.

I did test the examples to death, but I should have included which Docker file system I was using.

Let me look into this a bit at something needs updated.

@amouat
Copy link
Contributor

amouat commented Aug 12, 2020

Ok, so this was pretty quick in the end.

The article you link says that capabilities are stripped by docker build (so nothing to do with the filesystem). This isn't the case for me:

$ docker build -t capblog .
...
$ docker run capblog getcap /set_ambient
/set_ambient = cap_net_bind_service+p

I do note that article is 2 years old and there has been a lot of work on docker build since (see buildx etc). I think things have just changed since it was written.

Thanks for opening the issue though - you had me worried for a minute :)

I'm going to close this as I think it's pretty clear you can have capabilities in Docker images.

@amouat amouat closed this as completed Aug 12, 2020
@thediveo
Copy link
Author

But shouldn't the article get updated, such as by removing the false part about images cannot have file caps?

@amouat
Copy link
Contributor

amouat commented Aug 12, 2020

Yes it should. But there is already an open issue docker/labs#469

I don't think the repo is really maintained any more.

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

No branches or pull requests

2 participants