| ]

Tunnel Groups

Tunnel groups were introduced in version 7 of the appliance and are unique to Cisco appliances—Cisco routers and concentrators don’t support this type of functionality. Tunnel groups are used to identify information that should be used for a particular VPN type and peer, like an IPSec L2L connection or an IPSec or WebVPN remote access group of users.

Tunnel groups have two basic attributes:

  • General

  • VPN-specific

General attributes are non-VPN-specific and can specify things like the AAA servers to use, where the policies are stored (local to the appliance or on an AAA server), where to find the usernames and passwords to authenticate remote access users, and other information. VPN-specific attributes define properties for the tunnel group that are specific to a particular VPN type, like a pre-shared key or digital certificate to use for an IPSec L2L connection, the use of Dead Peer Detection (DPD) for IPSec connections, or what the home page looks like for clientless WebVPN sessions.

The following sections will introduce you to tunnel groups: how to create them, and how general and VPN-specific properties are associated with tunnel groups. Subsequent chapters in Part IV will discuss tunnel groups in much more depth, covering the commands and parameters that apply to a particular VPN type.

Tunnel Group Creation

A tunnel group, as I mentioned in the last section, represents a particular IPSec L2L connection or a remote access group. To create a tunnel group, use the following command:

ciscoasa(config)# tunnel-group tunnel_group_ID type vpn_type

The tunnel_group_ID uniquely identifies the tunnel group. For example, if the identity for L2L connections were “address,” then the tunnel group ID would be the IP address of the peer; if the identity type were “hostname,” then the group ID would be the fully qualified domain name of the peer. For IPSec and WebVPN remote access users, the tunnel group ID represents the name of the group, like “sales”, “engineers”, or “programmers”.

Following the tunnel group ID is the type of VPN that represents the group. In version 8, you can specify only two parameters:

  • ipsec-l2l The “l2l” part is really “L-2-L,” not “one-two-one”: this represents IPSec site-to-site or L2L connections.

  • remote-access This represents IPSec and WebVPN remote access user groupings.


Note

In prior appliance versions, instead of remote-access, you had ipsec-ra and webvpn-ra, where these two VPN types were represented by different groups. In version 8, these are no longer supported (they’ve been deprecated): both types are represented by the remote-access type.

General Tunnel Group Attributes

As I mentioned previously in the introduction to tunnel groups section, general tunnel group attributes are parameters associated with a tunnel group that have no bearing on the type of VPN that is being used. For example, if you had a remote access tunnel group called “engineers,” general properties for the group would include whether an AAA server was used, where the user accounts were located for user authentication, and where the VPN-specific attributes of the group were found.

Once you’ve created your tunnel group, you can assign the general attributes to the tunnel group with the following configuration:

ciscoasa(config)# tunnel-group tunnel_group_ID general-attributes
ciscoasa(config-tunnel-general)# ?
group_policy configuration commands:
accounting-server-group Enter name of the accounting server
group
address-pool Enter a list of address pools to assign
addresses from
annotation Specify annotation text - to be used by
ASDM only
authentication-server-group Enter name of the authentication server
group
authorization-dn-attributes The DN of the peer certificate used as
username for authorization
authorization-required Require users to authorize successfully
in order to connect
authorization-server-group Enter name of the authorization server
group
default-group-policy Enter name of the default group policy
dhcp-server Enter IP address or name of the DHCP
server
exit Exit from tunnel-group general attribute
configuration mode
help Help for tunnel group configuration
commands
ipv6-address-pool Enter a list of IPv6 address pools to
assign addresses from
no Remove an attribute value pair
override-account-disable Override account disabled from AAA
server
password-management Enable password management
strip-group Enable strip-group processing
strip-realm Enable strip-realm processing

Notice that you are taken into a subcommand mode where you can configure your general attributes. I’ll be discussing these attributes in subsequent chapters of Part IV.

Add a note here VPN-Specific Tunnel Group Attributes

Add a note hereOnce you’ve created your tunnel group, to associate VPN-specific attributes to it, use the following command:

Add a note hereciscoasa(config)# tunnel-group tunnel_group_ID
{ipsec-attributes | webvpn-attributes}
ciscoasa(config-tunnel-{ipsec|webvpn})#

