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.
Bug 1852086 - allow rhsmcertd_t var_log_t:dir add_name and :file create
Summary: allow rhsmcertd_t var_log_t:dir add_name and :file create
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.1
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: 8.7
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-29 17:23 UTC by Alois Mahdal
Modified: 2023-12-15 18:20 UTC (History)
9 users (show)

Fixed In Version: selinux-policy-3.14.3-100.el8
Doc Type: Bug Fix
Doc Text:
Cause: rhsmcertd-worker requires permissions to create generic log files. Consequence: A dnf refresh spawned by the service fails to work properly if the log file does not exist. Fix: Permissions were added to selinux-policy. Result: The rhsmcertd service runs without reporting errors.
Clone Of:
Environment:
Last Closed: 2022-11-08 10:43:57 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github fedora-selinux selinux-policy pull 1200 0 None open Rhsmcertd write log 2022-05-19 08:22:34 UTC
Red Hat Product Errata RHBA-2022:7691 0 None None None 2022-11-08 10:44:18 UTC

Description Alois Mahdal 2020-06-29 17:23:33 UTC
Description of problem
======================

On first boot after upgrading from RHEL-7.9 to RHEL-8.2; we're seeing this SELinux denial:

    SELinux status:                 enabled
    SELinuxfs mount:                /sys/fs/selinux
    SELinux root directory:         /etc/selinux
    Loaded policy name:             targeted
    Current mode:                   permissive
    Mode from config file:          permissive
    Policy MLS status:              enabled
    Policy deny_unknown status:     allowed
    Memory protection checking:     actual (secure)
    Max kernel policy version:      31
    selinux-policy-3.14.3-41.el8_2.4.noarch
    ----
    time->Mon Jun 29 15:43:22 2020
    type=AVC msg=audit(1593438202.498:47): avc:  denied  { create } for  pid=5549 comm="rhsmcertd-worke" name="hawkey.log" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=1
    type=AVC msg=audit(1593438202.498:47): avc:  denied  { add_name } for  pid=5549 comm="rhsmcertd-worke" name="hawkey.log" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=dir permissive=1

audit2allow says:

    #============= rhsmcertd_t ==============
    allow rhsmcertd_t var_log_t:dir add_name;
    allow rhsmcertd_t var_log_t:file create;



Version-Release number of selected component
============================================

selinux-policy-3.14.3-41.el8_2.4.noarch


How reproducible
================

Seen once


Steps to Reproduce
==================

We got this during upgrade from RHEL-7.9 to RHEL-8.2.


Actual results
==============

Denial


Expected results
================

No denial

Comment 5 Zdenek Pytela 2022-01-13 14:48:28 UTC
Alois,

Is an issue like this still in place?

Comment 6 Alois Mahdal 2022-01-17 13:37:21 UTC
(In reply to Zdenek Pytela from comment #5)
> Alois,
> 
> Is an issue like this still in place?

I can't tell (I've left the team.)

Martin, can you please answer?

(Note: to test this in MORF, one would need to run MORF with a branch where the particular AVC hack -- likely named `oamg3500` -- is disabled.)

Comment 7 Renaud Métrich 2022-03-02 10:19:09 UTC
This still happens with RHEL 8.5, but I don't have the scenario to reproduce.
In a nutshell it's sufficient for rhsmcertd-worker to execute a DNF refresh while there was no /var/log/hawkey.log file yet.
However I don't know when such operation is triggered.
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------
Mar 01 10:59:13 ...: type=AVC msg=audit(1646132353.167:307): avc:  denied  { add_name } for  pid=1541 comm="rhsmcertd-worke" name="hawkey.log" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=dir permissive=1
Mar 01 10:59:13 ...: type=AVC msg=audit(1646132353.167:307): avc:  denied  { create } for  pid=1541 comm="rhsmcertd-worke" name="hawkey.log" scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=1
-------- 8< ---------------- 8< ---------------- 8< ---------------- 8< --------

Comment 8 Zdenek Pytela 2022-05-19 10:10:37 UTC
Commits to backport:
commit 39df22093da482340aa6350220726a9aa57767ef (HEAD -> rawhide, upstream/rawhide)
Author: Zdenek Pytela <zpytela>
Date:   Thu May 19 10:20:33 2022 +0200

    Allow rhsmcertd create generic log files

    Resolves: rhbz#1852086

commit af68d41725f11011dcf14af5e1110a3dc6cd4a8c
Author: Zdenek Pytela <zpytela>
Date:   Thu May 19 10:18:52 2022 +0200

    Update logging_create_generic_logs() to use create_files_pattern()

Comment 16 John 2022-07-28 06:40:25 UTC

HOW MANY OPEN BUGS DO YOU HAVE TO HAVE FOR AN ISSUE WHICH IS SUPPOSEDLY FIXED ALREADY IN ERRATA?

Of course, as i've pointed out elsewhere the issue is NOT fixed. But you guys think it is. So why is this bug still open?

What a hopeless mess.

Comment 17 John 2022-08-04 00:29:41 UTC
I am seeing this error on servers which have a number of dated hawkey.log files.

So it does not just occur once before hawkey.log is created for the first time.
It occurs every time logrotate rotates hawkey.log to a dated file...

I look forward to the patch for this bug actually fixing the issue... thankyou.

Comment 19 errata-xmlrpc 2022-11-08 10:43:57 UTC
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 (selinux-policy 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-2022:7691


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