Bug 2124292

Summary: A lot of AVC selinux denials when insights client is executed with obfuscation enabled
Product: Red Hat Enterprise Linux 9 Reporter: Pavol Kotvan <pakotvan>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: high Docs Contact:
Priority: high    
Version: 9.1CC: gchamoul, lvrabec, mmalik
Target Milestone: rcKeywords: Triaged
Target Release: 9.2   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of:
: 2124357 (view as bug list) Environment:
Last Closed: 2023-05-09 08:16:32 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:
Bug Depends On:    
Bug Blocks: 2124357    

Comment 2 Milos Malik 2022-09-05 14:31:24 UTC
attached audit.log processed by audit2allow:

#============= insights_client_t ==============
allow insights_client_t insights_client_tmp_t:dir relabelfrom;
allow insights_client_t insights_client_tmp_t:file relabelfrom;

Comment 4 Zdenek Pytela 2022-09-05 15:25:33 UTC
Pavol, Maria,

Can you retest with the following local selinux module?

rhel91# cat local_insights.cil
(allow insights_client_t insights_client_tmp_t (dir (relabelfrom relabelto)))
(allow insights_client_t insights_client_tmp_t (file (relabelfrom relabelto)))
(allow insights_client_t rhsmcertd_config_t (dir (write add_name)))
(allow insights_client_t rhsmcertd_config_t (file (create)))
(allow insights_client_t rpm_t (process (signal)))
(allow journalctl_t rhcd_t (fifo_file (read)))
(typetransition rhcd_t var_log_t file "hawkey.log" rpm_log_t)

rhel91# semodule -i local_insights.cil

Comment 7 Zdenek Pytela 2022-09-05 17:16:59 UTC
I keep getting different denials. Can you now try a different set?

chcon -t rpm_exec_t /usr/libexec/rhc/rhc-package-manager-worker
semodule -r local_insights
cat local_insights2.cil
(allow rhcd_t rpm_t (unix_stream_socket (connectto)))
(allow rhcd_t rpm_t (process (sigkill)))
(allow journalctl_t rhcd_t (fifo_file (read)))
(allow rhcd_t security_t (file (map)))
(allow rhcd_t self (netlink_audit_socket (nlmsg_write nlmsg_read create ioctl read getattr lock write setattr append bind connect getopt setopt shutdown)))

semodule -i local_insights2.cil

Comment 18 errata-xmlrpc 2023-05-09 08:16:32 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:2483