Add a note hereYou have two options for the type of attributes, depending on the type of tunnel group: IPSec attributes or WebVPN attributes. You’ll be taken into a subcommand mode where you can specify the VPN-specific attributes. I’ll be discussing these attributes in subsequent chapters of Part IV.


Certificate Authorities

Add a note hereCertificates are the most scalable solution to perform device authentication with VPNs. Certificates must be created by a neutral third-party, called a certificate authority (CA). The appliances support many CAs, including RSA, VeriSign, Netscape, Baltimore, Microsoft, Entrust, Cisco IOS routers, and the security appliances themselves (not discussed in this book). The remainder of this chapter will introduce the use of certificates, how to obtain certificates for appliances, and how to use certificates to authenticate devices for IPSec sessions.

Add a note here Introducing Certificates

Add a note here There are two types of certificates: root and identity. Every device participating in the certificate process must have a certificate, including the CA itself. The certificate for the CA is called a root certificate, and certificates for other devices are called identity certificates. Obtaining an identity certificate can be done either out-of-band using the file-based approach or in-band using the Simple Certificate Enrollment Protocol (SCEP), which uses HTTP.

Add a note hereTo use certificates, the peers must have an ISAKMP Phase 1 policy that supports certificates (RSA signatures). During authentication, two items are checked, and a third is optional. For the two required items, the peers validate the digital signature on the certificate and then make sure the certificate hasn’t expired. With the third item, an option exists for checking if a peer certificate has been revoked: the use of Certificate Revocation Lists (CRLs) or Online Certificate Status Protocol (OCSP) is supported. A CRL contains a list of all the certificates that have been revoked. CRLs can be downloaded when they are needed, which can be bandwidth-intensive and introduce delay in the VPN setup process, or they can be downloaded periodically and cached, which can create problems of not having the most up-to-date list when authenticating a peer. OCSP, on the other hand, has the device perform a query, with the remote peer serial number on the identity certificate, to the OCSP server in order to determine if the certificate has been revoked. Using OCSP is the preferred method.

Add a note here Obtaining Certificates

Add a note hereThe following sections will discuss how to obtain the root certificate of the CA and how to generate the certificate information, defined by the Public Key Cryptography Standards (PKCS) #10 standard, which the CA needs to create an identity certificate for the appliance.

Identity Information on the Certificate

Add a note hereWhen generating your PKCS #10 certificate information, by default the appliance associates a common name (CN) of the appliance hostname and domain name configured on the appliance. You can override this behavior and assign your own key label when generating the key pair, as you’ll see in the “Basic Trustpoint Configuration” section.

Add a note hereTo assign a name and domain name to your appliance, use the following configuration:

Add a note hereciscoasa(config)# hostname name_of_your_appliance
ciscoasa(config)# domain-name your_appliance's_domain_name

Add a note hereThese commands were discussed in Chapter 3.

Key Pairs

Add a note hereCisco supports both the RSA and DSA algorithms for generating public/private keys; these are used to sign the PKCS #10 information. DSA is quicker in generating its keys, but is less secure; and not all CA products support DSA. Because of these limitations, this book only focuses on the use of RSA keys.

Add a note here Generating RSA keys was discussed in Chapter 3; however, then I didn’t discuss all the options available with the command. Here’s the full syntax of the command:

Add a note hereciscoasa(config)# crypto key generate rsa [usage-keys | general-keys]
[label key_pair_label] [modulus key_size]
[noconfirm]

Add a note hereThe usage-keys parameter generates two sets of keys, while the general-keys parameter generates one key pair; the default is general-keys if you omit it, which is what you need for certificate purposes. Use usage-keys if you need two identity certificates from the same CA, which is uncommon. If you don’t specify a label for the key pair, it defaults to “Default-RSA-Key.” If you don’t specify a modulus (the size of the keys, in bits), it defaults to 1024: other valid sizes include 512, 768, and 2048. The noconfirm parameter, when configured, will execute the command without any interaction on your part—the default is to prompt you for verification. Use the show crypto key mypub key command to view the public keys on your appliance.


Tip

Add a note hereYou might want more than one RSA key pair. SSH uses the default key pair label; but you might want to use a different key pair (with a different modulus) for certificates.

Add a note hereHere’s an example of generating an RSA key pair:

Add a note hereciscoasa(config)# crypto key generate rsa label mykeys
INFO: The name for the keys will be: mykeys
Keypair generation process
ciscoasa(config)#

Add a note hereIn this example, a key pair label of “mykeys” is used to name the key pair.


