TLS Support

This chapter describes the system’s support for Transport Layer Security (TLS) and explains how it is configured. 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 Cisco ASR 5000 Series Session Control Manager Administration Guide, before using the procedures in this chapter.

IMPORTANT:

TLS support 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 includes following sections:

Overview

When enabled through a feature license key, TLS provides confidentiality and integrity protection for SIP signaling messages between the UE and P-CSCF/A-BG. TLS is a layered protocol that runs upon reliable transport protocols like TCP and SCTP.

IMPORTANT:

All future references in this chapter to P-CSCF imply support by the A-BG as well.

TLS Session Renegotiation

TLS handshake protocol creates a TLS session identified by a session id at both client and server. The TLS session contains all the security parameters selected for the connection. The lifetime of the TLS sessions can be configured in P-CSCF service. The default value is one hour. When the TLS session is about to expire, P-CSCF will initiate a TLS session renegotiation procedure over the existing TLS connection by sending the HelloRequest message. This will negotiate new security parameter for the connection. If the UE fails to start the renegotiation by sending clientHello, P-CSCF will terminate the TLS connection. UE may also initiate a TLS session renegotiation by sending clientHello message over the existing TLS connection.

TLS Session Setup

The setup of a TLS session between a UE and P-CSCF is coupled with the initial registration procedure. In IMS, the authentication of the users is performed during the registration procedure. Subsequent signaling messages between a UE and P-CSCF will be integrity protected based on the TLS session that was established during the authentication process. P-CSCF also supports TLS session setup, as per RFC 3261.

TLS Session Tear Down

When the user authentication fails, both the UE and P-CSCF will send a close_notify message on the TLS connection and delete the associated TLS session. Receiving an alert message on the TLS connection with severity “fatal” will cause the TLS connection and the session to be deleted. When the UE cannot verify the P-CSCF server certificate during the handshaking process, it sends an alert message and closes the TLS connection. When all the public user ids associated with the private user id of the UE is deregistered, P-CSCF will close the TLS connection by sending a close_notify message.

P-CSCF Server Certificate

The P-CSCF server certificate used in the TLS handshake for server authentication is the X.509v3 digital certificate. The Common Name value of the Subject field in the certificate contains the P-CSCF fully qualified domain name (FQDN). As part of the certificate verification process, UE verifies it against the known host names of the P-CSCF. Existing CLIs to input certificates are used to configure P-CSCF TLS certificate. The certificate is configured in the Global Configuration Mode and managed by vpnctrl. Either PEM encoded X.509v3 certificate can be configured or a URL to the certificate can be configured.

IMPORTANT:

Only RSA-based certificates are currently supported.

Use of TLS as Transport Between UE and P-CSCF

This section specifically outlines the use of TLS between UE and PCSCF.

P-CSCF supports two methods for TLS connection setup:
  • TLS as a transport between UE and P-CSCF, as per RFC 3261
  • Use of TLS by Security Mechanism agreement between UE and P-CSCF, as per RC 3329 and TS 33.203

TLS Setup Using 3GPP Approach

The setup of a TLS session between UE and P-CSCF is coupled with the initial registration procedure, as per 3GPP 33.203. In IMS, the authentication of the users is performed during registration procedure. Subsequent signaling messages between UE and P-CSCF will be integrity protected based on the TLS session that was established during the authentication process.

The sip-sec-agree negotiation is used by UE and P-CSCF to negotiate the choice of security mechanism. The UE sends the list of the security mechanisms it supports and the parameters required for the mechanisms in the Security-Client header in initial register request. Upon receiving the register request, P-CSCF selects one security-mechanism from the UE list (based on the configuration) and sends it in the Security-Server header in 401 response towards UE. If TLS was selected by P-CSCF, UE starts the TLS handshake procedure with P-CSCF. TLS handshake protocol authenticates the peers and establishes the security parameters (keys, secrets) required for the connection.

Once the TLS handshake completes and the TLS session is setup, UE sends the challenge response register over the established TLS connection. This contains the Security-Verify header that mirrors the Security-Server header received by UE in 401 response. P-CSCF, on receiving this register over the TLS connection, verifies the security-verify header and adds a TLS integrity-protection indicator with value “tls-pending” before forwarding it to S-CSCF. Upon receiving 200 OK from S-CSCF, P-CSCF forwards it over the established TLS connection and associates the UE's IP address and port of the TLS connection with the TLS session ID, the private user identity, and all the successfully registered public user identities related to the private user identity. This completes the successful TLS session setup between UE and P-CSCF. After this point, both UE and PCSCF exchange messages over the established TLS connection. See TLS Register Call Flow for a detailed call flow example.

