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.
DescriptionKashyap Chamarthy
2022-10-27 09:08:41 UTC
[This is a bug based on a suggestion by Dan Walsh in an email thread. For detailed context, please see this bug: https://bugzilla.redhat.com/show_bug.cgi?id=2093956 — 'swtpm' binary is denied write/"append" permissions to log files under /var/log/swtpm/]
Description
-----------
In short, from an RHEL-9 container, '/usr/bin/swtpm' is currently unable to write to log files under /var/log/swtpm/ directory.
Currently files under /var/log/swtpm/ get the label 'container_ro_file_t' — i.e. they're unable to write.
Dan Walsh suggested an addition to allow containers to read/write to "container_log_t", and "define it as a log file, so that log processing apps can use it."
I think we should just leave content on the host labeled as a logfile, and not make it specific to a container.
matchpathcon /var/log/swtpm/
/var/log/swtpm system_u:object_r:var_log_t:s0
Then either disable the SELinux separation for the container with
podman run --security-opt label=disable ...
Or if running in Kubernetes use
type: spc_t.
If we really need to confine this container, then I could add a new type container_logwriter_t and then we could run this container with that type.
We currently have container_logreader_t. Container_logwriter_t would be allowed to write to any file under /var/log (Types with attribute logfile)
> Then either disable the SELinux separation for the container with
podman run --security-opt label=disable ...
Just to not that for Tripleo/OSP that would require containerized logrotate, libvirt and may be more containers to run with --security-opt label=disable.
I'm not sure if that'd be a nice move, so my vote goes for the 2nd option.
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 (container-selinux 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/RHBA-2023:2206
Comment 11Red Hat Bugzilla
2024-09-07 04:25:02 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 120 days