Note

Add a note hereIf the RSA key pair already exists, you are prompted to overwrite the existing key pair. Also, to delete an RSA key pair, use the crypto key zeroize rsa [label key_pair_label] command.

Date and Time

Add a note hereItems validated on the certificate are two dates: when the certificate becomes valid and when it is no longer valid. The device will compare its local date and time with the dates and times that appear on the certificate, ensuring that the device time falls between the two periods. You can hard-code the date and time on the appliance with the clock set command:

Add a note hereciscoasa# clock set hh:mm:ss {month day | day month} year

Add a note hereThis is the same command used on Cisco IOS devices.


Note

Add a note here I recommend using NTP to synchronize the time on your devices. The appliances support NTP, which I discuss in Chapter 26.

Basic Trustpoint Configuration

Add a note hereThe CA, commonly called a trustpoint, configuration on the appliance defines the properties used to interact with a CA as well as to obtain certificates—root and identity. You must configure the trustpoint properties on the appliance before you can obtain the two certificates. This section will discuss some basic trustpoint configuration commands, and subsequent sections will cover how to obtain certificates and CRLs (Certificate Revocation Lists).

Add a note hereHere are the basic trustpoint configuration commands:

Add a note hereciscoasa(config)# crypto ca trustpoint trustpoint_name
ciscoasa(config-ca-trustpoint)# subject-name X.500_info
ciscoasa(config-ca-trustpoint)# email email_address
ciscoasa(config-ca-trustpoint)# fqdn fully_qualified_domain_name
ciscoasa(config-ca-trustpoint)# ip-address IP_address
ciscoasa(config-ca-trustpoint)# serial-number
ciscoasa(config-ca-trustpoint)# keypair key_pair_label
ciscoasa(config-ca-trustpoint)# keysize {512 | 768 | 1024 | 2048}
ciscoasa(config-ca-trustpoint)# id-usage ssl-ipsec
ciscoasa(config-ca-trustpoint)# client-types {ipsec | ssl}
ciscoasa(config-ca-trustpoint)# accept-subordinates

Add a note hereSetting up a trustpoint is similar to how it’s done on a Cisco IOS router. First, you specify the name of the trustpoint, which takes you into a subcommand mode. The name of the CA is a locally significant name and doesn’t have to match the actual name of the server unless specified by the administrator of the CA.


Note

Add a note hereWith Cisco IOS routers and Microsoft servers as CAs, I’ve never had to match up the names of the servers with the name in the crypt ca trustpoint command.

Add a note hereOptionally you can specify the X.500 information that will appear on the requested X.509v3 identity certificate with the subject-name command. If you don’t configure this value, the common name (CN) defaults to the fully qualified domain name (FQDN) of the appliance. If you want to change it, you have to know the field values to use for the certificate information. Here’s an example:

Add a note hereciscoasa(config-ca-trustpoint)# subject-name
cn=asa1.cisco.com,ou=mydepartment,o=cisco

Add a note hereIn this example, the identity name on the certificate is “asa1.cisco.com”, the organizational unit (OU) or department value is “mydepartment”, and the organizational value (O) is “cisco”.

Add a note here Optionally you can have the CA include an e-mail address in the Subject Alternative Name (SAN) extension field of the certificate with the email command; however, this is not required. Instead of an e-mail address, you can include an FQDN of your choice in the SAN field with the fqdn command. The last two options you have for information that appears on the certificate are to include an IP address (associated with the appliance) with the ip-address command and/or the appliance serial number with the serial-number command.

Add a note hereThe key-pair command specifies either an existing key-pair label to use or the name of one that will be created. The key-size command specifies the length of the keys to create when they don’t exist. These two commands, when used together, will generate a new key pair when obtaining an identity certificate versus using an existing key pair on the appliance.

Add a note hereThe id-usage command specifies how the identity certificate associated with the trustpoint can be used. With the ssl-ipsec parameter, the identity certificate can be used for SSL VPN and IPSec VPN authentication when the appliance is acting as the server/gateway, which is the default behavior. You can disable this by prefacing the command with the no parameter. The client-type command controls what type of VPN remote clients the certificate can be used for. There is no default value.

Add a note hereThe accept-subordinates command specifies whether subordinate CA certificates (in a CA hierarchical implementation) are accepted by a peer during ISAKMP/IKE Phase 1 authentication when the local appliance currently doesn’t have these certificates installed. The default is that this command is enabled.


