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 923159 - rhsmcertd update is not automatically regenerating consumer cert
Summary: rhsmcertd update is not automatically regenerating consumer cert
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: candlepin-bugs
QA Contact: John Sefler
URL:
Whiteboard:
Depends On:
Blocks: rhsm-rhel70 1231074 1425722
TreeView+ depends on / blocked
 
Reported: 2013-03-19 10:24 UTC by Shwetha Kallesh
Modified: 2017-02-23 20:18 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1231074 1425722 (view as bug list)
Environment:
Last Closed: 2014-06-13 13:22:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 827035 0 high CLOSED Teach rhsmcertd to refresh the identity certificate 2021-02-22 00:41:40 UTC

Internal Links: 827035

Description Shwetha Kallesh 2013-03-19 10:24:12 UTC
Description of problem:
rhsmcertd update is not re-generating consumer cert automatically

Version-Release number of selected component (if applicable):
[root@rhel7 ~]# subscription-manager version
server type: Red Hat Subscription Management
subscription management server: 0.8.0-1
subscription-manager: 1.8.4-1.el7
python-rhsm: 1.8.7-1.el7


How reproducible:


Steps to Reproduce:
[root@rhel7 ~]# cat /etc/rhsm/rhsm.conf | grep insecure
insecure=1


1.[root@rhel7 ~]# subscription-manager register --org=admin --force
Username: admin
Password: 
The system has been registered with id: c9bc5b4e-3938-44fc-8b04-76c48aa4a0eb 

[root@rhel7 ~]# date -s '15 year 9 month'
Tue Dec 19 10:09:14 UTC 2028

Executing 

[root@rhel7 ~]# date
Tue Dec 19 10:12:26 UTC 2028

[root@rhel7 ~]# rct cat-cert /etc/pki/consumer/cert.pem 

+-------------------------------------------+
	Identity Certificate
+-------------------------------------------+

Certificate:
	Path: /etc/pki/consumer/cert.pem
	Version: 1.0
	Serial: 5437778791775227667
	Start Date: 2013-03-19 09:39:02+00:00
	End Date: 2029-03-19 09:39:02+00:00
	Alt Name: DirName:/CN=rhel7

Subject:
	CN: c9bc5b4e-3938-44fc-8b04-76c48aa4a0eb

  
Actual results:


Expected results:


Additional info:

Comment 1 John Sefler 2014-01-17 21:05:36 UTC
Suspect an error in the test scenario.
Both the server and the client clocks need to be in sync before a consumer cert will be regenerated within the default 90 day expiry threshold.
As written in comment 0, i suspect there was a "clock skew detection" warning in rhsm.log

Please re-test.



Additional Info: these are the candlepin configurations that govern automatic  consumer cert regeneration...
# threshold in days before the expiration date for a consumer cert to be automatically regenerated during an rhsmcertd update (default is 90)
candlepin.identityCert.expiry.threshold = 90
# validity duration for a consumer cert (default is 16 years - was originally 1 year)
candlepin.identityCert.yr.addendum = 16

Comment 2 Devan Goodwin 2014-01-22 13:53:39 UTC
Moving to ON_QA given comment #1.

Comment 3 John Sefler 2014-01-31 18:54:15 UTC
Retesting with version...
[root@jsefler-7 ~]# subscription-manager version
server type: This system is currently not registered.
subscription management server: 0.9.2-1
subscription-manager: 1.10.11-2.el7
python-rhsm: 1.10.11-2.el7

[root@jsefler-7 ~]# subscription-manager register --serverurl=jsefler-f14-candlepin.usersys.redhat.com:8443/candlepin
Username: testuser1
Password: 
Organization: admin
The system has been registered with ID: 78ced260-c48a-4175-b61f-1a41cb97eb37 
[root@jsefler-7 ~]# rct cat-cert /etc/pki/consumer/cert.pem | grep Date
	Start Date: 2014-01-31 18:24:30+00:00
	End Date: 2030-01-31 18:24:30+00:00
                  ^^^^
Take note of the original vailidity dates above.
By default, a newly created consumer cert is valid for 16 years!

Now, let's fast-forward time into the future on both the candlepin server and the subscription-manager system to within 90 days before 2030-01-31 18:24:30+00:00...



[root@jsefler-7 ~]# service ntpd stop
Redirecting to /bin/systemctl stop  ntpd.service
[root@jsefler-7 ~]# date
Fri Jan 31 13:26:50 EST 2014
[root@jsefler-7 ~]# date -s '+15 year +9 month +2 day'
Thu Nov  2 14:26:58 EDT 2029

[root@jsefler-f14-candlepin ~]# service ntpd stop
Shutting down ntpd:                                        [  OK  ]
[root@jsefler-f14-candlepin ~]# date
Fri Jan 31 13:27:31 EST 2014
[root@jsefler-f14-candlepin ~]# date -s '+15 year +9 month +2 day'
Thu Nov  2 14:27:40 EDT 2029


Now let's restart rhsmcertd and wait for a hard 2 minutes for the cert deamon to check for certificate updates with the server... 

[root@jsefler-7 ~]# service rhsmcertd restart
Redirecting to /bin/systemctl restart  rhsmcertd.service
[root@jsefler-7 ~]# sleep 120
[root@jsefler-7 ~]# 


[root@jsefler-7 ~]# tail -f /var/log/rhsm/rhsmcertd.log
Fri Nov  2 14:43:21 2029 [INFO] rhsmcertd is shutting down...
Fri Nov  2 14:43:21 2029 [INFO] Starting rhsmcertd...
Fri Nov  2 14:43:21 2029 [INFO] Auto-attach interval: 1440.0 minute(s) [86400 second(s)]
Fri Nov  2 14:43:21 2029 [INFO] Cert check interval: 240.0 minute(s) [14400 second(s)]
Fri Nov  2 14:43:21 2029 [INFO] Waiting 120 second(s) [2.0 minute(s)] before running updates.
Fri Nov  2 14:45:23 2029 [INFO] (Auto-attach) Certificates updated.
Fri Nov  2 14:45:25 2029 [INFO] (Cert Check) Certificates updated.


[root@jsefler-7 ~]# subscription-manager identity 
system identity: 78ced260-c48a-4175-b61f-1a41cb97eb37
name: jsefler-7.usersys.redhat.com
org name: Admin Owner
org ID: admin
[root@jsefler-7 ~]# rct cat-cert /etc/pki/consumer/cert.pem | grep Date
	Start Date: 2029-11-02 18:45:22+00:00
	End Date: 2045-11-02 18:45:22+00:00
                  ^^^^

VERIFIED: The rhsmcertd deamon has has automatically updated the validity period for the same consumer UUID.  It is now valid for another 16 years!

Comment 5 Ludek Smid 2014-06-13 13:22:49 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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