Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2131987

Summary: "#insights-client --register" generates SELinux alerts
Product: Red Hat Enterprise Linux 9 Reporter: Peter Stone <fedora-topics-562353>
Component: insights-clientAssignee: Nobody <nobody>
Status: CLOSED DUPLICATE QA Contact: Nobody <nobody>
Severity: low Docs Contact:
Priority: unspecified    
Version: 9.0CC: ahitacat, cmarinea, fjansen, gchamoul, stomsa
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-10-20 12:28:58 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 Peter Stone 2022-10-04 12:09:16 UTC
Description of problem:"#insights-client --register" results in 2 SELinux denials.


Version-Release number of selected component (if applicable):
# insights-client --version
Client: 3.1.7
Core: 3.0.296-1


How reproducible: by registering the system manually.


Steps to Reproduce:
1. have a machine which is not registered by insights-client
2. as root, run "insights-client --register"

Actual results: machine not registered, insights-client exits and/or Bash crashes.

Cockpit shows "failed to start" for insights-client-results.service, with some of the last log lines being:
insights-client-results.service: Failed with result 'exit-code'.
insights-client-results.service: Main process exited, code=exited, status=1/FAILURE
PermissionError: [Errno 13] Permission denied: '/etc/insights-client/.cache.json.asc'
fd = os.open(path, flags, 0o600)
File "/etc/insights-client/rpm.egg/insights/client/collection_rules.py", line 255, in write_collection_data
self.write_collection_data(self.collection_rules_file + ".asc", sig_text)
File "/etc/insights-client/rpm.egg/insights/client/collection_rules.py", line 248, in get_collection_rules_gpg
self.get_collection_rules_gpg(json_response)

SELinux access control errors from cockpit:
1. "SELinux is preventing /usr/bin/python3.9 from write access on the directory insights-client."
2. "SELinux is preventing /usr/bin/python3.9 from write access on the file /etc/insights-client/.cache.json.asc."
"If you want to fix the label. /etc/insights-client/.cache.json.asc default label should be insights_client_etc_rw_t."


Expected results: machine registers fine.


Additional info: I'd upload an sos report, but cannot open a case with a developer subscription.

Comment 3 Gaƫl Chamoulaud 2022-10-20 12:28:58 UTC

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