Note

Add a note hereAll of the commands discussed in this section are optional.

Network Enrollment—SCEP

Add a note hereThere are two methods to obtain the CA (root) certificate and the appliance identity certificate:

  • Add a note hereNetwork enrollment using the Simple Certificate Enrollment Protocol (SCEP)

  • Add a note hereFile enrollment using an out-of-band approach

Add a note hereThis section will discuss the former, and the next section will discuss the latter.


Note

Add a note hereNetwork enrollment is most commonly used in environments where you are setting up your own CA. SCEP uses HTTP to access certificate information on the CA. File enrollment is most commonly used in environments where you are either using a public CA, like VeriSign, or an external CA from a different company. Of the two, I much prefer the former, since network enrollment is easier and much quicker at deploying certificates on a larger number of devices.

Configuring SCEP Enrollment Parameters

Add a note here To configure network enrollment using SCEP, the following commands (and possibly the commands discussed in the last section) are used:

Add a note hereciscoasa(config)# crypto ca trustpoint trustpoint_name
ciscoasa(config-ca-trustpoint)# enrollment url URL
ciscoasa(config-ca-trustpoint)# password challenge_password
ciscoasa(config-ca-trustpoint)# enrollment retry count #_of_attempts
ciscoasa(config-ca-trustpoint)# enrollment retry period #_of_minutes

Add a note hereYou have to first define the name of the trustpoint, which was discussed in the last section. This takes you into the trustpoint subcommand mode. You then specify how you’ll obtain a certificate: the enrollment url command specifies the use of SCEP. The URL is HTTP-based, and the actual syntax depends on the CA product you’ll interface with. Here’s an example using a Microsoft CA:

Add a note hereciscoasa(config)# crypto ca trustpoint caserver
ciscoasa(config-ca-trustpoint)# enrollment url
http://172.26.26.151:80/certsrv/mscep/mscep.dll

Note

Add a note hereWhen using a Cisco IOS router as a CA, your local ASA needs to use this URL: http://IP_address_of_Cisco_IOS_router.

Add a note hereThe password command specifies the challenge password to use during the certificate request process. The password is hashed with the certificate information, which is validated by the CA using the same password. If you are using challenge passwords, which I highly recommend, the CA administrator will have to create one for you. Depending on the administrator’s setup of the CA, the password might be time-sensitive (only valid for a specific amount of time).

Add a note hereThe enrollment retry count specifies a maximum number of permitted retries for SCEP enrollment before giving up. The enrollment retry period command specifies a retry period, in minutes, between SCEP enrollment requests when the CA is unreachable.


Note

Add a note hereOf the four trustpoint commands just listed, only the enrollment url command is required for SCEP.

Obtaining Certificates Using SCEP

Add a note hereOnce you have specified your CA and your enrollment command(s), you need to first download the CA root certificate and validate it with the crypto ca authenticate command:

Add a note hereciscoasa(config)# crypto ca authenticate trustpoint_name

Add a note here When you get the fingerprint back from the CA on the root certificate—this is the self-signed signature the CA placed on its own certificate—verify the fingerprint by calling the CA administrator and manually comparing the two values. This is the only part of the certificate process that is susceptible to a man-in-the-middle attack.

Add a note hereHere’s an example of obtaining the CA root certificate:

Add a note hereciscoasa(config)# crypto ca authenticate caserver
INFO: Certificate has the following attributes:
Fingerprint: 3736ffc2 243ecf05 0c40f2fa 26820675
Do you accept this certificate? [yes/no]: yes
Trustpoint 'caserver' is a subordinate CA and holds a non self signed
cert.
Trustpoint CA certificate accepted.

Add a note hereMake sure you validate the fingerprint/signature that is on the root certificate, since this certificate is used to validate any other certificate associated with this CA.

Add a note hereOnce you have the root certificate, you can obtain your identity certificate with the following command:

Add a note hereciscoasa(config)# crypto ca enroll trustpoint_name

ciscoasa(config)# crypto ca enroll caserver
% Start certificate enrollment ..
% Create a challenge password. You will need to verbally provide this
% password to the CA Administrator in order to revoke your certificate.
% For security reasons your password will not be saved in the
% configuration.
% Please make a note of it.
Password: abc123
Re-enter password: abc123
% The subject name in the certificate will be: asa.example.com
% The fully-qualified domain name in the certificate will be:
securityappliance.example.com
% Include the device serial number in the subject name? [yes/no]: no
Request certificate from CA [yes/no]: yes
% Certificate request sent to Certificate authority.
The certificate has been granted by CA!