During the TLS session setup, only P-CSCF is authenticated by the UE by presenting a valid server certificate. The authentication of the UE is done by the home network using SIP digest authentication mechanism.

UE and P-CSCF follow the procedures defined in RFC5626 to keep the TLS connection active. This is required because P-CSCF cannot initiate TLS connection towards UE and any terminating request for the UE requires an existing TLS connection.

By default, P-CSCF will listen on port 5061 for TLS connections. A configuration option will be provided so that the operator can configure any port for TLS connection. It is possible to configure both TLS and IPSec access security mechanisms in P-CSCF. When UE supports TLS and IPSec (indicated by the Security-Client header), P-CSCF will use the access profile configuration, if configured to select the access security mechanism; otherwise, IPSec is given preference over TLS.

P-CSCF will add the integrity-protection indicator for the REGISTER request received over the TLS connection. During initial registration, for the challenge response register request received over the established TLS connection, P-CSCF will add the integrity-protected value “tls-pending” while forwarding the register to S-CSCF.

For re-register/refresh register request received over the existing TLS connection, P-CSCF will add the integrity-protected value “tls-yes”.

TLS Setup Using RFC3261 Approach

When the DNS SRV records for P-CSCF return a sips URI, TLS is used to send SIP signaling messages toward P-CSCF. All the SIP signaling messages from UE will be sent via TLS to ensure confidentiality. UE will set up a TLS connection with P-CSCF before sending any SIP signaling messages. This scenario also assumes only server-based certificates are used. The UE is assumed to have the public key of the CA, who issued the P-CSCF certificate. See TLS 3GPP Approach Call Flow for a detailed call flow example.

The SYN packet is processed by P-CSCF. P-CSCF responds with SYN-ACK and installs a 4-tuple TCP flow (ue ip, ue port, pcscf ip, and tls port) for receiving further packets on the connection. Once the TCP connection is established, UE starts the TLS handshaking process and a TLS session is established between UE and sessmgr. All SIP signaling message exchanges between UE and P-CSCF are sent over the established TLS connection. The UE has to use a suitable keep-alive mechanism to keep this TLS connection active. This is required for forwarding any incoming request towards the UE on the existing TLS connection. When there is an active TLS connection between UE and P-CSCF, P-CSCF will use the same connection to send any mobile terminating requests towards the UE, bypassing the normal SIP routing rules.

Session Recovery

On session task crash or PSC failure TCP/TLS connection is not recovered. This will result in the UE detecting the flow failure. The UE will initiate the registration procedure again to establish the new TCP and TLS session. This is similar to the initial registration procedure.

PSC Migration

TLS connection will be recovered on PSC migration.

Engineering Rules

  • 500k current TLS sessions

TLS Register Call Flow

  1. UE sends SYN packet to the P-CSCF TLS port.
  2. P-CSCF upon receiving SYN packet sends SYN-ACK and installs a 4 tuple NPU flow for receiving future packets.
  3. UE sends ACK. The TCP connection establishment is successful and it invokes SSL module. This involves creating a new TLS connection.
  4. The UE sends the ClientHello message to initiate TLS handshake procedure. The ClientHello message contains the list of cipher-suites the UE supports, a random number and a session id field. The ClientHello message (TCP data), is processed by P-CSCF.
  5. The P-CSCF upon receiving ClientHello responds with ServerHello message. The ServerHello message contains a single cipher suite selected from the client list.
  6. TLS supports three authentication modes: authentication of both parties, server authentication with an unauthenticated client, and total anonymity. For TLS between UE and P-CSCF, server authentication is used. Client is authenticated by the home network using SIP digest. The P-CSCF sends the ServerCertificate message following the ServerHello message for server authentication. X.509 digital certificates are used for authentication.
  7. ServerKeyExchange message is sent following the ServerCertificate message. This message is optional and is sent based on the key exchange algorithm selected in the above steps.
  8. ServerHelloDone is sent to indicate the end of the server hello and associated messages.
  9. UE sends the ClientKeyExchange message. This message contains the premaster secret generated by the UE. This premaster secret is used by both UE and P-CSCF for generating the keys required in the encryption and authentication process. The ClientKeyExchange message is processed by the P-CSCF and it computes the master secret, client write key, server write key, client write MAC secret, server write MAC secret for the TLS session.
  10. ChangeCipherspec message is sent by UE to indicate that the subsequent messages will be protected under the negotiated cipher spec and keys.
  11. UE sends the finished message to verify that the key exchange and authentication processes were successful. This is the first message protected with the just negotiated algorithms, keys and secrets. The P-CSCF verifies that the finished message is valid according to the negotiated session state.
  12. In response to the finished message, the P-CSCF sends its own changecipherspec message.
  13. Finally, the P-CSCF sends the finished message under the new cipher spec. This completes the TLS handshake process.
  14. After this point, all the SIP signaling messages between UE and P-CSCF are exchanged over the established TLS connection.
  15. Data exchange over TLS connection.
  16. Data exchange over TLS connection.
  17. Data exchange over TLS connection.
  18. Data exchange over TLS connection.
  19. Data exchange over TLS connection.
  20. Data exchange over TLS connection.
  21. Data exchange over TLS connection.

IMPORTANT:

Normally, UE is required to keep this TLS connection active by sending keep alives. This is required for the P-CSCF to forward any terminating request to the UE over TLS.The default idle timeout in P-CSCF for TLS connection is one hour. P-CSCF stores the TLS connection parameter (source ip and source port) of the UE. It uses this information for sending any request towards the UE over the existing TLS connection.

TLS 3GPP Approach Call Flow

  1. UE Initiates SYN.
  2. P-CSCF responds with SYN ACK.
  3. UE sends ACK. TCP connection establishment is complete.
  4. Register from UE to P-CSCF.
    The REGISTER request is sent from UE to P-CSCF. It contains the security-client header indicating the support for TLS and headers related to RFC 5626. The request is sent over TCP.
    REGISTER sip:registrar.home1.net SIP/2.0
    Require: see-agree
    Proxy-Require: see-agree
    Security-Client: tls; q=0.1
    Supported: Outbound, Path
    Contact: <sip:xxx>;reg-id=1, +sip.instance="<urn:uuid:00000000-0000-1000-8000-000A95A0E128>"
  5. Register is sent from P-CSCF to I/S-CSCF.
    P-CSCF upon receiving the REGISTER request examines the Security-Client header. If P-CSCF supports TLS, it removes the Security-Client header and the seg-agree option from Require and Proxy-require headers and forwards the REGISTER request to I/S-CSCF.
  6. 401 unauthorized response is sent from S-CSCF to P-CSCF.
  7. P-CSCF inserts the Security-Server header containing the value “tls” and forwards the response to UE over TCP.
    SIP/2.0 401 Unauthorized
    Security-Server: tls; q=0.1,
  8. After receiving the 401 response from P-CSCF, UE now begins the TLS session setup procedures by performing the TLS handshake. UE initiates the TLS connection towards P-CSCF TLS default port 5061 or the configured port.
  9. After receiving the 401 response from P-CSCF, UE now begins the TLS session setup procedures by performing the TLS handshake. UE initiates the TLS connection towards P-CSCF TLS default port 5061 or the configured port.
  10. After receiving the 401 response from P-CSCF, UE now begins the TLS session setup procedures by performing the TLS handshake. UE initiates the TLS connection towards P-CSCF TLS default port 5061 or the configured port.
  11. After receiving the 401 response from P-CSCF, UE now begins the TLS session setup procedures by performing the TLS handshake. UE initiates the TLS connection towards P-CSCF TLS default port 5061 or the configured port.
  12. After receiving the 401 response from P-CSCF, UE now begins the TLS session setup procedures by performing the TLS handshake. UE initiates the TLS connection towards P-CSCF TLS default port 5061 or the configured port.
  13. Once the TCP connection is established successfully, UE sends the ClientHello message to initiate TLS handshake procedure. The ClientHello message contains the list of cipher-suites the UE supports, a random number and a session id field. The ClientHello message (TCP data), is send to the SSL module for processing from the user tcp stack read call back function by calling sn_ssl_process_tcp_data() API.
  14. P-CSCF upon receiving ClientHello responds with ServerHello message. The ServerHello message contains a single cipher suite selected from the client list. As per RFC 2246, cipher suites with NULL integrity protection or anonymous key exchange method are not allowed. Both UE and P-CSCF should support TLS_RSA_WITH_AES_128_CBC_SHA and TLS_RSA_WITH_3DES_EDE_CBC_SHA cipher suites. Other cipher suites mentioned in 33.203 are optional.
  15. TLS supports three authentication modes: authentication of both parties, server authentication with an unauthenticated client, and total anonymity. For TLS between UE and P-CSCF, server authentication is used. Client is authenticated by the home network using SIP digest. Since the key exchange method selected in the above step cannot be anonymous, the P-CSCF sends the ServerCertificate message following the ServerHello message for server authentication. X.509 digital certificates are used for authentication.
  16. ServerKeyExchange message is sent following the ServerCertificate message. This message is optional and is sent based on the key exchange algorithm selected in the above steps.
  17. ServerHelloDone is sent to indicate the end of the server hello and associated messages.
  18. ClientKeyExchange is the first message sent by the UE in the handshake process. This message contains the premaster secret generated by the UE. This premaster secret is used by both UE and P-CSCF for generating the keys required in the encryption and authentication process. The ClientKeyExchange message is processed by the P-CSCF and it computes the master secret, client write key, server write key, client write MAC secret, server write MAC secret for the TLS session.
  19. ChangeCipherspec message is sent by UE to P-CSCF to indicate that the subsequent messages will be protected under the negotiated cipher spec and keys.
  20. UE sends the finished message to verify that the key exchange and authentication process were successful. This is the first message protected with the just negotiated algorithms, keys and secrets. The P-CSCF verifies that the finished message is valid according to the negotiated session state.
  21. In response to the finished message, the P-CSCF sends its own changecipherspec message.
  22. Finally the P-CSCF sends the finished message under the new cipher spec. This completes the TLS handshake process.
  23. Once the TLS handshake is complete, both UE and P-CSCF store the TLS session id. All further messages between UE and P-CSCF are sent over the established TLS connection. UE sends the challenge response register message over the TLS connection.
  24. Once the TLS handshake is complete, both UE and P-CSCF store the TLS session id. All further messages between UE and P-CSCF are sent over the established TLS connection. UE sends the challenge response register message over the TLS connection.
  25. Once the TLS handshake is complete, both UE and P-CSCF store the TLS session id. All further messages between UE and P-CSCF are sent over the established TLS connection. UE sends the challenge response register message over the TLS connection.
  26. Once the TLS handshake is complete, both UE and P-CSCF store the TLS session id. All further messages between UE and P-CSCF are sent over the established TLS connection. UE sends the challenge response register message over the TLS connection.
  27. Once the TLS handshake is complete, both UE and P-CSCF store the TLS session id. All further messages between UE and P-CSCF are sent over the established TLS connection. UE sends the challenge response register message over the TLS connection.
  28. Once the TLS handshake is complete, both UE and P-CSCF store the TLS session id. All further messages between UE and P-CSCF are sent over the established TLS connection. UE sends the challenge response register message over the TLS connection.
    REGISTER sip:registrar.home1.net SIP/2.0
    Require: see-agree
    Proxy-Require: see-agree
    Security-Client: tls; q=0.1
    Security-Verify: tls; q=0.1
    Supported: outbound
    Contact: <sip:xxx>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000A95A0E128>"
    The SSL module decrypts the REGISTER request (application data) and provides it to the user module via the registered callback. The register request is sent to the dc-sip stack for processing.
    P-CSCF receives the REGISTER over the TLS connection and forwards it to SCSCF. It removes all the security related headers and adds an integrity-protected parameter in the Authorization header with the value “tls-pending”
    REGISTER sip:registrar.home1.net SIP/2.0
    Authorization: ..; integrity-protected="tls-pending"
    Contact: <sip:xxx>;reg-id=1;+sip.instance="<urn:uuid:00000000-0000-1000-8000-000A95A0E128>"
    All subsequent message exchanges (invite, subscribe etc) between UE and P-CSCF will happen over the established TLS connection. P-CSCF will not accept any sip message outside of the TLS connection except for the REGISTER request and INVITE request related to emergency calls.

