Bug 2207819

Summary: In selinux-policy-3.14.3-117.el8, AVC denials frequently occur in commands executed via insights-client
Product: Red Hat Enterprise Linux 8 Reporter: kyoneyama <kyoneyam>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.8CC: amepatil, apeetham, lvrabec, mmalik
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.14.3-122.el8 Doc Type: Bug Fix
Doc Text:
Permissions for insights-client added to the SELinux policy Cause: The insights-client service requires permissions which were not in the previous selinux-policy versions. Consequence: As a consequence, some components of insights-client did not work correctly and reported access vector cache (AVC) error messages. Fix: This update adds new permissions to the SELinux policy. Result: As a result, insights-client runs correctly without reporting AVC errors. Resolves: 2185158 2207819 2214572 2225233 2229559
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-11-14 15:47:52 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 kyoneyama 2023-05-17 02:28:21 UTC
Description of problem:

AVC denials frequently occur in commands executed via insights-client.

Many of the denials were fixed in selinux-policy-3.14.3-117.el8, it seems to have occurred again in a package that was omitted from the issue.

(No.1)
----
time->Tue May 16 22:05:43 2023
node=localhost.localdomain type=PROCTITLE msg=audit(1684242343.535:129535): proctitle=2F62696E2F66777570646167656E74006765742D64657669636573
node=localhost.localdomain type=MMAP msg=audit(1684242343.535:129535): fd=6 flags=0x1
node=localhost.localdomain type=SYSCALL msg=audit(1684242343.535:129535): arch=c000003e syscall=9 success=yes exit=140366906810368 a0=0 a1=1 a2=1 a3=1 items=0 ppid=197183 pid=197184 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="fwupdagent" exe="/usr/bin/fwupdmgr" subj=system_u:system_r:insights_client_t:s0 key=(null)
node=localhost.localdomain type=AVC msg=audit(1684242343.535:129535): avc:  denied  { map } for  pid=197184 comm="fwupdagent" path="/root/.cache/dconf/user" dev="dm-0" ino=68328424 scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:object_r:cache_home_t:s0 tclass=file permissive=1
----

No.2
----
time->Tue May 16 22:06:18 2023
node=localhost.localdomain type=PROCTITLE msg=audit(1684242378.741:129550): proctitle=2F7573722F62696E2F646F746E6574002D2D76657273696F6E
node=localhost.localdomain type=SYSCALL msg=audit(1684242378.741:129550): arch=c000003e syscall=124 success=yes exit=196781 a0=3030b a1=564f5cc6f9c0 a2=4 a3=3 items=0 ppid=197386 pid=197387 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm="dotnet" exe="/usr/lib64/dotnet/dotnet" subj=system_u:system_r:insights_client_t:s0 key=(null)
node=localhost.localdomain type=AVC msg=audit(1684242378.741:129550): avc:  denied  { getsession } for  pid=197387 comm="dotnet" scontext=system_u:system_r:insights_client_t:s0 tcontext=system_u:system_r:insights_client_t:s0 tclass=process permissive=1
----


Version-Release number of selected component (if applicable):

- Red Hat Enterprise Linux 8.8
- insights-client-3.1.7-12.el8
- selinux-policy-3.14.3-117.el8
- dotnet
- fwupd

How reproducible:

Always

Steps to Reproduce:

1. Install relevent packages:
  # yum install insights-client 
  # yum install dotnet fwupd

2. Register a host:
  # insights-client --register

3. Start insights-client service immediately:
  # systemctl start insights-client.service

4. See messages and audit.log
  # grep setroubleshoot /var/log/messages
  # ausearch -ts recent -m AVC

Comment 1 Zdenek Pytela 2023-05-17 06:21:33 UTC
rhel89# rpm -q selinux-policy
selinux-policy-3.14.3-120.el8.noarch

rhel89# sesearch -A -s insights_client_t -t cache_home_t -c file
allow domain file_type:file map; [ domain_can_mmap_files ]:True
allow insights_client_t cache_home_t:file { append create getattr ioctl link lock open read rename setattr unlink write };
allow insights_client_t file_type:file getattr;
allow insights_client_t non_security_file_type:file { getattr ioctl lock open read };
^^ map perm is missing

rhel89# sesearch -A -s insights_client_t -t insights_client_t -c process
allow insights_client_t domain:process { getattr signal signull };
allow insights_client_t insights_client_t:process { fork getattr getcap getsched setfscreate setpgid setrlimit setsched sigchld sigkill signal signull sigstop };
^^ no getsession
**getsession** - Get session ID of another process.

Comment 4 Milos Malik 2023-05-17 08:51:43 UTC
Similar issue is reproducible on RHEL-9 and is already filed as BZ#2207894.

Comment 10 Nikola Knazekova 2023-06-15 16:09:56 UTC
*** Bug 2214572 has been marked as a duplicate of this bug. ***

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