Why do I receive AVC denial as SELinux is preventing /usr/bin/gpg from execute access on the file /usr/bin/gpg?
Issue
- Facing below
SELinux AVC Denialwhenrepo_gpgcheckis enabled.
SELinux is preventing /usr/bin/python3.9 from execute access on the file /usr/bin/gpg.
***** Plugin catchall (100. confidence) suggests **************************
If you believe that python3.9 should be allowed execute access on the gpg file 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 'rhsmcertd-worke' --raw | audit2allow -M my-rhsmcertdworke
# semodule -X 300 -i my-rhsmcertdworke.pp
Additional Information:
Source Context system_u:system_r:rhsmcertd_t:s0
Target Context system_u:object_r:gpg_exec_t:s0
Target Objects /usr/bin/gpg [ file ]
Source rhsmcertd-worke
Source Path /usr/bin/python3.9
Port <Unknown>
Host server
Source RPM Packages python3-3.9.14-1.el9_1.1.x86_64
Target RPM Packages gnupg2-2.3.3-2.el9_0.x86_64
SELinux Policy RPM selinux-policy-targeted-34.1.43-1.el9.noarch
Local Policy RPM selinux-policy-targeted-34.1.43-1.el9.noarch
Selinux Enabled True
Policy Type targeted
Enforcing Mode Enforcing
Host Name server
Platform Linux server
5.14.0-162.6.1.el9_1.x86_64 #1 SMP PREEMPT_DYNAMIC
Fri Sep 30 07:36:03 EDT 2022 x86_64 x86_64
Alert Count 1
First Seen 2022-12-27 14:46:11 CET
Last Seen 2022-12-27 14:46:11 CET
Local ID cd6905d2-c593-4a12-bfe1-27e465faede8
Raw Audit Messages
type=AVC msg=audit(1672148771.909:262): avc: denied { execute } for pid=2492 comm="rhsmcertd-worke" name="gpg" dev="sdb" ino=1972996 scontext=system_u:system_r:rhsmcertd_t:s0 tcontext=system_u:object_r:gpg_exec_t:s0 tclass=file permissive=0
Environment
- Red Hat Enterprise Linux 8
- Red Hat Enterprise Linux 9
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.