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.

Bug 2122061

Summary: SELinux is preventing /usr/bin/ps from sys_ptrace access on the cap_userns labeled insights_client_t.
Product: Red Hat Enterprise Linux 9 Reporter: Andras Kovacs <andras0602>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: ahitacat, cmarinea, fjansen, lvrabec, mmalik, nknazeko, stomsa
Target Milestone: rcKeywords: Triaged
Target Release: 9.2Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-34.1.43-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 08:16:32 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Andras Kovacs 2022-08-28 23:39:08 UTC
Description of problem:
I got this SELinux policy violation when the insights-client.timer kicked in.


SELinux is preventing /usr/bin/ps from 'sys_ptrace' accesses on the cap_userns labeled insights_client_t.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that ps should be allowed sys_ptrace access on cap_userns labeled insights_client_t by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'ps' --raw | audit2allow -M my-ps
# semodule -X 300 -i my-ps.pp

Additional Information:
Source Context                system_u:system_r:insights_client_t:s0
Target Context                system_u:system_r:insights_client_t:s0
Target Objects                Unknown [ cap_userns ]
Source                        ps
Source Path                   /usr/bin/ps
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           net-tools-2.0-0.62.20160912git.el9.x86_64
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-34.1.29-1.el9_0.2.noarch
Local Policy RPM              selinux-policy-targeted-34.1.29-1.el9_0.2.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 5.14.0-70.22.1.el9_0.x86_64 #1 SMP
                              PREEMPT Tue Aug 2 10:02:12 EDT 2022 x86_64 x86_64
Alert Count                   65416
First Seen                    2022-08-25 12:36:20 CEST
Last Seen                     2022-08-29 00:18:12 CEST
Local ID                      873ce1ad-a8ae-434b-ab6f-0ede89fe11d7

Raw Audit Messages
type=AVC msg=audit(1661725092.154:23937): avc:  denied  { sys_ptrace } for  pid=59249 comm="netstat" capability=19  scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:insights_client_t:s0 tclass=cap_userns permissive=0


type=SYSCALL msg=audit(1661725092.154:23937): arch=x86_64 syscall=readlink success=no exit=EACCES a0=7ffcf3ea9650 a1=7ffcf3ea9430 a2=1d a3=6 items=0 ppid=59248 pid=59249 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=netstat exe=/usr/bin/netstat subj=system_u:system_r:insights_client_t:s0 key=(null)

Hash: ps,insights_client_t,insights_client_t,cap_userns,sys_ptrace


Version-Release number of selected component (if applicable):
insights-client-3.1.7-6.el9_0.noarch


Additional info:
It happened 65416 times in a few minutes.
# ls -Z /usr/bin/netstat /usr/bin/ps 
system_u:object_r:bin_t:s0 /usr/bin/netstat
system_u:object_r:bin_t:s0 /usr/bin/ps

Comment 1 Zdenek Pytela 2022-10-06 09:25:56 UTC
I believe  the reporte issues has been addressed on current systems:

rhel91# rpm -q selinux-policy
selinux-policy-34.1.43-1.el9.noarch

Comment 8 errata-xmlrpc 2023-05-09 08:16:32 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:2483