Add a note hereAs you can see in the preceding example, you are prompted for a challenge password—you must enter something here even if the CA is not using challenge passwords. You have the option of including the serial number of the appliance on the certificate, and then the appliance requests the certificate.

File Enrollment—Manual

Add a note here Once you have configured the basic trustpoint commands from the “Basic Trustpoint Configuration” section, you can use the enrollment terminal command in the trust-point subcommand mode to enable the file-based approach to obtain certificates:

Add a note hereciscoasa(config)# crypto ca trustpoint trustpoint_name
ciscoasa(config-ca-trustpoint)# enrollment terminal

Add a note hereThe enrollment terminal command enables file-based enrollment.

Add a note hereOnce you have configured the trustpoint, you can then generate your PKCS #10 certificate information for the CA with the crypto ca enroll command, discussed in the last section. Here’s an example:

Add a note hereciscoasa(config)# crypto ca enroll caserver
% Start certificate enrollment ..
% The fully-qualified domain name in the certificate will be: asa5505-1
% Include the device serial number in the subject name? [yes/no]: no
Display Certificate Request to terminal? [yes/no]: yes
Certificate Request follows:
MIIBjTCB9wIBADAaMRgwFgYJKoZIhvcNAQkCFglhc2E1NTA1LTEwgZ8wDQYJKoZI
hvcNAQEBBQADgY0AMIGJAoGBAK04Czj3ZY9GJ1o4m5wDWdYwvGOSbrlgRp782k8H
<--output omitted-->
---End - This line not part of the certificate request---
Redisplay enrollment request? [yes/no]: no

Add a note hereMake sure the certificate information between the “Certificate Request follows” and “--End - This line” lines is included—copy and paste this into a file, and give the file to the CA administrator.

Add a note hereThe CA administrator will then use this information to create an identity certificate for the appliance. The administrator will then send back two files: one contains the root certificate, and one contains the identity certificate. You’ll need to load these onto the appliance in the listed order.

Add a note hereUse the crypto ca authenticate command to import the CA root certificate. Here’s an example:

Add a note hereciscoasa(config)# crypto ca authenticate caserver
Enter the base 64 encoded CA certificate.
End with a blank line or the word "quit" on a line by itself
<--paste in the CA's root certificate-->
quit
INFO: Certificate has the following attributes:
Fingerprint: 24b81433 409b3fd5 e5431699 8d490d34
Do you accept this certificate? [yes/no]: yes
Trustpoint CA certificate accepted.
% Certificate successfully imported
ciscoasa(config)#

Add a note here You need to type the word quit upon entering the CA certificate information—this must be on a separate, blank line. Then you must accept the root certificate.

Add a note hereOnce you have manually imported the root certificate, you can then import the appliance identity certificate with the crypto ca import command. Here’s an example:

Add a note hereciscoasa(config)# crypto ca import caserver certificate
% The fully-qualified domain name in the certificate will be:
ciscoasa.cisco.com
Enter the base 64 encoded certificate.
End with a blank line or the word "quit" on a line by itself
<--paste in your certificate-->
quit
INFO: Certificate successfully imported

Note

Add a note hereTo properly import the root and identity certificates, the appliances must receive the certificates in a PEM (privacy enhanced mail) format.

Certificate Revocation Lists

Add a note hereA Certificate Revocation List (CRL) is a list of certificate serial numbers that have been revoked by the CA. Certificates can be revoked because they have expired, the device associated with a certificate has become compromised, the device is no longer being used, or a change in the security policy requires new certificates (like requiring longer key lengths).

Add a note hereThe use of CRLs is controlled by the following trustpoint configuration:

Add a note hereciscoasa(config)# crypto ca trustpoint trustpoint_name
ciscoasa(config-ca-trustpoint)# revocation-check crl [none]
ciscoasa(config-ca-trustpoint)# revocation-check ocsp [none]
ciscoasa(config-ca-trustpoint)# revocation-check none

