CA_certificate_renewal#
Overview#
Allow automated and manual renewal of IPA CA certificate. Provide an utility for manual renewal, including modification of chaining (self-signed vs. signed by external CA). Store multiple CA certificates in LDAP and distribute them to clients.
This page describes phase 1 of the CA certificate management feature, which consists of automated and manual CA certificate renewal, CA certificate management utility and storage of multiple CA certificate in LDAP. Visit V4/CA certificate renewal (2) for description of phase 2, which consists of distribution of CA certificates to IPA clients.
Use Cases#
Automated CA certificate renewal#
When the CA certificate is nearing its expiration time, it should be automatically renewed. The renewed certificate will use the same keypair and subject name as the old certificate.
This only works for self-signed CA certificates in CA-ful installs.
Manual CA certificate renewal#
Allow admin to manually renew the CA certificate and possibly change its chaining (self-signed → signed by external CA, signed by external CA → self-signed, signed by external CA → signed by other external CA) (phase 1) and have the renewed certificate automatically distributed to all systems in the domain (phase 2). The renewed certificate will use the same keypair and subject name as the old certificate.
This works for any CA certificate in CA-ful installs.
Manual install of CA certificate#
In CA-less installs, CA certificate renewal is completely in charge of a 3rd party CA. Provide means of installing CA certificates obtained from such a CA (phase 1) and automatically distribute them to all systems in the domain (phase 2).
Design#
Automatic renewal of IPA CA certificate#
The CA certificate managed by Dogtag will be tracked by certmonger. If the certificate is self-signed, it will be automatically renewed. If the certificate is signed by an external CA, the renewal attempt will fail with an error, advising the administrator to renew the certificate manually. The error is syslogged with ALERT severity.
CA certificate management utility#
There will be new utility to manage CA certificates,
ipa-cacert-manage
. It will have several subcommands:
renewoptions
This command will be available only for CA-ful installs and will be used to renew the IPA CA certificate. The certificate can be renewed either as self-signed or signed by an external CA. By default, the chaining used for the old certificate is used for the new certificate as well. Renewing a CA certificate signed by an external CA is a 2 step operation: in the first step, a CSR is exported to
/var/lib/ipa/ca.csr
; in the second step, the signed certificate is installed. The available options are:--self-signed
Renew the CA certificate as self-signed.
--external-ca
Renew the CA certificate as signed by an external CA, step 1: Export CSR to
/var/lib/ipa/ca.csr
.
--external-cert-filefile
Renew the CA certificate as signed by an external CA, step 2: Install the new CA certificate.
--passwordpassword
Directory manager password. Required for external CA renewal step 2.
installoptions``*\ \ *``file
Install CA certificate from a PEM file. The available options are:
-nnickname``*, ``--nicknamenickname
Nickname for the certificate.
-tflags``*, ``--trust-flagsflags
Trust flags for the certificate in NSS / certutil format.
Client certificate update utility#
There will be new utility, ipa-certupdate
, for updating CA
certificates on clients with up-to-date data from LDAP. Until phase
2 is complete, running it manually will be the only way to update the
CA certificates after installation.
Implementation#
In CA-ful installs, CA certificate renewal is handled by certmonger.
Automatic renewal is handled by certmonger itself. In manual renewal,
ipa-cacert-manage
resubmits the certmonger request for the CA
certificate. If the CA certificate is self-signed, the request is
submitted directly to Dogtag. If the CA certificate is signed by an
external CA, ipa-cacert-manage
exports the CSR created by certmonger
to /var/lib/ipa/ca.csr
in the first step. In the seconds step, it
updates cn=ca_renewal,cn=ipa,cn=etc,suffix
so that the new
CA certificate can be picked up by certmonger and resubmits the
certmonger request. In the post-save command of the certmonger request,
the renewed CA certificate is added to
cn=certificates,cn=ipa,cn=etc,suffix
.
When installing new CA certificate manually, ipa-cacert-manage
adds
the certificate directly to
cn=certificates,cn=ipa,cn=etc,suffix
.
When a CA certificate is renewed, its previous version is not removed to allow rollover.
Feature Management#
UI
N/A
CLI
See design.
Installers#
N/A
Upgrade#
Old clients will look for IPA CA certificate in
cn=CAcert,cn=ipa,cn=etc,suffix
. A copy of the most recent
IPA CA certificate needs to be maintained in this entry for
compatibility with old clients.
Old servers do not have
cn=certificates,cn=ipa,cn=etc,suffix``*. Client installer has
to look for CA certificates both in this entry and in
``cn=CAcert,cn=ipa,cn=etc,suffix
for compatibility with old
servers.
How to Test#
Automated CA certificate renewal#
Install IPA server with CA (either self-signed or signed by external CA)
Get the expiration date of the IPA CA certificate:
# getcert list -d /etc/pki/pki-tomcat/alias -n 'caSigningCert cert-pki-ca'
Move system time 3 weeks before the expiration date
Check the status of the certmonger request:
# getcert list -d /etc/pki/pki-tomcat/alias -n 'caSigningCert cert-pki-ca'
If the IPA CA was installed self-signed:
Wait for the certmonger request to complete, it should end up with MONITORING status
Check that the renewed CA certificate was added to the LDAP certificate store and to the
/etc/pki/pki-tomcat/alias
NSS database
If the IPA CA was installed signed by external CA:
Wait for the certmonger request to complete, it should end up with CA_WORKING status
Check that an error was syslogged with ALERT severity
Manual CA certificate renewal#
Install IPA server with CA (either self-signed or signed by external CA)
To renew the IPA CA certificate as self-signed:
Run
ipa-cacert-manage renew
, if the IPA CA was not installed self-signed, add the--self-signed
optionWait for the command to complete
Check that the renewed CA certificate was added to the LDAP certificate store and to the
/etc/pki/pki-tomcat/alias
NSS database
To renew the IPA CA certificate as signed by external CA:
Run
ipa-cacert-manage renew
, if the IPA CA was not installed signed by external CA, add the--external-ca
optionThe command will produce a CSR file at
/var/lib/ipa/ca.csr
Sign the CSR file with the external CA to get the renewed CA certificate
Run
ipa-cacert-manage renew
, specify the renewed CA certificate and external CA certificate chain files in the--external-cert-file
optionWait for the command to complete
Check that the renewed CA certificate and the external CA certificate were added to the LDAP certificate store and to the
/etc/pki/pki-tomcat/alias
NSS database
Manual install of CA certificate#
Install IPA server
Run
ipa-cacert-manage install
to install the CA certificateCheck that the certificate was added to the LDAP certificate store
Manual update of local CA certificate files#
Install IPA server(s) and possibly client(s)
Renew or install CA certificate(s)
Run
ipa-certupdate
on either a server or a clientCheck that the
/etc/ipa/nssdb
and/etc/pki/nssdb
NSS databases and the/etc/ipa/ca.crt
file were updated with CA certificates from the LDAP certificate storeIf on a server, additionaly check that the
/etc/dirsrv/slapd-REALM
and/etc/httpd/alias
NSS databases and the/usr/share/ipa/html/ca.crt
file were updated as wellIf on a server with a CA, additionaly check that the
/etc/pki/pki-tomcat/alias
NSS database was updated as well
Test Plan#
TODO