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 2229559 - [RHEL8/Insights/SELinux/Bug] SELinux AVC denials for insights-client var-log-t
Summary: [RHEL8/Insights/SELinux/Bug] SELinux AVC denials for insights-client var-log-t
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: selinux-policy
Version: 8.8
Hardware: Unspecified
OS: Unspecified
urgent
low
Target Milestone: rc
: ---
Assignee: Zdenek Pytela
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-08-07 02:11 UTC by Nikhil Gupta
Modified: 2023-11-14 17:57 UTC (History)
3 users (show)

Fixed In Version: selinux-policy-3.14.3-126.el8
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-11-14 15:47:54 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 1834 0 None open Insights update 2 2023-08-11 14:55:23 UTC
Red Hat Issue Tracker RHELPLAN-164683 0 None None None 2023-08-07 02:13:53 UTC
Red Hat Product Errata RHBA-2023:7091 0 None None None 2023-11-14 15:48:02 UTC

Description Nikhil Gupta 2023-08-07 02:11:04 UTC
Description of problem:

I see the https://github.com/RedHatInsights/insights-core/pull/3850 that is recently added, but actually it lacks the SELinux policy to allow it.

+ sudo ausearch -i -m avc,user_avc -ts today
~~~
node=abc-host type=PROCTITLE msg=audit(08/03/2023 13:52:01.275:156177) : proctitle=/usr/libexec/platform-python /usr/lib/python3.6/site-packages/insights_client/run.py --retry 3
node=abc-host type=PATH msg=audit(08/03/2023 13:52:01.275:156177) : item=1 name=/var/log/log_lock.pid inode=2241455 dev=fd:00 mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:var_log_t:s0 nametype=CREATE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
node=abc-host type=PATH msg=audit(08/03/2023 13:52:01.275:156177) : item=0 name=/var/log/ inode=2097865 dev=fd:00 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:var_log_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
node=abc-host type=CWD msg=audit(08/03/2023 13:52:01.275:156177) : cwd=/
node=abc-host type=SYSCALL msg=audit(08/03/2023 13:52:01.275:156177) : arch=x86_64 syscall=openat success=yes exit=12 a0=AT_FDCWD a1=0x7f21c7781be8 a2=O_RDWR|O_CREAT|O_CLOEXEC a3=0x1a4 items=2 ppid=2966557 pid=2966623 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=platform-python exe=/usr/libexec/platform-python3.6 subj=system_u:system_r:insights_client_t:s0 key=(null)
node=abc-host type=AVC msg=audit(08/03/2023 13:52:01.275:156177) : avc:  denied  { write } for  pid=2966623 comm=platform-python path=/var/log/log_lock.pid dev="dm-0" ino=2241455 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=1
node=abc-host type=AVC msg=audit(08/03/2023 13:52:01.275:156177) : avc:  denied  { create } for  pid=2966623 comm=platform-python name=log_lock.pid scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=1
----
node=abc-host type=PROCTITLE msg=audit(08/03/2023 13:52:01.275:156178) : proctitle=/usr/libexec/platform-python /usr/lib/python3.6/site-packages/insights_client/run.py --retry 3
node=abc-host type=PATH msg=audit(08/03/2023 13:52:01.275:156178) : item=0 name=/var/log/dnf.log inode=2242945 dev=fd:00 mode=file,600 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:var_log_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
node=abc-host type=CWD msg=audit(08/03/2023 13:52:01.275:156178) : cwd=/
node=abc-host type=SYSCALL msg=audit(08/03/2023 13:52:01.275:156178) : arch=x86_64 syscall=chmod success=yes exit=0 a0=0x7f21c7781be8 a1=0600 a2=0x0 a3=0x2 items=1 ppid=2966557 pid=2966623 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=platform-python exe=/usr/libexec/platform-python3.6 subj=system_u:system_r:insights_client_t:s0 key=(null)
node=abc-host type=AVC msg=audit(08/03/2023 13:52:01.275:156178) : avc:  denied  { setattr } for  pid=2966623 comm=platform-python name=dnf.log dev="dm-0" ino=2242945 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=1
----
node=abc-host type=PROCTITLE msg=audit(08/03/2023 13:52:01.275:156179) : proctitle=/usr/libexec/platform-python /usr/lib/python3.6/site-packages/insights_client/run.py --retry 3
node=abc-host type=PATH msg=audit(08/03/2023 13:52:01.275:156179) : item=1 name=/var/log/log_lock.pid inode=2241455 dev=fd:00 mode=file,644 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:var_log_t:s0 nametype=DELETE cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
node=abc-host type=PATH msg=audit(08/03/2023 13:52:01.275:156179) : item=0 name=/var/log/ inode=2097865 dev=fd:00 mode=dir,755 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:var_log_t:s0 nametype=PARENT cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0
node=abc-host type=CWD msg=audit(08/03/2023 13:52:01.275:156179) : cwd=/
node=abc-host type=SYSCALL msg=audit(08/03/2023 13:52:01.275:156179) : arch=x86_64 syscall=unlink success=yes exit=0 a0=0x7f21c7781be8 a1=0x0 a2=0x0 a3=0x1 items=2 ppid=2966557 pid=2966623 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=platform-python exe=/usr/libexec/platform-python3.6 subj=system_u:system_r:insights_client_t:s0 key=(null)
node=abc-host type=AVC msg=audit(08/03/2023 13:52:01.275:156179) : avc:  denied  { unlink } for  pid=2966623 comm=platform-python name=log_lock.pid dev="dm-0" ino=2241455 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_log_t:s0 tclass=file permissive=1
...
+ sudo audit2allow -a
#============= insights_client_t ==============
allow insights_client_t var_log_t:file { create setattr unlink write };
~~~


Version-Release number of selected component (if applicable):
RHEL 8.8
selinux-policy-devel-3.14.3-124.el8.noarch
selinux-policy-3.14.3-124.el8.noarch
selinux-policy-targeted-3.14.3-124.el8.noarch

How reproducible:
Always

Steps to Reproduce:
1. Register RHEL 8.8 host with Insights
2. Install latest(pre-released) selinux-policy packages
3. Restart `insights-client` service

Actual results:
SELinux AVC denials for insights-client var-log-t 

Expected results:
Insights upload should complete without any AVC triggered.

Comment 1 Zdenek Pytela 2023-08-11 16:24:58 UTC
Commit to backport:
97f7155ab Allow insights-client create all rpm logs with a correct label
8f443b560 Allow insights-client manage generic logs

Comment 11 errata-xmlrpc 2023-11-14 15:47:54 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-2023:7091


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