Add a note hereThe revocation-check command specifies how and if CRLs are used. The crl parameter specifies that a CRL is downloaded using HTTP, SCEP, or LDAP from a specified location and cached locally; adding the none parameter specifies that if the CRL cannot be found, then it is not used (CRLs are optional). The ocsp specifies that the Online Certificate Status Protocol (OCSP) is used instead of CRLs to determine if a certificate has been revoked; adding the none parameter specifies that if the OCSP server cannot be found, then it is not used (OCSP is optional). The none parameter, by itself, specifies that CRLs and OCSP are not used during device authentication.


Note

Add a note hereIf when using CRLs or OCSP you don’t add the optional none parameter, and the CRL or OSCP server cannot be accessed, authentication of the peer device will fail.

CRL Usage

Add a note here When using CRLs to determine if a certificate has been revoked, the appliance will periodically download and cache the CRL list. To tune this process, you can use the following configuration:

Add a note hereciscoasa(config)# crypto ca trustpoint trustpoint_name
ciscoasa(config-ca-trustpoint)# crl configure
ciscoasa(config-ca-crl)# policy {cdp | static | both}
ciscoasa(config-ca-crl)# url number URL
ciscoasa(config-ca-crl)# protocol {http | ldap | scep}
ciscoasa(config-ca-crl)# cache-time minutes
ciscoasa(config-ca-crl)# enforcenextupdate
ciscoasa(config-ca-crl)# ldap-defaults server_name_or_IP [port_#]
ciscoasa(config-ca-crl)# ldap-dn directory_path password

Add a note hereTo configure parameters for CRL usage, in the trustpoint configuration execute the crl configure command—this will take you into a second subcommand mode. The policy command specifies where to find the CRL list. The cdp parameter, which is the default, specifies that the CRL location will be found by examining the CA root or an RA (Registration Authority) identity certificate. The static parameter specifies that you will configure a static entry or entries on the appliance as to where to find the CRL. The both parameter specifies that the appliance will attempt to use the location on the CA/RA certificate to find the CRL, but if this is unsuccessful, then a static entry on the appliance will be used.

Add a note hereTo configure a static entry, use the url command. The number following the command ranks the entry in the order that it should be used. You can create up to five entries, where the number ranges from 1 to 5. Following the number is the actual URL, like “http://172.26.26.151/crldir/caserver.crl”. The protocol command specifies the protocol that will be used to retrieve and process the CRL list. All three protocols are allowed by default; you can use the no parameter to disable a particular protocol if necessary. The cache-time command specifies how long the CRL list is cached locally on the appliance before the CRL list is downloaded again. The default is 60 minutes and can be as large as 1440 minutes. The enforcenextupdate command specifies that the “NextUpdate” field in the CRL must not have expired in order for the CRL itself to be considered valid. By default this is enabled; to disable it, preface the command with the no parameter.

Add a note hereIf the CRL is located on an LDAP server and the appliance needs to use the LDAP protocol to access it, you’ll have to define how the appliance should interface with the LDAP server. The ldap-defaults command specifies the LDAP server the CRL is located on. You can either specify the name or IP address of the server; with the former, you must be able to dynamically or statically resolve this to an IP address. If you don’t configure an LDAP port number, it defaults to 389. If the LDAP server requires authentication to access the CRL, use the ldap-dn command to specify the login credentials. The directory path is basically the X.500 information to access the CRL. Here’s a simple example: cn=crl, ou=certs, o=caserver, c=US. This field cannot exceed 128 characters. The directory path is then followed by the LDAP password, which also cannot exceed 128 characters.

OCSP Usage

Add a note here There are a couple of problems with CRLs. First, the list can be quite long and must be downloaded and stored locally on a device, which can take up space like RAM, flash, or disk space. Second, once the CRL is downloaded, if certificates are revoked by the CA, a device with a cached CRL won’t know this until its cache timer expires and the updated CRL is downloaded—so there is a chance that a revoked certificate would appear as valid to some devices in the network.

Add a note hereOCSP was created to solve these two problems. Instead of downloading a long list and caching the information, OCSP uses a query process: when a device needs to determine if a certificate has or hasn’t been revoked, it sends a query to an OCSP server, which responds with the status of the queried serial number. If you have a large installed base of devices using certificates, OCSP scales much better than using CRLs.

Add a note hereTo use OCSP, implement the following configuration:

