Cisco Manual Certificate Enrollment



Certificate Expiration and Renewal

  1. Cisco Manual Certificate Enrollment Certificate
  2. Cisco Manual Certificate Enrollment Form

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
Cisco Manual Certificate Enrollment

Firstly we need to generate key pair that we'll then use to create Certificate Signing Request (CSR) that will include our public key. Here we need to decide on the key length. Security wise - the longer the better. It's never that simple though. To this day there are applications that simply do not support anything longer than 2048. This should be taken into consideration. Do we need anything longer than that? We'd have to consider the threat vector. Longer key makes factorization harder. To my knowledge as of writing 1024 bit keys have not been factored. It would take very long time and a lot of very advanced infrastructure to do. This is not a valid threat for most organizations. Key length should be considered in terms of certificate lifetime. The longer the validity the longer they. There also is the CPU overhead we need to take into account. Yes, nowadays CPUs are fast. However, if we consider a large scale deployment with 100s of certificates and for example DMVPNs, using 1024 bit keys vs 2048 can mean significantly more VPNs on single box.
For the purpose of my lab I'm using 1024 bit 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



R1(ca-trustpoint)#enrollment terminal PEM
R1(ca-trustpoint)#exit
Import the CA root certificate with copy and paste.
r1(config)#crypto ca authenticate ORCA1-CA
Enter the base 64 encoded CA certificate.
End with a blank line or the word 'quit' on a line by itself
-----BEGIN CERTIFICATE-----

Fingerprint MD5: E9FD8A22 E82C13EF 5DB781A7 616AD113
Fingerprint SHA1: 6085A54F 1A6A67B1 7F8DC1A9 54F995AD

Trustpoint CA certificate accepted.

Confirm that hash matches the hash in the .CRT encoded cert we started with.


We repeat above steps in order to install Subordinate CA certififcate. This is required so that we can validate full certificate chain.
Cisco Manual Certificate Enrollment

Certificate validated - Signed by existing trustpoint CA certificate.
Trustpoint CA certificate accepted.

Verify certificates have been installed and associated to trustpoints:
CA Certificate
Certificate Serial Number: 4D00000002924DEC093140270B000000000002
Issuer:
Subject:
dc=kp
CRL Distribution Points:
Validity Date:
end date: 13:54:58 GMT Mar 14 2014

Status: Available

Cisco Manual Certificate Enrollment Form

Certificate Serial Number: 37A15821A55DD2864B62A67B6EFD5429
Issuer:
Subject:
Validity Date:
end date: 16:13:12 GMT Mar 13 2023


% Start certificate enrollment ..
% The subject name in the certificate will include: r1.securesenses.net
% Include the router serial number in the subject name? [yes/no]: yes
% The serial number in the certificate will be: FF1045C5
% Include an IP address in the subject name? [no]: no
Display Certificate Request to terminal? [yes/no]: yes

-----END CERTIFICATE REQUEST-----
---End - This line is not part of the certificate request---
Redisplay enrolment request? [yes/no]: no
Copy everything between ---- BEGIN C..---- and ----END C..---- inclusive to a text file and save as .csr. Make sure you use a notepad so that no additional encoding is added.


The request does not contain template information. Therefore we have supply in the request. For that we need to use certreq.exe utility.
C:> certreq -submit -attrib CertificateTemplate:RouterCert .r1.req r1.pem
Alternately we can omit the output file name and use GUI to save to CRT or CER format which we then convert to PEM using the following command:
openssl x509 -in r1.cer -out r1.pem -outform PEM



End with a blank line or the word 'quit' on a line by itself
------BEGIN CERTIFICATE-----

% Router Certificate successfully imported


Certificate
Certificate Serial Number: 6D00000017F99CF9DB55D020E5000000000017
Issuer:
dc=kp
Subject:
Serial Number: FF1045C5
serialNumber=FF1045C5
http://dc1.kp.local/pki/IssuingCA-DC1.crl
start date: 00:03:38 GMT Apr 1 2013
Associated Trustpoints: SubCa


http://www.cisco.com/en/US/products/hw/modules/ps2706/products_configuration_example09186a008037d1c8.shtml