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 1738246 - SELinux prevents rhsmcertd-worker from opening the /var/log/hawkey.log file
Summary: SELinux prevents rhsmcertd-worker from opening the /var/log/hawkey.log file
Keywords:
Status: CLOSED DUPLICATE of bug 1720639
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.1
Hardware: Unspecified
OS: Linux
medium
low
Target Milestone: rc
: 8.0
Assignee: Lukas Vrabec
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
Depends On: 1716971
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-08-06 15:20 UTC by John Sefler
Modified: 2019-09-16 09:51 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-09-15 09:11:52 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description John Sefler 2019-08-06 15:20:44 UTC
Description of problem:
The rhsmcertd-worker is causing the following AVC denial...

type=AVC msg=audit(1565104291.260:4936): avc:  denied  { open } for  pid=41389 comm="rhsmcertd-worke" path="/var/log/hawkey.log" dev="dm-0" ino=101246874 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=0


Version-Release number of selected component (if applicable):
[root@qualcomm-amberwing-rep-20 ~]# rpm -q subscription-manager
subscription-manager-1.25.13-1.el8.aarch64
[root@qualcomm-amberwing-rep-20 ~]# rpm -q selinux-policy
selinux-policy-3.14.3-13.el8.noarch


How reproducible:


Steps to Reproduce:
[root@qualcomm-amberwing-rep-20 ~]# systemctl stop rhsmcertd.service
[root@qualcomm-amberwing-rep-20 ~]# 
[root@qualcomm-amberwing-rep-20 ~]# subscription-manager config --rhsmcertd.splay=0 --logging=DEBUG
[root@qualcomm-amberwing-rep-20 ~]# 

FOLLOWING INSTRUCTIONS FROM https://wiki.test.redhat.com/BaseOs/Security/SelinuxTestOnlyBugs#SELinuxHowToTestInstructions

[root@qualcomm-amberwing-rep-20 ~]# service auditd restart
Stopping logging:                                          [  OK  ]
Redirecting start to /bin/systemctl start auditd.service
[root@qualcomm-amberwing-rep-20 ~]# 
[root@qualcomm-amberwing-rep-20 ~]# setenforce 1
[root@qualcomm-amberwing-rep-20 ~]# 
[root@qualcomm-amberwing-rep-20 ~]# restorecon -Rv /etc /run /var
Relabeled /etc/dnf/modules.d/satellite-5-client.module from system_u:object_r:root_t:s0 to system_u:object_r:etc_t:s0
Relabeled /run/fsck/sda.lock from system_u:object_r:fsadm_var_run_t:s0 to system_u:object_r:var_run_t:s0
[root@qualcomm-amberwing-rep-20 ~]# 
[root@qualcomm-amberwing-rep-20 ~]# START_DATE_TIME=`date "+%m/%d/%Y %T"`
[root@qualcomm-amberwing-rep-20 ~]# 
[root@qualcomm-amberwing-rep-20 ~]# 
[root@qualcomm-amberwing-rep-20 ~]# subscription-manager register --serverurl=subscription.rhsm.stage.redhat.com --username=stage_auto_testuser --servicelevel=Production --auto-attach
Registering to: subscription.rhsm.stage.redhat.com:443/subscription
Password: 
The system has been registered with ID: 474bdaa2-406d-4268-a1f2-5c08f451d53f
The registered system name is: qualcomm-amberwing-rep-20.khw3.lab.eng.bos.redhat.com
Service level set to: Production
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux for ARM 64 High Touch Beta
Status:       Subscribed

[root@qualcomm-amberwing-rep-20 ~]# systemctl start rhsmcertd.service
[root@qualcomm-amberwing-rep-20 ~]# 
[root@qualcomm-amberwing-rep-20 ~]# sleep 120
[root@qualcomm-amberwing-rep-20 ~]# 
[root@qualcomm-amberwing-rep-20 ~]# ausearch -m AVC -m USER_AVC -m SELINUX_ERR -i -ts ${START_DATE_TIME}
----
type=PROCTITLE msg=audit(08/06/2019 11:11:31.260:4936) : proctitle=/usr/libexec/platform-python /usr/libexec/rhsmcertd-worker 
type=SYSCALL msg=audit(08/06/2019 11:11:31.260:4936) : arch=aarch64 syscall=openat success=no exit=EACCES(Permission denied) a0=0xffffffffffffff9c a1=0xaaaae39c5a00 a2=O_WRONLY|O_CREAT|O_APPEND a3=0x1b6 items=0 ppid=41336 pid=41389 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=rhsmcertd-worke exe=/usr/libexec/platform-python3.6 subj=system_u:system_r:rhsmcertd_t:s0 key=(null) 
type=AVC msg=audit(08/06/2019 11:11:31.260:4936) : avc:  denied  { open } for  pid=41389 comm=rhsmcertd-worke path=/var/log/hawkey.log dev="dm-0" ino=101246874 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=0 
[root@qualcomm-amberwing-rep-20 ~]# 


Actual results:
  shown above
  Once the rhsmcertd.service triggers the rhsmcertd-worker to run, AVC denials are logged to /var/log/audit/audit.log

Expected results:
  no AVC denials from "rhsmcertd-worke"r

Additional info:

[root@qualcomm-amberwing-rep-20 ~]# tail -f /var/log/audit/audit.log | grep denied
type=AVC msg=audit(1565104291.260:4936): avc:  denied  { open } for  pid=41389 comm="rhsmcertd-worke" path="/var/log/hawkey.log" dev="dm-0" ino=101246874 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=0

Comment 2 Milos Malik 2019-08-07 05:55:43 UTC
This issue is already mentioned in following bugs:
 * https://bugzilla.redhat.com/show_bug.cgi?id=1716971
 * https://bugzilla.redhat.com/show_bug.cgi?id=1720639

I believe the issue can be fixed by adding an appropriate file context pattern which matches /var/log/hawkey.log. Important question: Is rhsmcertd-worker supposed to only read the file? Or is the append / write access also needed?

Comment 6 Lukas Vrabec 2019-09-15 09:11:52 UTC

*** This bug has been marked as a duplicate of bug 1720639 ***


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