Bug 1923728 - the audit no longer works inside of podman containers
Summary: the audit no longer works inside of podman containers
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: podman
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Lokesh Mandvekar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-01 17:54 UTC by Jakub Jelen
Modified: 2021-02-01 21:24 UTC (History)
11 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2021-02-01 21:23:35 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jakub Jelen 2021-02-01 17:54:23 UTC
Description of problem:
Running sshd in podman fails. This was not an issue in the older versions (in RHEL8).

Version-Release number of selected component (if applicable):
podman-3.0.0-0.20rc1.el9.x86_64

How reproducible:
always

Steps to Reproduce:
1. podman run -p 22000:22 --expose=22 -it centos:7 /bin/bash -c "yum install -y openssh-server && ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' && /usr/sbin/sshd -Dd"
2. in other window, connect and authenticate (enter wrong password): ssh localhost -p 22000

Actual results:
connection fails, the std error of first window ends with

debug1: PAM: password authentication failed for root: Authentication failure
Failed password for root from 10.88.0.1 port 55440 ssh2
linux_audit_write_entry failed: Operation not permitted
debug1: do_cleanup
debug1: PAM: cleanup
debug1: Killing privsep child 70
linux_audit_write_entry failed: Operation not permitted


Expected results:
the connection is accepted authentication is prompted

Additional info:

The sshd attempts to write audit message, which fails. This worked in the past and this is a regression.

Comment 1 Matthew Heon 2021-02-01 17:59:53 UTC
This looks like us dropping the Audit capability - tagging Dan Walsh to confirm

Comment 2 Daniel Walsh 2021-02-01 21:23:35 UTC
Yes we have dropped the audit_write capability by default.  Since this is a very rare case and can easily be fixed by adding it on the command line

podman run --cap-add AUDIT_WRITE -p 22000:22 --expose=22 -it centos:7 /bin/bash -c "yum install -y openssh-server && ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' && /usr/sbin/sshd -Dd"

Comment 3 Daniel Walsh 2021-02-01 21:24:34 UTC
BTW, if you want the old behaviour you can add the CAP back into /etc/containers/containers.conf (Based on /usr/share/containers/containers.conf).


Note You need to log in before you can comment on or make changes to this bug.