Bug 2122197

Summary: AVC denials noticed for gunicorn process after upgrading the Satellite 6.11 OS from RHEL 7 to RHEL 8 using leapp
Product: Red Hat Satellite Reporter: Odilon Sousa <osousa>
Component: SELinuxAssignee: Lukas Zapletal <lzap>
Status: CLOSED ERRATA QA Contact: Lukas Pramuk <lpramuk>
Severity: high Docs Contact:
Priority: high    
Version: 6.11.0CC: ahumbe, brant.evans, ehelms, lzap, parmstro, pmendezh, zhunting
Target Milestone: 6.11.3Keywords: Triaged, Upgrades
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: pulpcore-selinux-1.3.2 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2111570 Environment:
Last Closed: 2022-09-28 16:28:48 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 2 Lukas Pramuk 2022-09-13 12:08:21 UTC
VERIFIED.

@Satellite 6.11.3 Snap1
pulpcore-selinux-1.3.2-1.el8pc.x86_64

by the following manual reproducer:

1) LEAPP upgrade Satellite 6.11.3 using internal repos
# sed -i 's/_RHEL7/_RHEL8/g' /etc/yum.repos.d/satellite.repo
# leapp upgrade --reboot --enablerepo Sat6-CI_Red_Hat_Satellite_6_11_Composes_Satellite_6_11_RHEL8 --enablerepo Sat6-CI_Satellite_6_11_Composes_Satellite_Maintenance_6_11_RHEL8

2) Perform LEAPP post-upgrade tasks namely switch back to enforcing selinux
# setenforce 1

3) Restart pulpcore-api service
# satellite-maintain service restart --only pulpcore-api

4) Check new avc denials for "gunicorn"
# grep avc /var/log/audit/audit.log | tail -2

REPRO:
type=AVC msg=audit(1663069326.287:210): avc:  denied  { read } for  pid=9290 comm="gunicorn" scontext=system_u:system_r:pulpcore_server_t:s0 tcontext=system_u:system_r:pulpcore_t:s0 tclass=key permissive=1
type=AVC msg=audit(1663069326.287:211): avc:  denied  { view } for  pid=9290 comm="gunicorn" scontext=system_u:system_r:pulpcore_server_t:s0 tcontext=system_u:system_r:pulpcore_t:s0 tclass=key permissive=1

vs.

FIX:
<empty>

>>> there are no "gunicorn" selinux denials every service restart

Note:
there are still some "gunicorn" selinux denials in the log but these were produced during LEAPP upgrade process, after LEAPP upgrade finishes things settle down

Yet there are these denials as services *during* LEAPP upgrade are temporarily starting unconfined (-> pulpcore_t)
type=AVC msg=audit(1663068460.808:210): avc:  denied  { read } for  pid=9710 comm="pulpcore-worker" scontext=system_u:system_r:pulpcore_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=key permissive=1
type=AVC msg=audit(1663068460.809:211): avc:  denied  { view } for  pid=9710 comm="pulpcore-worker" scontext=system_u:system_r:pulpcore_t:s0 tcontext=system_u:system_r:unconfined_service_t:s0 tclass=key permissive=1

Comment 7 errata-xmlrpc 2022-09-28 16:28:48 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 (Satellite 6.11.3 Async Bug Fix 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-2022:6743