All Products
Search
Document Center

Anti-DDoS:DDoS attack mitigation solutions

Last Updated:Oct 22, 2026

A distributed denial-of-service (DDoS) attack is a malicious network attack against a target system. DDoS attacks often make the services of the attacked party inaccessible, which is known as a denial of service.

Common attack types

Attack type

Common methods

Attack characteristics

Network-layer attack

UDP reflection attacks, such as NTP flood attacks.

Uses high-volume traffic to congest the network bandwidth of the attacked party, which prevents their services from responding to customer requests.

Transport-layer attack

SYN flood attacks and connection flood attacks.

Occupies the connection pool resources of the server to achieve a denial of service.

Session-layer attack

SSL connection attacks

Occupies the SSL session resources of the server to achieve a denial of service.

Application-layer attack

DNS flood attacks, HTTP flood attacks (also known as CC attacks), and game bot attacks.

Occupies the application processing resources of the server and consumes server compute resources to achieve a denial of service.

Solutions

System hardening

  • Minimize the attack surface

    • Purpose: Reduce the entry points through which your service can be scanned and attacked.

    • Operations: Go to the ECS console, find the security group associated with the instance, and create security group rules. For more information about security groups, see Create a security group.

    • Example: The following are the security group rules of a web server:

      • Open only ports 80 and 443 to the Internet.

      • Open remote management ports 22 or 3389 only to specific IP addresses, such as those of your office network.

      • If a Server Load Balancer (SLB) instance or an Anti-DDoS Proxy instance is deployed in front of the origin server, configure the security group to allow only traffic from the back-to-origin IP address ranges of these services.

  • Use a Virtual Private Cloud (VPC)

    • Purpose: Keep the network logically isolated and prevent attack traffic from spreading within the internal network.

    • Operations: Use a VPC to keep the internal network logically isolated and prevent attacks from compromised internal machines. For more information, see What is VPC.

  • Server security hardening

    • Purpose: Improve the ability of the server to withstand connection-layer attacks and slow down resource exhaustion.

    • Operations:

      • System upgrades: Make sure that the operating system and the application software are up to date, and apply security patches promptly.

      • Access and service control:

        • Review access sources and shut down the services and ports that are not required. For example, a web server should expose only port 80.

        • Restrict file sharing from external networks to prevent core files from being tampered with.

      • Network policy optimization:

        • Configure mitigation policies on the router, such as traffic shaping, packet filtering, dropping data packets with spoofed sources, SYN thresholds, and disabling ICMP and UDP broadcasts.

        • Use software firewalls such as iptables to limit new TCP connections from suspicious IP addresses, and to limit the number of connections and the transmission rate of suspicious IP addresses.

        • Limit the number of SYN half-open connections, shorten their timeout period, and rate-limit specific types of traffic such as SYN and ICMP.

      • Log monitoring: Carefully review the system logs of network devices and servers to promptly detect vulnerabilities or signs of an attack.

Optimize the service architecture

  • Evaluate the performance of the service architecture

    Before or during service deployment, the technical team should run stress tests on the service architecture to evaluate the throughput capacity of the existing architecture. This provides detailed technical parameters as guidance for DDoS defense.

  • Deploy Server Load Balancer (SLB)

    • Purpose: Improve the throughput capacity of the service through traffic distribution and avoid a single point of failure. User access traffic is evenly distributed across servers, which reduces the load on each individual server and improves the overall throughput capacity of the service.

    • Operations: Use a Server Load Balancer (SLB) instance as the entry point of service traffic and attach multiple ECS servers to the backend. For instructions, see Quickly enable load balancing for IPv4 services.

  • Reserve redundant bandwidth:

    • Purpose: Prevent normal traffic spikes or small-scale attacks from saturating the bandwidth and affecting regular users.

    • Operations: Evaluate the daily peak bandwidth of your service. For example, get the P95 bandwidth value of the last 30 days from Cloud Monitor. Then reserve additional capacity on top of that value based on your cost budget, such as 50% to 100%.

  • Configure Auto Scaling:

    • Purpose: Automatically add servers to improve processing capacity when application-layer attacks, such as CC attacks, cause high CPU utilization or memory usage.

      Note

      Auto Scaling is not effective against network-layer attacks. You must set a maximum number of instances to prevent unlimited scaling from generating high costs during an attack.

    • Operations: Create a scaling group and configure scaling rules. For example, "Add one ECS instance when the average CPU utilization exceeds 75% for three consecutive minutes." For more information, see What is Auto Scaling?.

  • Optimize DNS resolution

    • Purpose: Use intelligent DNS resolution to effectively avoid the risks caused by DNS flood attacks.

    • Operations:

      • Service redundancy: Host your service with multiple DNS providers to achieve high availability for DNS resolution.

      • Traffic filtering:

        • Drop unsolicited DNS responses, queries from unknown sources, and burst requests.

        • Drop abnormal fast retransmission data packets.

      • Access control:

        • Apply access control lists (ACLs), BCP38 (source address validation), and IP reputation features to restrict malicious sources.

        • Enable the DNS client validation mechanism.

      • Efficiency optimization:

        • Configure a reasonable time-to-live (TTL) value.

        • Enable DNS response caching to reduce the load on the origin server.

Purchase professional security services (as needed)

Service

Protection description

Applicable scenarios

Web Application Firewall (WAF)

WAF effectively defends against connection-layer attacks, session-layer attacks, and application-layer attacks, including common HTTP flood attacks. For more information, see What is WAF?.

HTTP/HTTPS services such as websites, APIs, and H5 pages.

Anti-DDoS Native

Provides shared unlimited protection against DDoS attacks for the IP addresses of cloud services, and takes effect immediately. For more information, see What is Anti-DDoS Native?.

All types of services that are already deployed on Alibaba Cloud and want to improve Anti-DDoS Basic mitigation capacity and avoid blackholes.

Anti-DDoS Proxy

Defends against high-volume network-layer, transport-layer, and application-layer attacks. For more information, see What is Anti-DDoS Proxy?. For more information,

Services that are prone to extremely high-volume attacks, such as games, critical finance applications, and e-commerce platforms.

Set up business monitoring

  • Anti-DDoS Basic monitoring:

    • When your service is under a DDoS attack, Anti-DDoS Basic sends alert notifications by text message and email by default.

      Note

      To configure alert message recipients, see Set up alerts for Anti-DDoS Basic and Native.

    • In the Traffic Security console, go to “Event Center” to view ongoing attack events, attack types, and traffic peaks.

  • Cloud Monitor: Cloud Monitor collects monitoring metrics for Alibaba Cloud resources and custom monitoring metrics defined by users, probes service availability, and supports alerts based on metrics. For more information, see What is CloudMonitor.

Going live

DDoS attacks can harm the stability of the entire network environment. To maintain shared network resources and keep the services of all users available, note the following rules of conduct:

  • Avoid using the mechanisms of cloud services, including but not limited to OSS, DNS, ECS, SLB, and EIP, to build and provide DDoS defense services on the cloud.

  • Avoid releasing instances that are in blackhole filtering status.

  • Avoid continuously replacing, detaching, or adding IP-based products such as SLB IP addresses, elastic IP addresses (EIPs), and NAT Gateways for servers that are in blackhole filtering status.

  • Avoid defending by building an IP pool or by spreading attack traffic across a large number of IP addresses.

  • Avoid using Alibaba Cloud products that are not designed for network security defense, such as CDN and OSS, as a front for services that are under attack.

  • Avoid using multiple accounts to bypass the preceding rules.