SIP DoS Attack Prevention

This chapter describes the system’s support for preventing Denial of Service (DoS) attacks 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 Session Control Manager Administration Guide, before using the procedures in this chapter.

This chapter contains the following sections:

Feature Description

The A-BG provides a scalable proxy network and a distributed Network Address Translation (NAT) network which effectively mitigates DoS attacks.

The SCM prevents a variety of DoS attacks specific to CSCF and SIP technology.

Overview

DoS attacks aim at denying or degrading a legitimate user's access to a service or network resource, or bringing down the servers offering such services.

Flooding

Memory Exhaustion

CSCF service is a stateful SIP proxy. All the sessions established using a CSCF service lead to a session being created in the CSCF service. The session typically comprises of the call state/data, transaction state/data, and FSMs for call and transaction. In a DoS attack, the attacker can flood the service by sending too many SIP requests (INVITE messages). If each of the INVITE messages initiates a new session, the total memory limit can be exhausted for any new sessions.

A successful DoS attack will consume as many resources of the target server as possible. This can be achieved by either increasing the number of attacker packets or the resources consumed by each attack packet. Accordingly, the following attacks can be observed on the SIP server:

  • basic flood
  • static-nonce-based flood
  • adaptive-nonce-based flood
  • adaptive-nonce-based flood with IP spoofing

In addition, resource consumption can be increased for each attack packet in the following ways:

  • excessive external party interaction
  • co-operative attacks

CSCF service on the ASR 5000 is protected from flooding by using a distributed architecture and resource management to prevent memory overruns.

CPU Loading

The SIP proxy needs to parse each received messages, do some processing, and forward the messages. In general, the SIP proxy should be able to process the messages at the speed at which they can be received on the interface it is bound to. A DDoS (Distributed DoS) attack can send huge numbers of messages to the system. The system's processing capacity is generally consumed by parsing of messages, digest authentication, and application processing.

The CSCF Demux Manager decodes an incoming REGISTER/INVITE message and finds out if it belongs to a particular subscriber. If it is able to find a subscriber corresponding to the message, it forwards the message to an associated SMGR (session manager facility) instance (obtained from subscriber table). When there is a flood of messages, the message parsing at CSCF can consume quite a bit of CPU. SIP message encoding gives a lot of freedom. Therefore, the time to parse a message depends on the efficiency of a parser as well as the content of the message.

Digest authentication involves sending a challenge to the subscriber; when the subscriber responds with a challenge-response, HSS sends calculated expected response to S-CSCF and S-CSCF compares it with what the subscriber has sent. Many clients continue sending REGISTER requests upon authentication failure. This creates load on the system. There can also be a DoS attack of REGISTER requests with junk values of challenge response that can increase the system load.

The SIP proxy has to resolve hostname in VIA header while sending back reply, or it has to resolve hostname in Route/Contact or Request-URI while forwarding the request. This is done using the DNS client in the system. When the system has a DNS resolve called “gethostbyname”, resolution of hostname is blocked until a DNS reply is obtained from a DNS server. The attacker can take advantage of this and send irresolvable DNS hostnames in request/responses. The resolve timeout will typically take longer than a normal DNS query reply; the SIP proxy service would be blocked for this extended time interval. Therefore, DNS client implementation on the ASR 5000 has a cache for fast lookup of DNS results and avoids blocking.

A SIP AoR is allowed to register multiple contacts. When a call comes for such a user, the stem applies caller preference processing on all the registered contacts and filter the contacts which meet the caller preference. This consumes the CPU resource in applying/processing caller preference on all registered contacts. When DoS attack prevention is enabled, the forking-contact-limit command sets a limit on the number of allowable contacts getting registered per user ID.

To prevent loading, the Demux Manager uses a grey-listing mechanism, where a user or source IP address gets grey-listed once the number of failed requests from these sources crosses a configured limit.

IMPORTANT:

When DoS attack prevention is enabled, the per-aor-failure-limit and per-ip-failure-limit commands set a failure limit that, when exceeded, causes the suspension of registration attempts for the offending AoR/IP address.

All requests come directly to SMGR once first registration is done. When a user is grey listed, any incoming request to SMGR port is silently discarded. Any request to Demux port is answered with an error response.

