-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Rootless podman loses capabilities for binaries #1550
Comments
I don't think this depends on the file caps not set and that containers/storage#217 is going to fix it. If you'd like to use ping, then you need to setup unprivileged ICMP on the host:
in this way ICMP can be used without requiring additional caps (as the ping binary does) |
@debarshiray could you verify if that command solves the issue you've seen? |
@debarshiray have you had a chance to look at my proposed fix? |
Sorry for the delay. I was trying this out last Friday, when I realized that IPv6 doesn't quite work from inside the Red Hat Brno network even though
Yes, this makes I didn't know about
I wonder if it will be OK to install a
|
I think it should be left to the admin of the machine to enable unprivileged ICMP and should not be done by default (as also it might be limited to only a subset of the users). |
The user-facing issue is that |
ping on the host is installed by root while for a rootless container it is an unprivileged user to install it so even adding the capabilities to the file doesn't really map to the user having them. In general there is no solution to this issue, a rootless container cannot get more privileges than the user has on the host, but for this case, you could probably just bind mount the |
@debarshiray Seems the best we can do is better documentation. Perhaps we add something to podman run describing stuff that will not work quite well in Non Root user. |
To avoid weird ABI issues, I guess, one will also have to bind mount the shared objects from the host.
That could be useful. In the worst case, I wonder what might be the best way to convey such a limitation to a person trying to use This is now going off-topic for this issue tracker, though. :) |
I think I disagree here. weren't icmp echo sockets added specifically so these caps could get dropped? we should probably just get the global default distro sysctl.conf fixed, rather than having a drop-in file though. |
I filed systemd/systemd#13141 to get |
This makes ping(8) work without CAP_NET_ADMIN and CAP_NET_RAW because those aren't effective inside rootless Podman containers. It's quite useful when using OSTree based operating systems like Fedora Silverblue, where development environments are often set up using rootless Podman containers with helpers like Toolbox [1]. Not having a basic network utility like ping(8) work inside the development environment can be inconvenient. See: https://lwn.net/Articles/422330/ http://man7.org/linux/man-pages/man7/icmp.7.html containers/podman#1550 The upper limit of the range of group identifiers is set to 2147483647, which is 2^31-1. Values greater than that get rejected by the kernel because of this definition in linux/include/net/ping.h: #define GID_T_MAX (((gid_t)~0U) >> 1) That's not so bad because values between 2^31 and 2^32-1 are reserved on systemd-based systems anyway [2]. [1] https://github.com/debarshiray/toolbox [2] https://systemd.io/UIDS-GIDS.html#summary
This makes ping(8) work without CAP_NET_ADMIN and CAP_NET_RAW because those aren't effective inside rootless Podman containers. It's quite useful when using OSTree based operating systems like Fedora Silverblue, where development environments are often set up using rootless Podman containers with helpers like Toolbox [1]. Not having a basic network utility like ping(8) work inside the development environment can be inconvenient. See: https://lwn.net/Articles/422330/ http://man7.org/linux/man-pages/man7/icmp.7.html containers/podman#1550 The upper limit of the range of group identifiers is set to 2147483647, which is 2^31-1. Values greater than that get rejected by the kernel because of this definition in linux/include/net/ping.h: #define GID_T_MAX (((gid_t)~0U) >> 1) That's not so bad because values between 2^31 and 2^32-1 are reserved on systemd-based systems anyway [2]. [1] https://github.com/debarshiray/toolbox [2] https://systemd.io/UIDS-GIDS.html#summary
/kind bug
Description
This is similar to #1526 but about capabilties, and not the SUID bit.
Once you enter the Silverblue toolbox you see:
Since,
/usr/bin/ping
isn't present in the basefedora
image, we need to use an image that layers insudo
. eg., thefedora-toolbox
image.Output of
podman version
:Note that this is
podman-0.9.3.1
with the fix for #1526 cherry-picked on top. I also have the patch from opencontainers/runc#1862 in myrunc
build.Output of
podman info
:Additional environment details (AWS, VirtualBox, physical, etc.):
This is a physical laptop running Fedora 28 Silverblue 28.20180923.0.
The text was updated successfully, but these errors were encountered: