IP Security

This chapter provides information on configuring an enhanced or extended service. The product Administration Guides provide examples and procedures for configuration of basic services on the system. It is recommended that you select the configuration example that best meets your service model, and configure the required elements for that model, as described in the respective product Administration Guide, before using the procedures in this chapter.

IMPORTANT:

The IP Security is a licensed Cisco feature. A separate feature license may be required. Contact your Cisco account representative for detailed information on specific licensing requirements. For information on installing and verifying licenses, refer to the Managing License Keys section of the Software Management Operations chapter in the System Administration Guide.

This chapter contains the following sections:

Overview

IP Security (IPSec) is a suite of protocols that interact with one another to provide secure private communications across IP networks. These protocols allow the system to establish and maintain secure tunnels with peer security gateways.

SIP deployments are exposed to a wide range of network security threats and attacks. Classic SIP threat models are:
  • Registration hijacking
  • Impersonating a server
  • Tampering with message bodies
  • Tearing down session on behalf of some other user
  • Denial of service attacks
  • SPIT attack (Spam over Internet Telephony)
To prevent such threats, the following network securities are required for SIP:
  • Authentication and privacy of the call participants
  • Prevent replay attacks and message spoofing
  • Preserve integrity and confidentiality of the messages
  • Application-level protection from SPIT attacks

This chapter describes SIP/IMS security models for network- and access-side security, requirements, and CSCF and IPSEC subsystem interfaces.

IMS Security Network Scenarios

The following figures show supported network- and access-side security scenarios.

Access Security


Figure 1. IPSec Tunnel Between UE and P-CSCF

Access and Network Domain Security


Figure 2. Access and Network Domain Security with IPSec


Figure 3. Access and Network Domain Security with IPSec and TLS


Figure 4. Secure Connection Towards HSS


Figure 5. Secure Connection Towards SIP AS Outside Operator's Domain


Figure 6. Secure Connection Using TLS with SIP Client


Figure 7. Dual Mode Handset with IPSec Termination on PDIF

P-CSCF Security Support

P-CSCF supports both ipsec-3gpp and TLS for SIP security as follows:

  • P-CSCF and the terminal agree on the set of parameters to establish two IPSec security associations between them as specified in RFC 3329 and 3GPP 33.203.
  • Access security includes authentication of users and the network, and protection of traffic between IMS terminals and the network.
  • P-CSCF allows activation and de-activation of access security.
  • Both P-CSCF and S-CSCF support coexistence of IMS and non-IMS/Early IMS endpoints. They support various authentication methods on the same network element.
  • Both UDP and TCP are supported on the same SA pair.
  • P-CSCF supports recovery of the security association.
  • P-CSCF supports ESP transport mode for clients that are not behind NAT and supports ESP tunnel mode for clients behind NAT.
  • UDP encapsulation of ESP in tunnel mode is supported.
  • P-CSCF supports authentication algorithm HMAC-MD5-96 and HMAC-SHA-1-96, and encryption algorithm DES EDE3 CBC, as specified in RFC 2451, and AES CBC, as specified in RFC 3602 with 128-bit key.
As per 3GPP 33.203, P-CSCF supports negotiation of the following SA parameters between UE and P-CSCF using SIP:
  • Encryption algorithm
  • Integrity algorithm
  • SPI (Security Parameter Index)
The following security parameters shall not be negotiated:
  • Lifetime
  • SA duration
  • Key length of integrity key (The length of the integrity key IKESP depends on the integrity algorithm. It is 128 bits for HMAC MD5 96 and 160 bits for HMAC SHA 1 96.)
  • Key length of encryption key
  • Mode

Two pairs of (unilateral) security associations (SAs) are established between the UE and the P-CSCF. The subscriber may have several IMPUs associated with one IMPI. These may belong to the same or different service profiles. Only two pairs of SAs shall be active between the UE and the P-CSCF. These two pairs of SAs shall be updated when a new successful authentication of the subscriber has occurred.

