UBI9/RHEL PAM account checks fail in rootless Podman on Ubuntu host, causing crontab/pam_unix to reject a valid container user #28856
saramonzon
started this conversation in
General
Replies: 1 comment
-
|
This does not sounds like podman bug, if the applications inside misbehave then it is likely a specific problem with that code so I move this to a discussion. We also only support the latest upstream release here, so you would need to check if the problem even happens with the current release, otherwise it is best to report this trough the distro bug channels for the package |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
Inside a rootless Podman container based on registry.access.redhat.com/ubi9/ubi, PAM account management fails for a valid normal container user when using RHEL/UBI9 PAM stacks such as crond and login.
The failure appears when running commands such as:
as a non-root user inside the container. crontab fails with a PAM error indicating that the user is not allowed to access crontab.
The same UBI9 image/PAM setup works on a RedHat-like Podman host with SELinux enabled. An Ubuntu container image using Debian cron/PAM also works on the same Ubuntu host where UBI9 fails.
This looks like a possible interaction between:
Testing points specifically to pam_unix.so failing during the PAM account phase. pam_access.so alone succeeds, pam_permit.so succeeds, but pam_unix.so fails.
The failing operation is equivalent to:
On the failing Ubuntu/rootless Podman host, this returns:
On the working RedHat-like/SELinux Podman host, the same test returns:
This does not appear to be caused by the application, Django, django-crontab, UID/GID mismatch, broken /etc/shadow, or a generic setuid failure. A custom setuid-root test binary can successfully read /etc/shadow on the failing Ubuntu host.
Steps to reproduce the issue
Run the following on the Ubuntu host using rootless Podman:
Observe that crontab -l fails for the valid container user iskylims.
Replace the crond PAM account stack with pam_permit.so:
Run again:
Observe that crontab -l now works.
Describe the results you received
Running crontab -l as the valid container user fails:
The default UBI9 /etc/pam.d/crond is:
system-auth includes:
Testing showed:
pam_access.so alone succeeds.
pam_permit.so succeeds.
pam_unix.so fails.
Replacing account include system-auth with account required pam_permit.so makes crontab -l work.
A direct setuid-root PAM test calling:
fails on the Ubuntu host:
The same direct PAM test succeeds on a RedHat-like/SELinux Podman host:
Other PAM services on the failing Ubuntu host with the UBI9 image:
The following were equivalent or checksum-identical between the failing Ubuntu host container and the working RedHat-like/SELinux host container:
The following files are effectively the same except for UID/GID values:
A setuid-root test binary can successfully read /etc/shadow on the failing Ubuntu host, so generic setuid and generic shadow access appear to work.
On the same Ubuntu host/rootless Podman runtime, an Ubuntu image works:
Output:
So this seems specific to UBI9/RHEL PAM/cronie behavior under this Ubuntu rootless Podman runtime.
Describe the results you expected
expected crontab -l to succeed for the valid container user.
For a user without a crontab, the expected output would be something like:
or an equivalent successful crontab listing if a crontab already exists.
I did not expect pam_unix.so account checks to fail with:
especially because:
podman info output
Podman in a container
No
Privileged Or Rootless
Rootless
Upstream Latest Release
No
Additional environment details
Failing environment:
Host OS: Ubuntu 24.04.3 LTS
Kernel: 6.8.0-111-generic
Podman: 4.9.3
OCI runtime: runc 1.2.4
Storage: overlay using fuse-overlayfs 1.13-dev
Rootless: true
SELinux: false
AppArmor enabled according to podman info: false
Seccomp: enabled
Working comparison environment:
RedHat-like Podman host
SELinux enabled
Container SELinux context similar to:
system_u:system_r:container_t:s0:c947,c967
Same UBI9/RHEL PAM/cronie userspace setup works there
Additional information
An Ubuntu 24.04 container image using Debian cron/PAM works on the same failing Ubuntu host/rootless Podman runtime.
The main question is whether this is expected behavior for UBI9/RHEL PAM account checks under rootless Podman on an Ubuntu host. If not, I would appreciate guidance on whether this is more likely to be a Podman/runtime issue, a UBI9/Linux-PAM issue, or an Ubuntu packaging/kernel/runtime issue.
Beta Was this translation helpful? Give feedback.
All reactions