Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
DescriptionAleksandar Kostadinov
2020-07-23 18:16:27 UTC
Description of problem:
Man page unclear what is default namespace behavior for podman run. One can see that in first paragraph default is disabled namespaces. Then under `host` it claims to be the default. Finally `private` also claims to be the default.
Please make more clear what is default user namespace behavior for root and non-root user.
> --userns=auto|host|keep-id|container:id|ns:namespace
>
> Set the user namespace mode for the container. It defaults to the
> PODMAN_USERNS environment variable. An empty value means user
> namespaces are disabled.
>
> · auto: automatically create a namespace. It is possible to specify
> other options to auto. The supported options are size=SIZE to
> specify an explicit size for the automatic user namespace. e.g.
> --userns=auto:size=8192. If size is not specified, auto will guess a
> size for the user namespace. uidmapping=HOST_UID:CONTAINER_UID:SIZE
> to force a UID mapping to be present in the user namespace.
> gidmapping=HOST_UID:CONTAINER_UID:SIZE to force a GID mapping to be
> present in the user namespace.
>
> · host: run in the user namespace of the caller. This is the default if
> no user namespace options are set. The processes running in the
> container will have the same privileges on the host as any other
> process launched by the calling user.
>
> · keep-id: creates a user namespace where the current rootless user's
> UID:GID are mapped to the same values in the container. This option
> is ignored for containers created by the root user.
>
> · ns: run the container in the given existing user namespace.
>
> · private: create a new namespace for the container (default)
>
> · container: join the user namespace of the specified container.
>
> This option is incompatible with --gidmap, --uidmap, --subuid and
While on it, is information about `--user` correct?
> --user, -u=[user | user:group | uid | uid:gid | user:gid | uid:group ]
>
> Sets the username or UID used and optionally the groupname or GID for
> the specified command.
>
> Without this argument the command will be run as root in the container.
Namely should lack of `--user` option result in container running as specified by `USER` in Dockerfile? This is what I observe.
Version-Release number of selected component (if applicable):
podman-1.9.3-2.module+el8.2.1+6867+366c07d6.x86_64
How reproducible:
always
Steps to Reproduce:
1. man podman
Based on my understanding of the way things work, I've created this PR upstream to address this issue: https://github.com/containers/podman/pull/7075.
However, Matt Heon and Giuseppe Scrivano may adjust the verbiage to have it better reflect reality if I'm off base.
As https://github.com/containers/podman/pull/7075 has merged, I'm setting this BZ to POST and assigning to Jindrich for any packaging/BZ needs. This fix will go out when upstream Podman is rolled into RHEL again, most likely RHEL 8.4.
This bug has been verified on podman-2.0.4-3.module+el8.3.0+7716+ce654703.
[ajia@hpe-dl380pgen8-02-vm-15 ~]$ rpm -q podman podman-catatonit
podman-2.0.4-3.module+el8.3.0+7716+ce654703.x86_64
podman-catatonit-2.0.4-3.module+el8.3.0+7716+ce654703.x86_64
[ajia@hpe-dl380pgen8-02-vm-15 ~]$ man podman-run | grep -A5 "Without this argument"
Without this argument, the command will run as the user specified in the container image. Unless overridden by a USER command in the Containerfile or by a value passed to this
option, this user generally defaults to root.
When a user namespace is not in use, the UID and GID used within the container and on the host will match. When user namespaces are in use, however, the UID and GID in the
container may correspond to another UID and GID on the host. In rootless containers, for example, a user namespace is always used, and root in the container will by default
correspond to the UID and GID of the user invoking Podman.
[ajia@hpe-dl380pgen8-02-vm-15 ~]$ man podman-run | grep -A1 "Set the user namespace mode"
Set the user namespace mode for the container. It defaults to the PODMAN_USERNS environment variable. An empty value ("") means user namespaces are disabled unless an
explicit mapping is set with they --uidmapping and --gidmapping options.
[ajia@hpe-dl380pgen8-02-vm-15 ~]$ man podman-run | grep -A1 "user namespace of the caller"
· host: run in the user namespace of the caller. The processes running in the container will have the same privileges on the host as any other process launched by the calling
user (default).
[ajia@hpe-dl380pgen8-02-vm-15 ~]$ man podman-run | grep -B2 "private: create a new namespace"|grep -v default
· ns:path: path to a network namespace to join;
--
· host: use the host's PID namespace for the container. Note the host mode gives the container full access to local PID and is therefore considered insecure;
--
· ns: run the container in the given existing user namespace.
· private: create a new namespace for the container.
--
· host: use the host's UTS namespace inside the container.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Moderate: container-tools:rhel8 security, bug fix, and enhancement update), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2020:4694