P-CSCF monitors the expiry time of registrations without an authentication and if necessary increases the lifetime of SAs created by the last successful authentication such that it will expire shortly after the registration timer in the message. P-CSCF deletes any SA whose lifetime is exceeded. The P-CSCF deletes all SAs it holds that are associated with a particular IMPI once all the associated IMPUs are de-registered.

The SIP application at the P CSCF checks upon receipt of a protected REGISTER message that the source IP address in the packet headers coincide with the UE's IP address inserted in the Via header of the protected REGISTER message. If the Via header does not explicitly contain the UE's IP address, but rather a symbolic name, then the P-CSCF first resolves the symbolic name using DNS to obtain an IP address.

For each unidirectional SA which has been established and has not expired, the SIP application at the P-CSCF stores the following data: (UE_IP_address, UE_protected_port, P-CSCF_protected_port, SPI, IMPI, IMPU1, ... , IMPUn, lifetime, mode) in an “SA_table”. The pair (UE_protected_port, P-CSCF_protected_port) equals either (port_uc, port_ps) or (port_us, port_pc).

P-CSCF does not accept registration attempts from UEs with the same address and protected server port in order to ensure unambiguous addressing of SIP messages sent towards the UE, using the protected server port.

P-CSCF checks that, for any one IMPI, no more than six SAs per direction are stored at any one time. If these checks are unsuccessful, the registration is aborted and an error message is sent to the UE.

The SIP application at the P CSCF checks upon receipt of an initial REGISTER message or a re-REGISTER message that the pair (UE_IP_address, UE_protected_client_port), where the UE_IP_address is the source IP address in the packet header and the protected client port is sent as part of the security mode set-up procedure, has not yet been associated with entries in the “SA_table”.

The P-CSCF associates two ports, called port_ps and port_pc, with each pair of security associations established in an authenticated registration. The ports port_ps and port_pc are different from the standard SIP ports 5060 and 5061. No unprotected messages shall be sent from or received on the ports port_ps and port_pc. From a security point of view, unprotected messages may be received on any port which is different from the ports port_ps and port_pc. The number of the ports port_ps and port_pc are communicated to the UE during the security mode set-up procedure/SIP registration procedure.

Security Association Setup for Subscriber Session

Security association is established during SIP REGISTER processing.

First SIP register comes on unprotected port and will be received by P-CSCF and does the following processing for the first REGISTER from an IMS client:
  1. Remove the Security-Client header and extract the following parameters from Security-Client header in the REGISTER message and store them in the local cache:
    • UE IMPI
    • UE IMPU
    • SPI value pair
    • Port value pair
    • UE integrity and encryption algorithm list
    • UE IP address from the source IP address of the IP packet header
  2. Remove Proxy-Require: sec-agree option tag
  3. Remove Require: sec-agree header option tag
  4. It should insert “integrity-protected” parameter with value “no” as this REGISTER is not received on a secure connection.

P-CSCF has a list of integrity and encryption algorithm configured with priority in the crypto map template. Crypto map template is obtained during crypto map binding with CSCF service. P-CSCF selects the first algorithm combination on its own list which is also supported by the UE. After algorithm selection it will send the REGISTER to I/S-CSCF.

Upon receiving the SIP register, S-CSCF checks if this is first time registration or not. If this is first time registration, it will send MAR(IMPI,m) to HSS to get the AV where IMPI is UE's private ID and m is the number of authentication vectors. Upon receipt of a request from the S-CSCF, the HSS sends an ordered array of n authentication vectors to the S-CSCF using MAA. The authentication vectors are ordered based on sequence number. Each authentication vector consists of the following components: a random number RAND, an expected response XRES, a cipher key CK, an integrity key IK, and an authentication token AUTN. Each authentication vector is good for one authentication and key agreement between the S-CSCF and the IMS user. S-CSCF will store this information in local cache and sends 401 response to UE. P-CSCF will store and remove IK and CK from 401 in local cache and forwards the message to UE. P-CSCF will do the following processing on 401 received from S-CSCF:
  1. Add list of algorithms, port value pair, and SPI value pair in the Security-server header in the 401 response. P-CSCF will keep a flag to indicate that this subscriber is using secure connection.
  2. Remove ik and ck from WWW-authenticate header and store them locally.
  3. Forward modified 401 to UE and complete security association establishment.
