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 2190178

Summary: insights-client triggers SELinux denials for teamdctl
Product: Red Hat Enterprise Linux 9 Reporter: Milos Malik <mmalik>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.3CC: lvrabec, mmalik, ngupta, zpytela
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-38.1.13-1.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: 2185158 Environment:
Last Closed: 2023-11-07 08:52:24 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 Milos Malik 2023-04-27 12:34:01 UTC
+++ This bug was initially created as a clone of Bug #2185158 +++

Description of problem:
When the teamdctl command is executed under the same SELinux context as the insights-client service, SELinux denials appear.

Version-Release number of selected component (if applicable):
selinux-policy-38.1.12-1.el9.noarch
selinux-policy-targeted-38.1.12-1.el9.noarch
teamd-1.31-16.el9_1.x86_64

How reproducible:
Always

Steps to Reproduce:
1. Register the host with Insights
2. Wait for the scheduled run of it.

Actual results:
----
type=PROCTITLE msg=audit(04/27/2023 08:09:04.834:1222) : proctitle=/usr/bin/teamdctl team0 state 
type=SYSCALL msg=audit(04/27/2023 08:09:04.834:1222) : arch=x86_64 syscall=socket success=yes exit=3 a0=packet a1=SOCK_DGRAM a2=ip a3=0x7f999034f011 items=0 ppid=8475 pid=25247 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=7 comm=teamdctl exe=/usr/bin/teamdctl subj=system_u:system_r:insights_client_t:s0 key=(null) 
type=AVC msg=audit(04/27/2023 08:09:04.834:1222) : avc:  denied  { net_raw } for  pid=25247 comm=teamdctl capability=net_raw  scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:insights_client_t:s0 tclass=capability permissive=1 
type=AVC msg=audit(04/27/2023 08:09:04.834:1222) : avc:  denied  { create } for  pid=25247 comm=teamdctl scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:insights_client_t:s0 tclass=packet_socket permissive=1 
----
type=PROCTITLE msg=audit(04/27/2023 08:09:04.834:1223) : proctitle=/usr/bin/teamdctl team0 state 
type=SYSCALL msg=audit(04/27/2023 08:09:04.834:1223) : arch=x86_64 syscall=ioctl success=yes exit=0 a0=0x3 a1=SIOCGIFINDEX a2=0x7fffe66acd30 a3=0x24 items=0 ppid=8475 pid=25247 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=7 comm=teamdctl exe=/usr/bin/teamdctl subj=system_u:system_r:insights_client_t:s0 key=(null) 
type=AVC msg=audit(04/27/2023 08:09:04.834:1223) : avc:  denied  { ioctl } for  pid=25247 comm=teamdctl path=socket:[56544] dev="sockfs" ino=56544 ioctlcmd=SIOCGIFINDEX scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:insights_client_t:s0 tclass=packet_socket permissive=1 
----
type=PROCTITLE msg=audit(04/27/2023 08:09:04.838:1224) : proctitle=/usr/bin/teamdctl team0 state 
type=PATH msg=audit(04/27/2023 08:09:04.838:1224) : item=0 name=/var/run/teamd/team0.sock inode=1201 dev=00:18 mode=socket,700 ouid=root ogid=root rdev=00:00 obj=system_u:object_r:NetworkManager_var_run_t:s0 nametype=NORMAL cap_fp=none cap_fi=none cap_fe=0 cap_fver=0 cap_frootid=0 
type=CWD msg=audit(04/27/2023 08:09:04.838:1224) : cwd=/var/ARTIFACTS/work-ci6xnmkgvp/plans/ci/discover/default-0/tests/Regression/teamd-and-similar 
type=SOCKADDR msg=audit(04/27/2023 08:09:04.838:1224) : saddr={ saddr_fam=local path=/var/run/teamd/team0.sock } 
type=SYSCALL msg=audit(04/27/2023 08:09:04.838:1224) : arch=x86_64 syscall=connect success=yes exit=0 a0=0x3 a1=0x7fffe66acbd0 a2=0x1b a3=0x7f99903b13e0 items=1 ppid=8475 pid=25247 auid=root uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=pts0 ses=7 comm=teamdctl exe=/usr/bin/teamdctl subj=system_u:system_r:insights_client_t:s0 key=(null) 
type=AVC msg=audit(04/27/2023 08:09:04.838:1224) : avc:  denied  { write } for  pid=25247 comm=teamdctl name=team0.sock dev="tmpfs" ino=1201 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:NetworkManager_var_run_t:s0 tclass=sock_file permissive=1 
----

Expected results:
 * no SELinux denials

Additional info:
 * reproduced via an automated test in Testing Farm http://artifacts.osci.redhat.com/testing-farm/650903ee-2e4b-46c7-bbd5-d659804aca8e/

Comment 4 Zdenek Pytela 2023-04-28 10:09:01 UTC
This commit addresses the reported problem:

98fb383cc Allow insights-client work with teamdctl

Comment 13 errata-xmlrpc 2023-11-07 08:52: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 (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:6617