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 1087932 - [RFE] Add certmonger rekey command
Summary: [RFE] Add certmonger rekey command
Keywords:
Status: CLOSED DEFERRED
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: certmonger
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Rob Crittenden
QA Contact: Kaleem
URL:
Whiteboard:
Depends On: 1249165
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-04-15 15:34 UTC by Martin Kosek
Modified: 2019-03-13 20:08 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-03-13 20:08:30 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Martin Kosek 2014-04-15 15:34:25 UTC
Description of problem:

When dealing with issues like the Heartbleed CVE (Bug 1084875), it would be beneficial to have a certmonger command to rekey a certificate, e.g. "ipa-getcert rekey -i 12345678".

Existing resubmit command is not helpful as it just renews existing certificate while preserving the key.

Comment 2 Rob Crittenden 2014-04-17 15:09:21 UTC
Given the ability to re-key, it may be a good idea to set a new configuration option for the number of renewals before re-keying. This probably needs to be more complex than an integer to reflect different validity periods, so perhaps a formula like n renewals in y years, then re-key.

Other than any variations in how the request is sent to the CA, I'm not sure that any other new policies around this forced re-key is required. We'd still want to revoke the old key.

This should apply only to server certificates, not signing certificates.

Comment 3 Nalin Dahyabhai 2015-04-14 18:00:38 UTC
(In reply to Rob Crittenden from comment #2)
> Given the ability to re-key, it may be a good idea to set a new
> configuration option for the number of renewals before re-keying. This
> probably needs to be more complex than an integer to reflect different
> validity periods, so perhaps a formula like n renewals in y years, then
> re-key.
> 
> Other than any variations in how the request is sent to the CA, I'm not sure
> that any other new policies around this forced re-key is required. We'd
> still want to revoke the old key.
> 
> This should apply only to server certificates, not signing certificates.

For an IPA-issued service certificate (specifically, a caIPAServerCert), what's the downside of always rekeying?

I'm getting the feeling that any scheme for deciding when to rekey, and when not to, that can't be expressed very simply, is going to make it harder for people to verify that they got the desired outcome.  Obviously we'd need to make it something that can be manually triggered, but beyond that I'm having some trouble coming up with a reasonable way to cover cases with both very long and very short lifetimes.

When you refer to signing certificates, do you mean CA subsystem certificates, or something else?  In the general case, I think certificates that can be used to sign things other than certificates can be replaced with certificates using different keys without trouble.  It's the ones where the private key can be used for encrypting data that complicate things, because I think we want to keep those old keys around, and if certificates are short-lived, rekeying often can start using up disk.

Comment 4 Rob Crittenden 2015-04-14 19:03:56 UTC
I'm not aware of a best practice for re-keying SSL server certs, though it should probably be some number between always and never. I think functionally re-kaying would have little to no impact on the servers themselves except perhaps key size and type (e.g. RSA vs ECC).

I was thinking object signing certs above. I think the trick would be whether you revoke the old cert when you re-key, something generally done, but that invalidates anything signed by the previous key if checking is done.

As for re-keying periods, I can definitely foresee a disconnect between cert profile validity periods and rekeying policies, e.g. a server cert is good for 2 years but re-keying policy says it must be done annually. Whether that's a problem we want to/can solve I don't know. Perhaps sanity can be enforced when policy is created. 

I'm not sure what Fraser has in mind in terms of exposing the policy/profile. I imagine there will be an API call that certmonger can make to get the period. I suppose expressing re-keying in terms of months of validity would be fine-grained enough, and if you store the date a key is generated then it should be relatively "easy" to know whether a re-key is required. I'd imagine there could be a magic value, -1, 0, or some huge value, to say never re-key.

Comment 5 Nalin Dahyabhai 2015-05-12 18:30:32 UTC
Going forward, we'll be able to interpret a new helper exit status as indicating that we need to try again with a new key in the signing request, and we'll be tracking the date when we generated a key and the number of times we've saved issued certificates to disk that used the current key pair.

I think if we add configuration file options for maximum preferred age and key use counts, we can automate the process of having the client initiate rekey attempts.  I'm a bit leery of cases where we ask for a rekey, and either due to server or helper configuration or behavior we end up getting a certificate that includes the public key that we wanted to replace, because we won't have much recourse when that happens.

Comment 6 Nalin Dahyabhai 2015-05-19 18:02:09 UTC
If IPA has a reply code (somewhere in the 4300 range?) that it can supply when the server determines that the client needs to try again with a new key pair, we can also catch that in ipa-submit and exit with status 16 to pass that information back to the daemon, which will trigger a rekey at the client.

Comment 7 Nalin Dahyabhai 2015-05-19 18:03:09 UTC
Er, 17, that is.


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