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 1328869 - Subscription manager doesn't link entitlements certs
Summary: Subscription manager doesn't link entitlements certs
Keywords:
Status: CLOSED DUPLICATE of bug 1328729
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.2
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-04-20 12:58 UTC by A.P. Rajshekhar
Modified: 2020-01-09 05:54 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-21 20:38:27 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1328729 0 high CLOSED Docker client doesn't link entitlements certs 2021-02-22 00:41:40 UTC

Internal Links: 1328729

Description A.P. Rajshekhar 2016-04-20 12:58:11 UTC
# Description of problem:

To be able to perform entitlement certificate/client certificate based authentication in Crane one needs to have following linked to
/etc/docker/certs.d/redhat.io/ and /etc/docker/certs.d/redhat.com/

* CA certificate
* entitlements certificates (from /etc/pki/entitlement/)

Entitlements certificates are not linked which blocks performing entitlement certificate/client certificate based authentication in Crane.

# Version-Release number of selected component (if applicable):
Docker version 1.8.2-el7, build a01dc02/1.8.2


# How reproducible:
100%

# Steps to Reproduce:
1. subscription-manager register / attach
2. subscription-manager repos --enable...
3. install docker
4. ls -l /etc/docker/certs.d/redhat.com/
5.  ls -l /etc/docker/certs.d/redhat.io/

# Actual results:
Only CA certificate is linked or placed in /etc/docker/certs.d/redhat.com/ and /etc/docker/certs.d/redhat.io/. The entitlement cert and key in /etc/pki/entitlement directory are not linked or placed in /etc/docker/certs.d/redhat.com/ or /etc/docker/certs.d/redhat.io/

# Expected results:
CA,  entitlement certificates, and key (entitlement cert and key are in /etc/pki/entitlement/)  are linked in /etc/docker/certs.d/redhat.com/ and /etc/docker/certs.d/redhat.io/

Comment 2 John Sefler 2016-04-20 14:26:10 UTC
There are two things to be aware of before you will see subscription-manager copy attached entitlement certs to the /etc/docker/certs.d/<registery_hostnames> directories....

1. Are the registry_hostnames that you are concerned about (redhat.com and redhat.io) included in the container_content.ContainerContentPlugin.conf configuration file?

[root@jsefler-7 ~]# cat /etc/rhsm/pluginconf.d/container_content.ContainerContentPlugin.conf 
[main]
enabled = 1
registry_hostnames = registry.access.redhat.com,cdn.redhat.com,access.redhat.com

Note: The default configuration for registry_hostnames does NOT include redhat.com and redhat.io

2. Only entitlement certs that provides "containerimage" content will get copied to the /etc/docker/certs.d/<registery_hostnames> directories.

For example...
I have the following two entitlements attached to my system....
[root@jsefler-7 ~]# ls /etc/pki/entitlement/
2867554618564241832-key.pem  2867554618564241832.pem  8620967711851798975-key.pem  8620967711851798975.pem

But only one of them (2867554618564241832) has "containerimage" content as follows...

[root@jsefler-7 ~]# rct cat-cert /etc/pki/entitlement/2867554618564241832.pem | grep containerimage
	Type: containerimage
	Type: containerimage
	Type: containerimage
	Type: containerimage
	Type: containerimage
	Type: containerimage
[root@jsefler-7 ~]# rct cat-cert /etc/pki/entitlement/8620967711851798975.pem | grep containerimage
[root@jsefler-7 ~]# 

Hence only the entitlement and key with "containerimage" content is copied to all of the <registery_hostnames> directories...

[root@jsefler-7 ~]# ls /etc/docker/certs.d/registry.access.redhat.com
2867554618564241832.cert  2867554618564241832.key
[root@jsefler-7 ~]# ls /etc/docker/certs.d/cdn.redhat.com/
2867554618564241832.cert  2867554618564241832.key  redhat-entitlement-authority.crt
[root@jsefler-7 ~]# ls /etc/docker/certs.d/access.redhat.com
2867554618564241832.cert  2867554618564241832.key
[root@jsefler-7 ~]# 
[root@jsefler-7 ~]# ls /etc/docker/certs.d/redhat.io/
redhat-ca.crt
[root@jsefler-7 ~]# ls /etc/docker/certs.d/redhat.com/
redhat-ca.crt
[root@jsefler-7 ~]# 


In conclusion, I believe subscription-manager is working as designed and you need to decide if want to add a configuration workflow that appends redhat.com and redhat.io registry_hostnames in /etc/rhsm/pluginconf.d/container_content.ContainerContentPlugin.conf.  Or do the defaults need to change in container_content.ContainerContentPlugin.conf?

Comment 3 Chris Bredesen 2016-04-20 15:39:17 UTC
John thank you, this is really helpful. In the case where we DO want the keys linked as you described, what would be the change process to make this true for all RHEL clients? Currently the RHMAP team is providing manual steps to link the certs but your way sounds more sustainable and more correct.

Comment 5 Chris Bredesen 2016-04-20 20:06:40 UTC
The mission here is to have a RHEL user acquire protected Red Hat content from our registry (registry.access.redhat.com / registry.redhat.io). A properly-entitled system can access, for example, Red Hat Mobile Application Platform (RHMAP). Container-wise, the rules should be the same. If they have an entitlement to this content, they should be able to use it from Docker as well.

Does that help clarify?

Comment 6 John Sefler 2016-04-21 14:50:19 UTC
Be careful...  In comment 0 I see that docker is now providing these two directories:
/etc/docker/certs.d/redhat.io/
/etc/docker/certs.d/redhat.com/

If the new registries are registry.access.redhat.com and registry.redhat.io as Chris states in comment 5, then I think the directory names will need to be fully qualified and appended to the registery_hostnames in /etc/rhsm/pluginconf.d/container_content.ContainerContentPlugin.conf as a fully qualified names.  Also make sure the proper CA cert is in the directories.

Comment 7 vritant 2016-04-21 20:38:27 UTC

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

Comment 8 A.P. Rajshekhar 2020-01-09 05:54:11 UTC
Commenting to resolve needifo.


Note You need to log in before you can comment on or make changes to this bug.