TLS 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 TLS:
  1. Create a P-CSCF TLS certificate by applying the example configuration in the section Creating the P-CSCF TLS Certificate.
  2. Create an X.509 CA root certificate to enable a the P-CSCF to perform certificate-based peer (client) authentication by applying the example configuration in the section Creating the Intermediate CAs in the Certificate Chain.
  3. Create an SSL cipher suite for the SSL template by applying the example configuration in the section Creating the SSL Cipher Suite.
  4. Create the SSL template and specify the associated SSL cipher suite by applying the example configuration in the section Creating the SSL Template.
  5. Create the CSCF service for SSL access by applying the example configuration in the section Binding an SSL Template to a P-CSCF Service.
  6. 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.

Sample Configuration

configure
  orbem
    no
siop-port
    no
iiop-port
    default
iop-address
    #exit
  card 17
  #exit
  card 1
    mode
active
    #exit
  context
local
    subscriber
default
    exit
    aaa
group default
    #exit
    gtpp
group default
      gtpp
egcdr lotdv-max-containers 0
      gtpp
egcdr losdv-max-containers 0
      #exit
    #exit
  task
facility sessmgr max 1
  certificate
name pcscftls pem
url /flash/newcert.pem private-key
pem url /flash/newkey1.pem
  ca-certificate
