Protect Servers from a SYN Flood DoS Attack (TCP Intercept)
A SYN-flooding denial of service (DoS) attack occurs when an attacker sends a series of SYN packets to a host. These packets usually originate from spoofed IP addresses. The constant flood of SYN packets keeps the server SYN queue full, which prevents it from servicing connection requests from legitimate users.
You can limit the number of embryonic connections to help prevent SYN flooding attacks. An embryonic connection is a connection request that has not finished the necessary handshake between source and destination.
When the embryonic connection threshold of a connection is crossed, the threat defense acts as a proxy for the server and generates a SYN-ACK response to the client SYN request using the SYN cookie method, so that the connection is not added to the SYN queue of the targeted host. The SYN cookie is the initial sequence number returned in the SYN-ACK that is constructed from MSS, time stamp, and a mathematical hash of other items to essentially create a secret. If the threat defense receives an ACK back from the client with the correct sequence number and within the valid time window, it can then authenticate that the client is real and allow the connection to the server. The component that performs the proxy is called TCP Intercept.
Setting connection limits can protect a server from a SYN flood attack. You can optionally enable TCP Intercept statistics and monitor the results of your policy. The following procedure explains the end-to-end process.
Before you begin
-
Ensure that you set the embryonic connection limit lower than the TCP SYN backlog queue on the server that you want to protect. Otherwise, valid clients can no longer access the server during a SYN attack. To determine reasonable values for embryonic limits, carefully analyze the capacity of the server, the network, and server usage.
-
Depending on the number of CPU cores on your Secure Firewall Threat Defense device model, the maximum concurrent and embryonic connections can exceed the configured numbers due to the way each core manages connections. In the worst case scenario, the device allows up to n-1 extra connections and embryonic connections, where n is the number of cores. For example, if your model has 4 cores, if you configure 6 concurrent connections and 4 embryonic connections, you could have an additional 3 of each type. To determine the number of cores for your model, enter the show cpu core command in the device CLI.
Procedure
Step 1 | Create the extended ACL that defines the traffic class, which is the list of servers you want to protect. For example, to define a traffic class to protect the web servers with the IP addresses 10.1.1.5 and 10.1.1.6:
| ||
Step 2 | Configure the service policy rule that sets embryonic connection limits. For example, to set the total concurrent embryonic limit to 1000 connections, and the per-client limit to 50 connections, do the following:
| ||
Step 3 | (Optional.) Configure the rates for TCP Intercept statistics. TCP Intercept uses the following options to determine the rate for collecting statistics. All options have default values, so if these rates suit your needs, you can skip this step.
If you want to adjust these options, do the following:
| ||
Step 4 | Enable TCP Intercept statistics. You must configure a FlexConfig policy to enable TCP Intercept statistics. | ||
Step 5 | You can now deploy the changes to the affected devices. | ||
Step 6 | Monitor the TCP Intercept statistics from the device CLI using the following commands:
Example:
|