Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement capabilitiy bit storage in layers #3845
Conversation
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
crosbymichael
Jan 30, 2014
Contributor
We need to wait to merge this after we figure out a solution with the distro packaging maintainers. I'll keep things updated here.
cc @tianon
|
We need to wait to merge this after we figure out a solution with the distro packaging maintainers. I'll keep things updated here. cc @tianon |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexlarsson
Jan 30, 2014
Contributor
Upstream tar issue is: https://code.google.com/p/go/issues/detail?id=7154
|
Upstream tar issue is: https://code.google.com/p/go/issues/detail?id=7154 |
tianon
referenced this pull request
Feb 13, 2014
Merged
Add vendored archive/tar that includes xattrs patch #4131
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexlarsson
Feb 14, 2014
Contributor
I rebased this to include the new vendored archive/tar from #4131
|
I rebased this to include the new vendored archive/tar from #4131 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
(Note that the vendoring doesn't quite seem to work yet) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
rebased on the now landed, working vendored archive/tar |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Looks like "archive/stat_linux.go" needs a |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
fixed |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
ping @vieux |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
@vieux can you take a look at this? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
vieux
Feb 19, 2014
Collaborator
@alexlarsson I used your example:
instead of:
Attribute "selinux" has a 32 byte value for /usr/sbin/suexec
Attribute "capability" has a 20 byte value for /usr/sbin/suexec
I get Attribute "capability" has a 20 byte value for /usr/sbin/suexec in the first image.
and in the second Attribute "capability" has a 128 byte value for /usr/sbin/suexec
Is that normal ? (20/128)
|
@alexlarsson I used your example: instead of:
I get Is that normal ? (20/128) |
alexlarsson
added some commits
Jan 15, 2014
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexlarsson
Feb 20, 2014
Contributor
@vieux Gah, sorry about that. I made a change in the getxattr call in the rebase which i didn't test enough.
Should work now.
|
@vieux Gah, sorry about that. I made a change in the getxattr call in the rebase which i didn't test enough. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
vieux
Feb 20, 2014
Collaborator
@alexlarsson I still don't have the Attribute "selinux"... but I guess it's normal.
At least before/after I have the same thing => LGTM
|
@alexlarsson I still don't have the At least before/after I have the same thing => LGTM |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
unclejack
Feb 20, 2014
Contributor
Attribute "capability" has a 20 byte value for /usr/sbin/suexec is what I got before and after commit.
LGTM
|
LGTM |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
LGTM |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alexlarsson
Feb 20, 2014
Contributor
@vieux well, you don't have the selinux context because you don't use selinux. No worries, I won't tell Dan about it...
|
@vieux well, you don't have the selinux context because you don't use selinux. No worries, I won't tell Dan about it... |
alexlarsson commentedJan 30, 2014
This adds support for storing the capability bits of files in docker layers.
The capability bits are stored in the security.capabilites extended attributes, so i added support for xattrs to tar/archive, which is needed for this. The upstream patch is here:
https://codereview.appspot.com/54570043/
And the pull request for github.com/dotcloud/tar which is used for now is here:
https://github.com/dotcloud/tar/pull/2
This is important for fedora, that use capability bits in many rpms to avoid setuid binaries.
A simple way to verify this is to do:
This verifies that the installation of httpd created a /usr/sbin/suexec with a capability bit set, and commiting the container to an image and then launching that kept the capabilities.