name cacert pem
url /home/psujithr/openssl_certs/demoCA/cacert.pem
  context accessvpn
    interface IP_17/1
      ip
address 191.168.10.10 255.255.255.0
    #exit
    ip
route 191.168.20.0 255.255.255.0 next-hop 191.168.10.15 IP_17/1
    ip
route 191.168.30.0 255.255.255.0 next-hop 191.168.10.15 IP_17/1
    ip
route 191.168.40.0 255.255.255.0 next-hop 191.168.10.15 IP_17/1
    ip
route 60.0.0.0
255.0.0.0 next-hop 191.168.10.15 IP_17/1
    ip
route 10.5.2.0 255.255.255.0 next-hop 191.168.10.15 IP_17/1
    ip
pool pool_access range 191.168.40.153 191.168.40.250 napt-users-per-ip-address 20 port-chunk-size 6432
    cipher-suite abc
      encryption aes-128
      #encryption
null
      #exit
    ssl
template pcscf ssl-subscriber
      cipher-suites
list abc
      certificate pcscftls
      ca-certificate
list cacert
      exit
    subscriber
default
    exit
    aaa
group default
    #exit
    gtpp
group default
    #exit
  end
config
  context accessvpn
    cscf
service accesspcscf
      proxy-cscf
        allow
rfc3261-ua-interworking
        no
store-session-path
        network-id cisco.com
        sip-param
insert integrity-protected
        sigcomp
        #exit
      #exit
      media-bridging
      nat-pool
name pool_access
      core-service
name corepcscf
      bind
address 191.168.10.10 tls-crypto-template pcscf transport
tcp
      default-aor-domain 191.168.20.10
      subscription
package reg
      #exit
      keepalive
method crlf max-retry 3 expire-timer 29
      keepalive
method stun max-retry 3 expire-timer 29
      recurse-on-redirect-resp
      strict-outbound
      #exit
    ip
igmp profile default
    #exit
  #exit

Creating the P-CSCF TLS Certificate

Use this example to create and select an X.509 Trusted Author certificate:

configure
  certificate
name <name> pem
url <url> private-key
pem url <url>
  end

Creating the Intermediate CAs in the Certificate Chain

Use this example to create selects an X.509 CA root certificate to enable the P-CSCF to perform certificate-based peer (client) authentication:

configure
  ca-certificate
name <name> pem
url <url>
  end

Creating the SSL Cipher Suite

Use this example to create the SSL cipher suite for the SSL template:

configure
  context <context_name> -noconfirm
    cipher-suite <cipher_suite_name>
      encryption
rc4
      hmac
sha1
      key-exchange
rsa
      end

A cipher suite contains the cryptographic algorithms supported by the client, and defines a key exchange and a cipher spec, which specifies the encryption and hash algorithms used during authentication. SSL cipher suites allow operators to select levels of security and to enable communication between devices with different security requirements.

This example shows default values.

Creating the SSL Template

Use this example to create the SSL template used to define the SSL cryptographic policy for the CSCF service for SSL access:

configure
  context <context_name> -noconfirm
    ssl
template <ssl_template_name> ssl-subscriber
      cipher-suites
list <name>
      certificate <name>
      ca-certificate
list <name>
      version
list tlsv1
      end

A P-CSCF service for SSL access will not function without a configured SSL template. The ssl-subscriber keyword in the ssl template command specifies that SSL protocol is used. The certificate command binds the specified X.509 trusted certificate to the SSL template.

Only one SSL template can be configured per P-CSCF service.

Binding an SSL Template to a P-CSCF Service

Use this example to bind an SSL template with a P-CSCF service. It also allows configuration of a non-default port for TLS.

configure
  context <context_name> -noconfirm
    cscf
service <cscf_service_name> ssl-subscriber
      bind <ip_address> tls-crypto-template <tls_crypto_template_name> tls-port <number>
      end