The second REGISTER from UE will come on secured connection. P-CSCF will get the second register on the port_ps. It will do the following processing on second REGISTER:
  1. It will check for the presence of Security-Verify header and remove it. P-CSCF will make sure it contains the same parameters sent in Security-Server header. If the two parameters do not match, it will reject the REGISTER with 403 and delete the security association. If there is no Security-Verify header, then P-CSCF will send 403 response and delete the SA.
  2. Remove Security-Client header and compare the contents of Security-Client header with the Security-Client header received in the first REGISTER. If Security-Client header is not present, or the content does not match, then the REGISTER will be rejected with 403 and SA should be deleted.
  3. Remove Proxy-Require: sec-agree option tag
  4. Remove Require: sec-agree header option tag
  5. It will insert “integrity-protected” parameter with value “yes” as this REGISTER is received on a secure connection.

The following call flow shows a successful SA setup with REGISTER.

Re-registration Handling

Every reregistration that includes a user authentication attempt creates new security associations. Old set of security association is deleted and new set is created. According to the spec port_ps stays the same for new SA but port_pc and port_uc shall change. If UE sends an unprotected register, P-CSCF shall assume that old SAs have been deleted on UE and should proceed with registration procedure and delete the old SAs associated with that UE.

The initial REGISTER message for re-registration will come on the old set of security associations. A new set of SA will be created during 401 processing, with new client port and SPI values sent by UE. P-CSCF will keep the old set of SAs until it receives a request from the UE on new SA. P-CSCF is not sure if UE received 200OK for second REGISTER or not. If the UE has not received the 200OK response for second REGISTER, it will not start using the new set of SAs. As long as P-CSCF does not receive a request from the UE on the new set of SA, it will do the following:
  • Send incoming requests to the UE on the old SA with protected port_pc1.
  • Keep both sets of SAs active until one or both of them either expire or a new request is received from the UE.

P-CSCF will mark the locally stored entry of SAs as the temporary entry until a message is received from the UE.When P-CSCF receives a new request from the UE on the new SA, P-CSCF will mark the new set of SAs as permanent SA and reduce the lifetime of the old set of SAs to be 64*T1 (default to 128 seconds for IMS UE). The old set of SAs are not dropped immediately, as the UE might have sent or received a request over it. After SA lifetime timer expiry, P-CSCF will delete the old SA.

The following call flow shows an SA setup during re-registration.

SA Lifetime Management

SA lifetime management will be done by P-CSCF.

During authentication, SA lifetime is set to four minutes. After authentication process is complete, the SA lifetime will be set to expiration time of the registration plus 30 seconds if there is no existing set of security associations (i.e., the “for the first time” association from the UE).

If there is already an existing set of SA (during re-registration), the lifetime of the newly established SA will be set to the lifetime of already existing SA as long as it is longer than the expiration time in reregistration plus 30 seconds.

If the lifetime received in re-registration is larger then the lifetime of existing SA, then lifetime of the old SA will be updated to new expiration time plus 30 seconds.

P-CSCF will set the SA lifetime to be 64*T1 in case of network-initiated de-registration. Expired SAs will be deleted using the timer maintained by P-CSCF.

IMS Registration with USIM

When the IMS terminal is equipped with a UICC that does not contain an ISIM application but contains an USIM application, there are a few issues with registration.

USIM does not contain private user identity and the home domain information. Both of these parameters are stored in ISIM not in USIM. USIM contains IMSI and IMSI is never used to route calls in the network; it is only used for authentication/authorization purposes.

