-
Notifications
You must be signed in to change notification settings - Fork 256
newuidmap/newgidmap: install with file capabilities #136
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
Conversation
| chmod $(sgidperms) $(DESTDIR)$(ubindir)/$$i; \ | ||
| done | ||
| endif | ||
| if ENABLE_SUBIDS |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure that this is opt-in. So that the distros can decide whether they want these to be suid binaries or fscaps binaries. This is important when wanting to build shadow in user namespaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a --with-fcaps switch to configure
I'm not sure this can be alternative, because setting file capabilities in user namespace is not supported for Kernel < 4.14 |
e1ef37a to
c9ea9d0
Compare
When compiling it needs to be |
Where does this matter? I presume if you are playing with a container and you are dropping capabilities you are doing so because you have real root inside the container. As such what you can do inside a user namespace should not be relevant. Further file capabilities set outside of a user namespace continue to work inside the user namespaces on any kernel that supports user namespaces. The binaries that use file capabilities are just then limited to having those file capabilities inside the user namespace in which they run. |
|
I opened PR #137 before I saw this, sorry. Please update configure.ac to ensure that setcap is installed before doing everything else. Then assuming you've test-built this with and without filecaps flag, I'll merge this one. |
do not install newuidmap/newgidmap as suid binaries. Running these tools with the same euid as the owner of the user namespace to configure requires only CAP_SETUID and CAP_SETGID instead of requiring CAP_SYS_ADMIN when it is installed as a suid binary. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
c9ea9d0 to
7097145
Compare
I've pushed an updated version where I've added a check for |
It matters
No |
|
I'm also wondering there might be some container builder & runtime implementations that does not support filecaps? |
In general they would be non-OCI compliant or just not a useful runtime (most distributions use fscaps for |
|
@giuseppe, default to |
do not install newuidmap/newgidmap as suid binaries. Running these
tools with the same euid as the owner of the user namespace to
configure requires only CAP_SETUID and CAP_SETGID instead of requiring
CAP_SYS_ADMIN when it is installed as a suid binary.
Alternative solution for #132
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com