Add a note hereciscoasa(config)# crypto ca trustpoint trustpoint_name
ciscoasa(config-ca-trustpoint)# revocation-check ocsp [none]
ciscoasa(config-ca-trustpoint)# ocsp url URL
ciscoasa(config-ca-trustpoint)# match certificate map_name
override ocsp [trustpoint trustpoint_name]
sequence_num url URL
ciscoasa(config-ca-trustpoint)# ocsp disable-nonce

Add a note hereThe revocation-check command was discussed earlier in the section. The oscp url command specifies how the appliance should contact the OCSP server. HTTP is the protocol used, so an example URL might look like this: “http://172.26.26.151”. If you need to validate certain certificates using a different OCSP server, you can create a certificate map, which matches on one or more certificates, and associate this with the appropriate OCSP server (certificate maps and matching are discussed later in the “Certificate Group Matching” section).

Add a note hereOCSP requests sent by a device to the OCSP server include a nonce extension (basically a signature). The OCSP server should use this information in crafting its response, also creating a nonce extension—basically the nonce extension is used to bind the request and response in order to defeat replay attacks. However, some OCSP server implementations don’t dynamically create the nonce extension; instead, they use a pre-generated response. In this situation, the appliance would see the response as invalid, reject it, and thus authentication of a peer certificate would fail. To disable the use of the nonce extension, use the ocsp disable-nonce command.

Certificate Management

Add a note hereThe following sections will discuss how to manage certificates on your appliance: how to save them, how to view them, and how to troubleshoot problems with them.

Saving Certificates

Add a note herePrior to version 7.0, the ca save all command was used to save certificate and keying information on the PIXs. Starting in version 7.0, this command was deprecated. Now to save the certificate and keying information on the appliances, just use the write memory command.

Viewing Certificates

Add a note here To view the certificates (root and identity) on your appliance, use the following command:

Add a note hereciscoasa# show crypto ca certificates [trustpoint_name]

Add a note hereHere’s an example of viewing a certificate:

Add a note hereciscoasa(config)# show crypto ca certificates
CA Certificate
Status: Available
Certificate Serial Number 2957A3FF296EF854FD0D6732FE25123
Certificate Usage: Signature
Issuer:
CN = caserver
OU = rootou
O = dealgroup
L = oviedo
ST - florida
C = US
EA = admin@dealgroup.com
Subject:
CN = caserver
OU = rootou
O = dealgroup
<--output omitted-->

Add a note hereNotice that the certificate has a serial number at the top, which was assigned by the CA. Below this is who issued the certificate (Issuer section) and whom the certificate is for (Subject section). In the preceding example, the Issuer and Subject information is the same, meaning that this is the certificate of the CA.

Troubleshooting Certificate Problems

Add a note hereOne of the most common problems of obtaining and using certificates involves the date and time. When validating a certificate, two things are required, and a third thing is optional. The first two things are comparing the device current time with the beginning and ending time on the certificate (if the device current time falls between these two, then the first authentication step passes), and validating the signature on the certificate. Optionally the device can check to see if the certificate has been revoked by using CRLs or OCSP.

Add a note hereSince the date and time are important in validating certificates, I highly recommend that you don’t statically define the date and time, but use the Network Time Protocol (NTP) to make sure your CA and devices acquiring and using certificates are in synch with each other. The configuration of NTP on the appliances is discussed in Chapter 26.

Add a note hereTo troubleshoot all other problems related to obtaining and/or using certificates, use the following command:

Add a note hereciscoasa# debug crypto ca [messages | transactions] [level_#]

Add a note here The messages parameter displays only debug messages for PKI input and output messages. The transactions parameter displays debug messages for PKI transactions. Not specifying either will include both in the debug output. Optionally you can include a level number in the debug command, which qualifies the amount of output displayed. This can range from 1 to 255. Level 1, the default, displays error messages; level 2 displays warnings; level 3 displays informational messages; and level 4 and higher display additional troubleshooting information.

Add a note here Using Certificates

Add a note hereThe following sections will discuss how to use certificates on your appliance—specifically, how you specify which identity certificate, when more than one is on the appliance, should be used for a particular peer.

Tunnel Groups and Certificates

Add a note hereTunnel groups were briefly introduced earlier in the “Tunnel Groups” section. Their use will be discussed in much more depth in Chapters 16 and 17. This section will discuss how certificates are used with tunnel groups.

Add a note hereOnce you have created a tunnel group, to associate a certificate to it for IPSec VPNs, you must go into the tunnel group IPSec attributes:

