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 1996720

Summary: Service rhsmcertd is unable to create cache files in /var/cache/cloud-what
Product: Red Hat Enterprise Linux 8 Reporter: Jiri Hnidek <jhnidek>
Component: selinux-policyAssignee: Zdenek Pytela <zpytela>
Status: CLOSED DUPLICATE QA Contact: Milos Malik <mmalik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.5CC: lvrabec, mmalik, ssekidde
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-08-24 07:31:38 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 Jiri Hnidek 2021-08-23 14:22:03 UTC
Description of problem:
The service rhsmcertd.service is not able to create any cache file in /var/cache/cloud-what, because rhsmcertd.service uses code from new RPM python3-cloud-what. The python3-cloud-what package does not create cache files in /var/lib/rhsm/cache as rhsmcertd, but it has its own cache directory /var/cache/cloud-what and selinux denies rhsmcertd.service to create cache files there. It cause unnecessary HTTP requests to AWS IMDS servers. 


Version-Release number of selected component (if applicable):

[root@ip-10-0-0-158 ~]# rpm -q subscription-manager
subscription-manager-1.28.20-1.git.6.504eaaf.el8.x86_64


How reproducible:
100%


Steps to Reproduce:
1. Create AWS instance and enable only IMDSv2 in the AWS wizard.

2. Start AWS instance

3. Enable automatic registration of the system using (and optionally disable splay option to not wait for result too long):
subscription-manager config --rhsmcertd.auto_registration=1
subscription-manager config --rhsmcertd.splay=0

4. Start rhsmcertd.service
[root@ip-10-0-0-158 ~]# systemctl start rhsmcertd.service

5. Wait two-three minutes for result

6. Check /var/log/rhsm/rhsm.log


Actual results:
You can observer several warning messages with following error: Permission denied: '/var/cache/cloud-what/aws_token.json'


Expected results:
rhsmcertd.service should be able to create cache file in: /var/cache/cloud-what/


Additional info:

More details here: https://bugzilla.redhat.com/show_bug.cgi?id=1922151#c11

Latest scratch build of subscription-manager: http://brew-task-repos.usersys.redhat.com/repos/scratch/jhnidek/subscription-manager/1.29.18/1.git.41.c29535a.el8/x86_64/

PR of selinux-policy for Fedora: https://github.com/fedora-selinux/selinux-policy/pull/836

Comment 1 Zdenek Pytela 2021-08-24 07:31:38 UTC

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