Bug 2260636

Summary: SELinux is preventing pgrep from 'sys_ptrace' accesses on the cap_userns labeled spamd_update_t.
Product: [Fedora] Fedora Reporter: Loye Young <loye.young>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 39CC: dwalsh, loye.young, lvrabec, mmalik, nknazeko, omosnacek, pkoncity, vmojzis, zpytela
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:31b07b7644ca2743310fdf538577779e4688384dc8942e31de910563e67b74a3;VARIANT_ID=;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-01-29 11:50:21 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:
Attachments:
Description Flags
File: description
none
File: os_info none

Description Loye Young 2024-01-27 16:09:03 UTC
Description of problem:
pgrep is being called by spamassassin's sa-update, which fails because of this error. 
In turn, sa-update is called nightly by systemd sa-update.timer. 

You probably already know about this problem; it's been happening for months. I was too busy/lazy to check the bugzilla. If so, my apologies, and thank you for your work.
SELinux is preventing pgrep from 'sys_ptrace' accesses on the cap_userns labeled spamd_update_t.

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

If you believe that pgrep should be allowed sys_ptrace access on cap_userns labeled spamd_update_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 'pgrep' --raw | audit2allow -M my-pgrep
# semodule -X 300 -i my-pgrep.pp

Additional Information:
Source Context                system_u:system_r:spamd_update_t:s0
Target Context                system_u:system_r:spamd_update_t:s0
Target Objects                Unknown [ cap_userns ]
Source                        pgrep
Source Path                   pgrep
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
SELinux Policy RPM            selinux-policy-targeted-39.3-1.fc39.noarch
Local Policy RPM              selinux-policy-targeted-39.3-1.fc39.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 6.6.13-200.fc39.x86_64 #1 SMP
                              PREEMPT_DYNAMIC Sat Jan 20 18:03:28 UTC 2024
                              x86_64
Alert Count                   8
First Seen                    2024-01-25 00:00:02 CST
Last Seen                     2024-01-27 09:14:24 CST
Local ID                      b357b170-4ff7-4443-b7ee-a9ef658c7f9e

Raw Audit Messages
type=AVC msg=audit(1706368464.585:212): avc:  denied  { sys_ptrace } for  pid=24832 comm="pgrep" capability=19  scontext=system_u:system_r:spamd_update_t:s0 tcontext=system_u:system_r:spamd_update_t:s0 tclass=cap_userns permissive=0


Hash: pgrep,spamd_update_t,spamd_update_t,cap_userns,sys_ptrace

Version-Release number of selected component:
selinux-policy-targeted-39.3-1.fc39.noarch

Additional info:
reporter:       libreport-2.17.11
reason:         SELinux is preventing pgrep from 'sys_ptrace' accesses on the cap_userns labeled spamd_update_t.
package:        selinux-policy-targeted-39.3-1.fc39.noarch
component:      selinux-policy
hashmarkername: setroubleshoot
type:           libreport
kernel:         6.6.13-200.fc39.x86_64
component:      selinux-policy

Comment 1 Loye Young 2024-01-27 16:09:05 UTC
Created attachment 2010954 [details]
File: description

Comment 2 Loye Young 2024-01-27 16:09:06 UTC
Created attachment 2010955 [details]
File: os_info

Comment 3 Zdenek Pytela 2024-01-29 11:50:21 UTC

*** This bug has been marked as a duplicate of bug 2252484 ***