When an IMS terminal has UICC with USIM, it uses IMSI to build a temporary private user ID and home network domain. These temporary IDs are only used during registration and de-registration. Once the user is registered, it gets a set of public user IDs from HSS that it can use for regular call processing and session setup. P-CSCF supports USIM registration.

The security association will have no change other then using temporary private ID. The temporary private ID will be of the form imsi@mnc.mcc.imsi.3gppnetwork.org. Home network domain name will be of the form mnc.mcc.imsi.3gppnetwork.org.

IPSec Configuration

IMPORTANT:

Commands used in the configuration samples in this section provide base functionality to the extent that the most common or likely commands and/or keyword options are presented. In many cases, other optional commands and/or keyword options are available. Refer to the Cisco ASR 5000 Series Command Line Interface Reference for complete information regarding all commands.

To configure the system for IPSec support:
  1. Configure an IPSec transform set by applying the example configuration in the Creating and Configuring an IPSec Transform Set section. Transform sets are used to define IPSec security associations (SAs). IPSec SAs specify the IPSec protocols to use to protect packets.
  2. Configure a crypto template by applying the example configuration in the Creating and Configuring a Crypto Template section.
  3. Bind an IP address to the crypto template by applying the example configuration in the Binding an IP Address to the Crypto Template section.
  4. Save your configuration to flash memory, an external memory device, and/or a network location using the Exec mode command save configuration. For additional information on how to verify and save configuration files, refer to the System Administration Guide and the Command Line Interface Reference.

Creating and Configuring an IPSec Transform Set

The following example configures an IPSec transform set, which is used to define the security association that determines the protocols used to protect the data on the interface:

configure
   context
<p-cscf_context_name>
-noconfirm
      ipsec
transform-set <ipsec_transform-set_name>
         encryption
<3des-cbc | aes-cbc-128 | aes-cbc-256 | des-cbc | null>
         group
<1 | 2 | 5 | 14 | none>
         hmac
<md5-96 | sha1-96 | null>
         mode
<transport | tunnel>
         end
Notes:
  • The encryption algorithm aes-cbc-128, or Advanced Encryption Standard Cipher Block Chaining, is the default algorithm for IPSec transform sets configured on the system.
  • The group command configures the appropriate key exchange cryptographic strength and activates Perfect Forward Secrecy by applying a Diffie-Hellman group. The keyword none specifies that no crypto strength is included and that Perfect Forward Secrecy is disabled. This is the default setting for IPSec transform sets configured on the system.
  • The hmac command configures the Encapsulating Security Payload (ESP) integrity algorithm. The sha1-96 keyword uses a 160-bit secret key to produce a 160-bit authenticator value. This is the default setting for IPSec transform sets configured on the system.
  • The mode command onfigures the security of IP datagrams based on header placement. The default tunnel mode specifies that the entire packet is to be encapsulated by the IPSec header, including the IP header. The transport mode specifies that the IPSec header is applied only over the IP payload, not over the IP header in front of it.

Creating and Configuring a Crypto Template

The following example configures a crypto template:

configure
   context
<p-cscf_context_name>
-noconfirm
      crypto
template <crypto_template_name>
ipsec-3gpp-cscf
         ipsec
transform-set list <list_name1>
. . . <list_name4>
            end
Notes:
  • The IPSec CSCF crypto template should be configured in the same context in which the P-CSCF is configured.
  • The ipsec transform-set list command specifies up to four IPSec transform sets.

Binding an IP Address to the Crypto Template

The following example defines the domain name of the CSCF service and configures the binding of a logical IP interface to the crypto template:

configure
   context
<p-cscf_context_name>
-noconfirm
      cscf
service <p-cscf_service_name>
-noconfirm
         default-aor-domain
<alias>
         bind
address <ip_address> ipsec-crypto-template
<template>
         exit
         end