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 1703573 - selinux denial against "rhsmcertd-worke"r for "/var/log/yum.log" and "syspurpose.json"
Summary: selinux denial against "rhsmcertd-worke"r for "/var/log/yum.log" and "syspur...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: selinux-policy
Version: 7.7
Hardware: Unspecified
OS: Linux
high
high
Target Milestone: rc
: ---
Assignee: Lukas Vrabec
QA Contact: Milos Malik
URL:
Whiteboard:
: 1703920 1715661 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-26 17:58 UTC by John Sefler
Modified: 2023-10-27 20:05 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-08-06 12:53:24 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github containers container-selinux pull 69 0 None closed Add container_manage_config_files() interface 2021-02-18 21:00:07 UTC
Github fedora-selinux selinux-policy-contrib pull 103 0 None closed Deamon rhsmcertd is able to install certs for docker again 2021-02-18 21:00:07 UTC
Red Hat Product Errata RHBA-2019:2127 0 None None None 2019-08-06 12:53:36 UTC

Description John Sefler 2019-04-26 17:58:07 UTC
Description of problem:
The rhsmcertd-worker is causing three AVC denials...


Version-Release number of selected component (if applicable):
[root@kvm-01-guest10 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 7.7 Beta (Maipo)

[root@kvm-01-guest10 ~]# rpm -q subscription-manager selinux-policy
subscription-manager-1.24.4-1.el7.x86_64
selinux-policy-3.13.1-244.el7.noarch


How reproducible:


Steps to Reproduce:

[root@kvm-01-guest10 ~]# systemctl stop rhsmcertd.service
[root@kvm-01-guest10 ~]# 
[root@kvm-01-guest10 ~]# subscription-manager config --rhsmcertd.splay=0 --logging=DEBUG

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

[root@kvm-01-guest10 ~]# service auditd restart
Stopping logging:                                          [  OK  ]
Redirecting start to /bin/systemctl start auditd.service
[root@kvm-01-guest10 ~]# 
[root@kvm-01-guest10 ~]# setenforce 1
[root@kvm-01-guest10 ~]# 
[root@kvm-01-guest10 ~]# restorecon -Rv /etc /run /var
restorecon reset /etc/sysconfig/anaconda context system_u:object_r:etc_runtime_t:s0->system_u:object_r:etc_t:s0
restorecon reset /etc/chrony.conf.orig context system_u:object_r:etc_runtime_t:s0->system_u:object_r:etc_t:s0
restorecon reset /etc/beah_beaker.conf.default context system_u:object_r:etc_runtime_t:s0->system_u:object_r:etc_t:s0
restorecon reset /etc/beah.conf.default context system_u:object_r:etc_runtime_t:s0->system_u:object_r:etc_t:s0
restorecon:  Warning no default label for /run/lvmetad.pid
restorecon:  Warning no default label for /run/lock/subsys
restorecon:  Warning no default label for /run/lock/subsys/anamon
restorecon:  Warning no default label for /run/lock/subsys/rhnsd
restorecon:  Warning no default label for /run/lock/subsys/network
restorecon:  Warning no default label for /run/initramfs
restorecon:  Warning no default label for /run/initramfs/rwtab
restorecon:  Warning no default label for /run/initramfs/state
restorecon:  Warning no default label for /run/initramfs/state/var
restorecon:  Warning no default label for /run/initramfs/state/var/lib
restorecon:  Warning no default label for /run/initramfs/state/var/lib/dhclient
restorecon:  Warning no default label for /run/initramfs/state/etc
restorecon:  Warning no default label for /run/initramfs/state/etc/sysconfig
restorecon:  Warning no default label for /run/initramfs/state/etc/sysconfig/network-scripts
restorecon:  Warning no default label for /run/initramfs/.need_shutdown
restorecon:  Warning no default label for /run/initramfs/log
restorecon:  Warning no default label for /var/tmp/systemd-private-498828a95c1d46d0817645193868b377-chronyd.service-swDZQe
restorecon:  Warning no default label for /var/tmp/systemd-private-498828a95c1d46d0817645193868b377-chronyd.service-swDZQe/tmp
[root@kvm-01-guest10 ~]# 
[root@kvm-01-guest10 ~]# START_DATE_TIME=`date "+%m/%d/%Y %T"`
[root@kvm-01-guest10 ~]# 
[root@kvm-01-guest10 ~]# 
[root@kvm-01-guest10 ~]# 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: 8756d15d-fc79-443f-a72e-c6b2c24767bd
The registered system name is: kvm-01-guest10.rhts.eng.tlv.redhat.com
Service level set to: Production
Installed Product Current Status:
Product Name: Red Hat Enterprise Linux Server
Status:       Subscribed

[root@kvm-01-guest10 ~]# systemctl start rhsmcertd.service
[root@kvm-01-guest10 ~]# 
[root@kvm-01-guest10 ~]# sleep 120
[root@kvm-01-guest10 ~]# 
[root@kvm-01-guest10 ~]# ausearch -m AVC -m USER_AVC -m SELINUX_ERR -i -ts ${START_DATE_TIME}
----
type=PROCTITLE msg=audit(04/26/2019 20:46:23.127:147) : proctitle=/usr/bin/python /usr/libexec/rhsmcertd-worker 
type=SYSCALL msg=audit(04/26/2019 20:46:23.127:147) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x26fa070 a1=O_WRONLY|O_CREAT|O_APPEND a2=0666 a3=0x24 items=0 ppid=22674 pid=22676 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/bin/python2.7 subj=system_u:system_r:rhsmcertd_t:s0 key=(null) 
type=AVC msg=audit(04/26/2019 20:46:23.127:147) : avc:  denied  { open } for  pid=22676 comm=rhsmcertd-worke path=/var/log/yum.log dev="dm-0" ino=58656 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:rpm_log_t:s0 tclass=file permissive=0 
----
type=PROCTITLE msg=audit(04/26/2019 20:46:27.182:148) : proctitle=/usr/bin/python /usr/libexec/rhsmcertd-worker 
type=SYSCALL msg=audit(04/26/2019 20:46:27.182:148) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7f6c004efa54 a1=O_RDWR|O_CREAT|O_TRUNC a2=0666 a3=0xfffffff8 items=0 ppid=22674 pid=22676 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/bin/python2.7 subj=system_u:system_r:rhsmcertd_t:s0 key=(null) 
type=AVC msg=audit(04/26/2019 20:46:27.182:148) : avc:  denied  { write } for  pid=22676 comm=rhsmcertd-worke name=syspurpose.json dev="dm-0" ino=100667887 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file permissive=0 
----
type=PROCTITLE msg=audit(04/26/2019 20:46:30.912:149) : proctitle=/usr/bin/python /usr/libexec/rhsmcertd-worker --autoheal 
type=SYSCALL msg=audit(04/26/2019 20:46:30.912:149) : arch=x86_64 syscall=open success=no exit=EACCES(Permission denied) a0=0x7fde19454aa4 a1=O_RDWR|O_CREAT|O_TRUNC a2=0666 a3=0xfffffff8 items=0 ppid=22674 pid=22729 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/bin/python2.7 subj=system_u:system_r:rhsmcertd_t:s0 key=(null) 
type=AVC msg=audit(04/26/2019 20:46:30.912:149) : avc:  denied  { write } for  pid=22729 comm=rhsmcertd-worke name=syspurpose.json dev="dm-0" ino=100667887 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file permissive=0 
[root@kvm-01-guest10 ~]# 


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@kvm-01-guest10 ~]# tail -f /var/log/audit/audit.log | grep denied
type=AVC msg=audit(1556300783.127:147): avc:  denied  { open } for  pid=22676 comm="rhsmcertd-worke" path="/var/log/yum.log" dev="dm-0" ino=58656 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:rpm_log_t:s0 tclass=file permissive=0
type=AVC msg=audit(1556300787.182:148): avc:  denied  { write } for  pid=22676 comm="rhsmcertd-worke" name="syspurpose.json" dev="dm-0" ino=100667887 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file permissive=0
type=AVC msg=audit(1556300790.912:149): avc:  denied  { write } for  pid=22729 comm="rhsmcertd-worke" name="syspurpose.json" dev="dm-0" ino=100667887 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file permissive=0

Comment 8 Chris Snyder 2019-05-02 15:54:52 UTC
*** Bug 1703920 has been marked as a duplicate of this bug. ***

Comment 11 William Poteat 2019-05-15 18:37:18 UTC
https://github.com/fedora-selinux/selinux-policy-contrib/commit/897a71f46a4b921d4ea73f3892f3bff3a941d793

This is what fixed the issue in Fedora for the syspurpose part. Apply to selinux policy.

Comment 22 John Sefler 2019-05-31 13:26:50 UTC
*** Bug 1715661 has been marked as a duplicate of this bug. ***

Comment 24 errata-xmlrpc 2019-08-06 12:53:24 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, 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-2019:2127


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