ciscoasa(config)# tunnel-group peer_IP_addr ipsec-attributes
ciscoasa(config-tunnel-ipsec)# peer-id-validate {cert | nocheck | req}
ciscoasa(config-tunnel-ipsec)# pre-shared-key key
ciscoasa(config-tunnel-ipsec)# trust-point trustpoint_name

Add a note hereThe peer-ip-validate command specifies the use of certificates. The cert parameter specifies that certificates will be used if both peers have certificates and if during the ISAKMP Phase 1 policy negotiation they agreed that certificates should be used. The nocheck parameter specifies that certificates will not be used (pre-shared keys will be used instead with the pre-shared-key command). The req parameter specifies that certificates must be used with the remote peer, or a tunnel won’t be built. The default setting for this command is req, unless you configure a pre-shared key.

Add a note hereThe trust-point command specifies the name of the trustpoint (and the corresponding identity certificate) that should be used with the remote peer. If you only have one CA the appliance is using, then this command isn’t necessary: the appliance will use the single root and identity certificates that it has. However, if you have more than one CA, and thus more than one identity certificate on your appliance, you’ll have to tell the appliance which set of certificates should be used with which remote peer by configuring the trust-point command.

Certificate Group Matching

Add a note hereWhen your appliance is an Easy VPN server for IPSec VPNs (see Chapter 17) and remote access devices are using certificates for authentication, the appliances assume that the OU (Organizational Unit, sometimes called the Department) field contains the name of the tunnel group the user should be associated with. In turn, this tunnel group name tells the appliance which policies should be associated with the connecting user. If this is incorrect, you’ll need to create certificate matching rules to correctly match up the user to the correct tunnel group.

Add a note hereBy default the OU field is used in the certificate to match a user to a tunnel group. Therefore, I highly recommend that when users request their certificates, you make sure they configure their tunnel group name correctly (which is case-sensitive!) in their certificate request—otherwise you’ll either have to have them reperform the request with the correct group name, or create a certificate matching rule to match the certificate to the correct group.

Add a note hereYou can override the default lookup method with the tunnel-group-map command:

Add a note hereciscoasa(config)# tunnel-group-map enable {ou | peer-ip | rules}

Add a note hereThe ou parameter in the first command specifies that the OU field should be used (this is the default). The peer-ip parameter specifies that the IP address of the peer should be used. And the rules parameter indicates that the rules in the crypto ca certificate map command should be used—this command is discussed next.

Add a note hereThe crypto ca certificate map command creates a single certificate matching rule, where you must specify a rule number from 1 to 65535:

Add a note hereciscoasa(config)# crypto ca certificate map map_name rule_#
ciscoasa(config-ca-cert-map)# subject-name attr ser eq serial_#
ciscoasa(config-ca-cert-map)# subject-name attr cn eq common_name

Add a note hereThis command takes you into a subcommand mode where you specify the attributes on the peer identity certificate to match on. You can match on any field within the certificate; however, the two most common ones are the serial number (which is unique within a CA domain) and/or the common name (the name of the user or device). You can match on other fields, but I’ve only listed the two I mentioned earlier; of these two, the most common one to match on is the serial number on the certificate.

Add a note hereThe tunnel-group-map command associates the matching rule with the group this user or users should belong to:

Add a note hereciscoasa(config)# tunnel-group-map default-group tunnel_group_name
ciscoasa(config)# tunnel-group-map map_name rule_# tunnel_group_name

Add a note hereThe default-group parameter specifies what group a user should be associated with if it cannot be determined what tunnel group the user should be in. The default group is set to DefaultRAGroup. The second tunnel-group-map command allows you to match a particular certificate matching rule to a particular tunnel group.

Add a note hereHere’s a simple example that places a certificate with a common name of “Richard Deal” in the tunnel group called “engineers”:

Add a note hereciscoasa(config)# crypto ca certificate map mymap 1
ciscoasa(config-ca-cert-map)# subject-name attr cn eq Richard Deal
ciscoasa(config)# tunnel-group-map mymap 1 engineers

Note

Add a note here Normally I prefer the former method for matching users to groups. I typically use certificate matching rules when users move from one group to another because of a change in their job function—instead of creating a new certificate with the correct group name in the OU field, I’ll use certificate matching rules to correctly associate the users to their new tunnel group.