On receiving error response information, the Demux Manager uses independent failure nodes for source IP address and AoR. The following timers are maintained by the system:

  • Start_time: The absolute time at which the failure node was created. This information is needed to determine whether the number of failures has increased over a short or long time.
  • Failure count: A dynamic counter that gets incremented every time a new failure response is generated for the same AoR or IP address. The weight with which the count gets incremented depends on configured weights for different type of failures.

    IMPORTANT:

    When DoS attack prevention is enabled, weighted multipliers are defined in the auth-failure-weight and bad-request-weight commands.

    Over a period of time, these failure counts reach a configured maximum limit.

    IMPORTANT:

    When DoS attack prevention is enabled, the per-aor-failure-limit and per-ip-failure-limit commands set a failure limit that, when exceeded, causes the suspension of registration attempts for the offending AoR/IP address.

    Once the maximum limit is reached, the Demux Manager performs a computation based on:
    • time when failure node was created (start_time)
    • current time
    • configured threshold rate (in failures per second)

    IMPORTANT:

    When DoS attack prevention is enabled, the threshold-rate command configures the rate per second at which the system must receive authorization failures or bad registration requests before it considers the failures/requests a DoS attack.

    Once an AoR or IP address is considered to be a DoS attacker, it is inserted in grey-list nodes. A timer value called “Banned time” gives the duration for which an entry is grey listed. This is be computed by adding a configured grey-list duration to current time. The grey-list nodes are checked once a minute to see if any node has completed its barred period.

    IMPORTANT:

    When DoS attack prevention is enabled, the greylist-duration command configures the amount of time an AoR or IP address remains on a “grey list” after having crossed the registration authorization limit or the bad registration request limit.

    Once an AoR/IP address gets grey listed, the Demux Manager issues a clear subscriber request to SMGR to clear registration information about the subscriber from SMGR. Any subsequent requests coming from the AoR/IP address to Demux Manager are dropped.

SIP Protocol Feature Exploitation

Loops

In this type of attack, attacker can make such an arrangement that a message loops back to the proxy which forwards it. If the loop establishment succeeds, it keeps the proxy busy processing the same message over and over again until Max-Forwards value reaches zero. The scenario can be amplified when forking is used along with looping.

IMPORTANT:

When DoS attack prevention is enabled, the forking-contact-limit command sets a limit on the number of allowable contacts getting registered per user ID.

P-CSCF does not allow a subscriber to register with a contact IP which points to CSCF service IP or to any of the IPs which are in the peer-server list of CSCF configuration.

Unauthenticated Messages

SIP methods BYE and CANCEL are not authenticated. CANCEL request is a hop-by-hop request and hence cannot be challenged by the proxy. If an attacker snoops the session being established by a subscriber, it can inject a CANCEL request by faking its own IP address and this request can cancel the call originated by a legitimate user. Similarly, attacker can inject a BYE request to terminate an ongoing call. These scenarios assume the proxy is on a public network.

CSCF service can use secured transport below SIP, such as IPSEC or TLS, to reduce chances of attack.

Standards Compliance

SIP DoS attack prevention complies with the following standards:

  • 3GPP TR 24.930 IP Multimedia core network Subsystem (IMS) based on Session Initiation Protocol (SIP) and Session Description Protocol (SDP); Stage 3
  • RFC 3261 (June 2002): “SIP: Session Initiation Protocol”

Configuring SIP DoS Attack Prevention

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 Command Line Interface Reference for complete information regarding all commands.

To configure SIP DoS attack prevention:

  1. Enable SIP DoS attack prevention by applying the example configuration in the Enabling SIP DoS Attack Prevention section.
  2. Configure SIP DoS attack prevention by applying the example configuration in the Configuring SIP DoS Attack Prevention section.
  3. 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.

Enabling SIP DoS Attack Prevention

The following example enables SIP DoS attack prevention:

configure
   context <p-cscf_vpn_context_name>
      cscf
service <p-cscf_service_name>
         proxy-cscf
            security-parameters
               dos-prevention
               end

Notes:

  • The system will ignore all DoS attack prevention configuration unless the dos-prevention command has been enabled.
  • When the dos-prevention command has been enabled, the commands in CSCF Security Configuration Mode are automatically enabled with default values configured.

Configuring SIP DoS Attack Prevention

The following example configures SIP DoS attack prevention:

configure
   context <p-cscf_vpn_context_name>
      cscf
service <p-cscf_service_name>
         proxy-cscf
            security-parameters
               auth-failure-weight <weight>
               bad-request-weight <weight>
               forking-contact-limit <limit>
               greylist-duration <time>
               per-aor-failure-limit <limit>
               per-ip-failure-limit <limit>
               threshold-rate <rate>
               end

Notes:

  • The system will ignore all DoS attack prevention configuration unless the dos-prevention command has been enabled.
  • The auth-failure-weight command defines the severity of an authorization failure. This parameter is used in calculating the current number of authorization failures to compare to the per-aor-failure-limit and the per-ipfailure-limit.
  • The bad-request-weight command defines the severity of bad registration request. This parameter is used in calculating the current number of request failures to compare to the per-aor-failure-limit and the per-ip-failurelimit.
  • The forking-contact-limit command sets a limit on the number of contacts a user ID can register with the system.
  • The greylist-duration command specifies the amount of time AoRs or IP addresses remain on a “grey list” after having crossed the registration authorization limit or the bad registration request limit. Limits are described in the per-aor-failure-limit and per-ip-failure-limit commands.
  • The per-aor-failure-limit command sets a failure limit that, when exceeded, causes the suspension of registration attempts for the offending AoR.
  • The per-ip-failure-limit command sets a failure limit that, when exceeded, causes the suspension of registration attempts for the offending IP address.
  • The threshold-rate command specifies the rate per second at which the system must receive authorization failures or bad registration requests before it considers the failures/requests a DoS attack.