Certificate Expiration and Renewal
Would you like to continue with this enrollment? yes/no: yes% Start certificate enrollment.% The fully-qualified domain name in the certificate will be: ciscoasa% Include the device serial number in the subject name? yes/no: yes% The serial number in the certificate will be: 123456789AB Display Certificate Request to terminal? SCEP, which is the only supported enrollment protocol, supports two client authentication mechanisms—manual and preshared key. Manual enrollment requires the administrator at the certification authority (CA) server to specifically authorize the enrollment requests; enrollment using preshared keys allows the administrator to preauthorize.
Certificates have a fixed lifetime. Eventually, both the root's certificate and the spoke's certificate expire. When a certificate expires, widespread connectivity issues might result so that in large scale VPN solutions, authentication in IKE would fail and connectivity could not be established. To prevent this type of failure, two mechanisms should be deployed for certificate renewal: auto-enrollment and rollover for end spokes and servers.
Auto-Enrollment
When a certificate on an end device is going to expire, auto-enrollment obtains a new certificate without disruption. By configuring auto-enrollment, the end host can request a new certificate at X time before its local certificate expires. This feature is used with SCEP, and together this provides an automated mechanism for enrollment requests prior to end node certificate expiration.
In Example 3-8, a spoke is configured to request a new certificate at 50 percent of the life time expiration, or 15 minutes into its assigned 30-minute lifetime. In the show crypto pki certificate output, notice the renew date is exactly 50 percent between the start date and end date (15 minutes).
Example 3-8. Auto-Enrollment Example with show Command
The certificate authority has the option to grant requests manually or use grant auto, which is a feature that automatically grants certificate requests. This raises a classic problem in network security: availability versus security. Using grant auto makes the entire granting process more highly available and easier. However, grant auto on the CA makes it easy for any device to request and get a certificate.
Grant auto should be used with great care. Some circumstances where it might be all right are in closed systems, such as staging areas. Another situation would be in which policy controls are in place, such as a firewall, which enables only specific end hosts to access the CA, and only during windows when auto-enrollment requests occur. Also, the feature grant auto trustpoint xxx will only auto-grant requests signed by trustpoint xxx. Normally, xxx is the server trustpoint. Renewal requests are signed by the existing certificate. In that way, only renewal requests from clients with a valid certificate from your CA will be auto-granted.
Example 3-9. Grant Auto to Facilitate Auto-Enrollment
Rollover
When a certificate on the CA server is going to expire, rollover enables the root CA to obtain a new certificate without disruption. By configuring rollover, the CA can generate a new certificate at X time before its local certificate expires. The new certificate, which is called the shadow certificate, becomes active at the precise moment the current CA certificate expires.
Notice in Example 3-10, the end date of the current certificate is exactly the same as the start date of the rollover shadow certificate.
Example 3-10. Rollover Example on the Root CA
In this post we'll go over enrolling Cisco IOS routers for certificates using terminal.Generate keys
r1(config)#crypto key generate rsa general-keys modulus 1024
To view generated keys:
r1#sh crypto key mypubkey rsa
Cisco Manual Certificate Enrollment Certificate
% Key pair was generated at: 16:46:47 GMT Mar 29 2013
Key name: r1.securesenses.net
Usage: General Purpose Key
Key is not exportable.
Key Data:
--- omitted---
% Key pair was generated at: 13:46:55 GMT Mar 30 2013
Key name: r1.securesenses.net.server
Usage: Encryption Key
Key is not exportable.
Key Data:
--- omitted---
Import Root CA cert
In order to enrol a router for certificate we need to install the whole trust chain - certifcates of all CA's starting with root CA up to the CA that will issue our certificate. Since we are using terminal enrolment we need certificates in text format so that we can paste them in. For that we will use PEM - 'Privacy Enhanced Mail' - standard. We can recognize PEM format from using
---BEGIN CERTFICATE--- and ---END CERTIFICATE---- headers and trailers. Between them the certificate is actually represented using Distinguished Encoding Rules - DER - encoding.
Convert CRT to PEM
Windows Certificate MMC does not allow for saving certificates in PEM format. We will need to convert the .CRT to .PEM. OpenSSL library is what we will use.
At command prompt:
openssl x509 -in ROOT-CA.crt -inform der -out ROOT-CA.pem -outform pem