Certificate Verification and Enforcement
Certificates expire. Network administrators might simply wait for a certificate to expire or use another method to remove a certificate. For example, if a router is stolen, there needs to be a way to revoke its certificate so that it can no longer participate in the network. In the case of IPsec deployments, for example, a revoked certificate would result in failure during IKE.
There are three significant approaches that use certificates. The first approach uses certificate revocation lists (CRL), which are periodically downloaded to a router and thus require lower overhead. The second approach uses OCSP, which provides real-time updates and makes a network call for each certificate that is presented. The third approach uses an AAA server and certificates together, which involves the end user performing authentication. The differences in these approaches are outlined in Table 3-1.
Table 3-1. Certificate Verification Approaches
Advantages |
Disadvantages |
|
CRL |
Low network profile, CRL server supported in IOS |
Periodic, hours can pass between the time revocation occurs and CRL update takes effect. If lists grow long, processing time becomes a problem. |
OCSP |
Real-time revocations |
Server feature is not available in IOS. IOS CA is not supported with OCSP. Only client checking is supported. |
AAA |
Real-time authorization enforcement and optional granular authorization controls |
Specific certificate credentials must be entered into the AAA server. Depending on the selection criteria, this could be labor-intensive for an administrator. |
Certificate Revocation Lists
Certificate revocation lists (CRL) enable devices to determine if a certificate has been revoked prior to expiration. A certificate revocation list is composed of the certificate's serial number (issued by the granting authority) and the date of revocation.
The CRL database is located on an external server (recommended) or on the CA. The CA will, by default, store the CRL locally. If the recommended practice of housing the CRL on an external server is used, the command database url crl points to the location where the CRL database file is stored. This is configured under cs-server sub configuration mode.
The location of the database file and where end devices or users go to access the CRL might be the same. The location can also be different (see Figure 3-1 for an example CRL stored on Windows). As a recommended practice, housing the CRL for retrieval for end devices should be in a different location than the database file actively used by the CA. This insures that end users do not have access to the source CRL database file that might pose a security risk. The command to configure the location to direct end devices and users to retrieve the CRL information is the cdp-url command, which is also configured in cs-server sub configuration mode. The cdp url information is given to certificate users as part of the certificate they receive. Consequently, the decision regarding the url for end user retrieval of the CRL needs to be made before certificates are issued.
Figure 3-1 A CRL Stored in Windows
CRLs also have a lifetime. At a given time a CRL will expire and is valid only for an interval. When the interval is complete, a new CRL is downloaded by IOS via http. The CRL is then cached locally on the router. Consequently CRLs are not in real time. A certificate is revoked and then that information is propagated at a periodic interval.
There are two significant drawbacks to using CRLs in some environments. The first drawback is that CRLs are downloaded periodically, which means that a revoked certificate can still be authenticated before a new CRL is downloaded. The second drawback involves scalability of CRLs. If CRLs are deployed, the choice to revoke a certificate should be done with great care (that is, not add entries for administration or testing purposes). The lookup routers do against the CRL when verifying a peers certificate is linear; that is, it is line by line. As lists become longer, this takes up that much more CPU resources. Consequently, this can slow down and even timeout during IKE negotiations.
Example 3-11 shows a certificate being revoked.
Example 3-11. Revoking a Certificate
s-3845-ra-subca# crypto pki server ra-subca revoke 0x50 Writing ra-subca.crl ! % Certificate 0x50 successfully revoked.
The Crypto pki server {name} revoke {serial number} is executed on the granting certificate authority. Serial numbers are used to track certificates. After the certificate is revoked, the information will not be updated until the CRL expires, which might be many hours from the time of expiration. The CR lifetime can be changed. Example 3-12 illustrates shortening the CRL lifetime from the default of 24 hours.
Example 3-12. CRL Lifetime Configuration
3845-root-ca# Show run ... crypto pki server root-ca database archive pkcs12 password 7 843595F grant auto rollover ca-cert grant auto lifetime crl 0 10 cdp-url http://www.crl.cisco.com/ca.crl database url crl ftp://172.26.129.252
Figure 3-2 illustrates a possible design for handling CRLs.
Figure 3-2 CRL Server Architecture
As shown in the figure, the end routers would have the frontend web server's URL included in their certificates for the CRL distribution point. The frontend server can get data from the backend server's database. This can be done via ftp and crontab or other methods. The firewall can provide a separation between the vulnerable frontend server and backend database by enabling only the minimal traffic to pass between the frontend service layer and backend server in the datacenter's access layer.
Online Certificate Status Protocol
A major disadvantage of CRL checking is the timeliness of updates for end hosts. The chief advantage of Online Certificate Status Protocol (OCSP) is that it provides a real-time update to end users. OCSP's disadvantage is that it relies on third-party software. A router cannot act as an OCSP server. Also, IOS CA is not officially supported with OCSP servers at the time of this writing. OCSP as a method of revocation checking is supported for end spokes.
An OCSP server has two methods to obtain information about the validity of a certificate. It can receive periodic updates from a CA by means of a "push" from the CA, or it can periodically poll a CRL distribution point (see Figure 3-3). This approach is still periodic in nature. The periods are much smaller than with a traditional CRL approach, and simple exchanges occur between a CRL distribution point and the OCSP server.
Figure 3-3 OCSP Devices
When an end host requests the validity of a certificate, it submits a query to the OCSP server, which contains the certificate's serial number. The OCSP server can provide a response to the query with a status for that certificate. The status response can be good, unknown, or revoked. The response from the OCSP server can be used immediately and consequently does not require local storage space on the router. Example 3-13 shows how to configure OCSP in IOS.
Example 3-13. OCSP Configuration
Router(ca-trustpoint)# ocsp url http://ocspserver.cisco.com:80 Router(ca-trustpoint)# revocation-check ocsp
OCSP service can function like a "cloud" service, using a push model between the CA server and the OCSP server. Also the OCSP server can have a certificate issued by the CA to verify its identity to others who make requests.
PKI Integration with AAA
Authentication, authorization, and accounting (AAA) servers are common in enterprise infrastructures. The Cisco AAA server is Cisco Secure Access Control System (ACS). AAA integration provides a mechanism for authorization. A certificate can provide authentication; when combined with an AAA server, the AAA server can provide authorization for the end host.
Fields in the certificate (such as subject and serial number) can be passed back to a RADIUS server or TACACS server. The server can check the credentials provided to it by the authorizing router to determine if the device is authorized for network access.
The advantage of using AAA as a solution is that it enables authorization in addition to authentication. The moment an administrator decides a certificate is no longer authorized, the administrator can make the change in the AAA server, and it is immediately effective. The disadvantage of the solution is that it requires manual entry of certificate credentials and authorization in the AAA server.
The leading practice for this approach uses an ACS RADIUS server. The credentials recommended to pass back are several Cisco AV pairs. The Cisco AV pairs recommended are avpair=pki:cert-application=all, which announces this is a certificate, and cisco-avpair=pki:cert-trustpoint={trust point name}, which announces the trustpoint associated with the certificate. Lastly, user level credentials are passed back. The recommended credential is the subject name as it appears in the certificate, which is the FQDN provided to the CA by the router requesting a certificate.
The ACS server would reside local to the server performing the authorization. Often, the authorizing router can be a central or hub gateway to a central location. Cisco AV pairs that are commonly passed to a RADIUS server are cisco-avpair=pki:cert-application=all, cisco-avpair=pki:cert-trustpoint={trust point name}, and cisco-avpair=pki:cert-serial={serial number}.
Although these AV pairs are often used, the drawback is every time a new certificate is issued the serial number and potentially other information would need to be re-entered. A simpler approach would be to use the Fully Qualified Domain Name (FQDN) of the router, which would be included in the certificate. Then the only AV pair should be associated with the CA at the group level, as will be shown in the example. The AV pair associated with the CA is combined with the FQDN taken from the certificate's subject name field will provide all the credentials for authorization.
Upon disabling authorization for that router, the fully qualified domain name of that router can be removed as a user on the AAA server to deny authorization. This reduces the overall administrative overhead in keeping up with the changing fields in certificates (such as serial number). Example 3-14 illustrates how to configure a router to use AAA.
Example 3-14. Configuring the Authorizing Router for AAA Using RADIUS
aaa authentication login no-auth none aaa authorization exec dmvpn-pki group radius aaa authorization network dmvpn-pki group radius ! crypto pki trustpoint ra enrollment url http://192.168.159.243:12345 serial-number ip-address 192.168.159.242 revocation-check crl rsakeypair hub-keys auto-enroll 70 regenerate authorization list dmvpn-pki authorization username subjectname unstructuredname ! above line will not appear in show run since it is a default !
On the ACS configuration, screen captures can be found in Figure 3-4 and Figure 3-5. The PKI group is created with the appropriate AV pairs. Then a user with the FQDN is named and added to that group.
Figure 3-4 ACS AAA Server Configuration for PKI Integration
Figure 3-5 X.509 Certificate Structure