Bug 2185158

Summary: [RHEL8.7/Insights/SELinux/Bug] Insights-client SELinux AVC denials for python3 and teamdctl
Product: Red Hat Enterprise Linux 8 Reporter: Nikhil Gupta <ngupta>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: high    
Version: 8.7CC: lvrabec, mmalik, thomas.rumbaut
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.3-119.el8 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2190178 (view as bug list) Environment:
Last Closed: 2023-11-14 15:47:46 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 Nikhil Gupta 2023-04-07 07:57:25 UTC
Description of problem:
SELinux AVC denials:
~~~
type=AVC msg=audit(1680656450.138:202643): avc:  denied  { sendto } for  pid=3164511 comm="python3" path="/run/awx-rsyslog/rsyslog.sock" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=unix_dgram_socket permissive=1
type=AVC msg=audit(1680656450.138:202643): avc:  denied  { write } for  pid=3164511 comm="python3" name="rsyslog.sock" dev="tmpfs" ino=44542 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1680656467.027:202956): avc:  denied  { sendto } for  pid=3164921 comm="python3" path="/run/awx-rsyslog/rsyslog.sock" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=unix_dgram_socket permissive=1
type=AVC msg=audit(1680656467.027:202956): avc:  denied  { write } for  pid=3164921 comm="python3" name="rsyslog.sock" dev="tmpfs" ino=44542 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=1
type=AVC msg=audit(1680656474.534:202985): avc:  denied  { sendto } for  pid=3165049 comm="python3" path="/run/awx-rsyslog/rsyslog.sock" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=unix_dgram_socket permissive=1
type=AVC msg=audit(1680656474.534:202985): avc:  denied  { write } for  pid=3165049 comm="python3" name="rsyslog.sock" dev="tmpfs" ino=44542 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=1
...

type=AVC msg=audit(1680656378.276:185214): avc:  denied  { net_raw } for  pid=3195599 comm="teamdctl" capability=13  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(1680656378.276:185214): avc:  denied  { create } for  pid=3195599 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=AVC msg=audit(1680656378.276:185215): avc:  denied  { ioctl } for  pid=3195599 comm="teamdctl" path="socket:[230657242]" dev="sockfs" ino=230657242 ioctlcmd=0x8933 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:insights_client_t:s0 tclass=packet_socket permissive=1
type=AVC msg=audit(1680656378.285:185216): avc:  denied  { write } for  pid=3195599 comm="teamdctl" name="team0.sock" dev="tmpfs" ino=93399 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:NetworkManager_var_run_t:s0 tclass=sock_file permissive=1
~~~

Version-Release number of selected component (if applicable):
selinux-policy-3.14.3-117.el8.noarch                        
selinux-policy-targeted-3.14.3-117.el8.noarch               

How reproducible:
Always

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


Actual results:
AVC denials for python3 and teamdctl

Expected results:
Insights-client should run without any avc denials


Additional info:

Comment 9 Zdenek Pytela 2023-04-27 13:48:12 UTC
(In reply to Nikhil Gupta from comment #0)
> Description of problem:
> SELinux AVC denials:
> ~~~
> type=AVC msg=audit(1680656450.138:202643): avc:  denied  { sendto } for 
> pid=3164511 comm="python3" path="/run/awx-rsyslog/rsyslog.sock"
> scontext=system_u:system_r:insights_client_t:s0
> tcontext=system_u:system_r:unconfined_service_t:s0 tclass=unix_dgram_socket
> permissive=1
> type=AVC msg=audit(1680656450.138:202643): avc:  denied  { write } for 
> pid=3164511 comm="python3" name="rsyslog.sock" dev="tmpfs" ino=44542
> scontext=system_u:system_r:insights_client_t:s0
> tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=1
> type=AVC msg=audit(1680656467.027:202956): avc:  denied  { sendto } for 
> pid=3164921 comm="python3" path="/run/awx-rsyslog/rsyslog.sock"
> scontext=system_u:system_r:insights_client_t:s0
> tcontext=system_u:system_r:unconfined_service_t:s0 tclass=unix_dgram_socket
> permissive=1
> type=AVC msg=audit(1680656467.027:202956): avc:  denied  { write } for 
> pid=3164921 comm="python3" name="rsyslog.sock" dev="tmpfs" ino=44542
> scontext=system_u:system_r:insights_client_t:s0
> tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=1
> type=AVC msg=audit(1680656474.534:202985): avc:  denied  { sendto } for 
> pid=3165049 comm="python3" path="/run/awx-rsyslog/rsyslog.sock"
> scontext=system_u:system_r:insights_client_t:s0
> tcontext=system_u:system_r:unconfined_service_t:s0 tclass=unix_dgram_socket
> permissive=1
> type=AVC msg=audit(1680656474.534:202985): avc:  denied  { write } for 
> pid=3165049 comm="python3" name="rsyslog.sock" dev="tmpfs" ino=44542
> scontext=system_u:system_r:insights_client_t:s0
> tcontext=system_u:object_r:var_run_t:s0 tclass=sock_file permissive=1
> ...
I'd like to point to the fact these permissions are a result of custom rsyslog settings and are not addressed. A local SELinux module and/or fcontext settings are required.

> type=AVC msg=audit(1680656378.276:185214): avc:  denied  { net_raw } for 
> pid=3195599 comm="teamdctl" capability=13 
> 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(1680656378.276:185214): avc:  denied  { create } for 
> pid=3195599 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=AVC msg=audit(1680656378.276:185215): avc:  denied  { ioctl } for 
> pid=3195599 comm="teamdctl" path="socket:[230657242]" dev="sockfs"
> ino=230657242 ioctlcmd=0x8933
> scontext=system_u:system_r:insights_client_t:s0
> tcontext=system_u:system_r:insights_client_t:s0 tclass=packet_socket
> permissive=1
> type=AVC msg=audit(1680656378.285:185216): avc:  denied  { write } for 
> pid=3195599 comm="teamdctl" name="team0.sock" dev="tmpfs" ino=93399
> scontext=system_u:system_r:insights_client_t:s0
> tcontext=system_u:object_r:NetworkManager_var_run_t:s0 tclass=sock_file
> permissive=1
These permissions are addressed by the latest build.

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