All Products
Search
Document Center

Anti-DDoS:Cloud service interaction

Last Updated:Oct 22, 2026

Cloud service interaction uses a custom rule to combine Anti-DDoS Proxy with Alibaba Cloud public IP resources. It removes the extra latency that normal service access incurs after your website is added to Anti-DDoS Proxy.

Applicable scope

  • Your service uses Alibaba Cloud public IP resources, specifically Elastic Compute Service (ECS) instances or Server Load Balancer (SLB) instances that have public IP addresses, elastic IP addresses (EIPs), and Web Application Firewall (WAF).

  • You have purchased Anti-DDoS Proxy (Chinese Mainland) - Profession or Anti-DDoS Proxy (Outside Chinese Mainland) - Insurance or Unlimited.

    Important

    The clean bandwidth, QPS, and other specifications of the Anti-DDoS Proxy instance must meet the protection requirements of your normal service. For more information, see Purchase an Anti-DDoS Proxy instance.

  • Your website service is added to an Anti-DDoS Proxy instance for protection. For more information, see Add a website configuration.

  • You have verified that the Anti-DDoS Proxy instance forwards service traffic correctly. For more information, see Locally validate your forwarding configuration.

Background information

After your service is added to Anti-DDoS Proxy, all service traffic is forwarded through Anti-DDoS Proxy by default. Attack traffic is discarded after traffic scrubbing, and only normal service traffic is forwarded to the origin server. During normal service access when no attack occurs, normal service traffic also passes through Anti-DDoS Proxy, which adds a small amount of latency to service access.

To avoid the extra latency during normal service access, create a cloud service interaction rule in Sec-Traffic Manager. Traffic then goes directly to the origin server without extra latency during normal access, and switches to Anti-DDoS Proxy only when your service is under attack. Anti-DDoS Proxy then scrubs traffic and forwards it to the origin server.

How a cloud service interaction rule works

The cloud service interaction solution uses DNS-based intelligent resolution to schedule traffic dynamically and adjusts the traffic path based on the security status of your cloud resources.

Important
  • The cloud service interaction solution switches traffic by using DNS scheduling. When a cloud asset enters blackhole filtering, it becomes inaccessible.

  • Your service is affected during the switching process. The interruption duration depends on how long the client-side local DNS cache takes to refresh.

  • Normal state (no attack): Service traffic does not pass through Anti-DDoS Proxy for traffic scrubbing. Traffic goes directly from the client to the cloud resource.

    • Traffic path: client → cloud resource (direct access).

    • How it works: when the cloud resource is not under a DDoS attack, service traffic bypasses the Anti-DDoS Proxy scrubbing node. Traffic is resolved directly from the client to the cloud resource IP address, which ensures minimal latency and optimal performance.

  • Attack state (traffic scrubbing triggered): Traffic automatically switches to Anti-DDoS Proxy for traffic scrubbing, so that only normal service traffic is forwarded to the cloud resource.

    Note

    You can also switch traffic to Anti-DDoS Proxy manually. For more information, see Traffic switching.

    • Trigger condition: the monitoring system detects that the cloud resource is under a DDoS attack and that all cloud resource IP addresses enter blackhole filtering.

    • Traffic path: client → Anti-DDoS Proxy (traffic scrubbing) → cloud resource.

    • How it works:

      1. The system automatically updates the DNS record to point your domain name to the CNAME address of Anti-DDoS Proxy.

      2. Service traffic is directed to the Anti-DDoS Proxy cluster for malicious traffic scrubbing.

      3. Only normal service traffic is forwarded back to the cloud resource, which ensures service continuity.

  • Recovery state (automatic switchback)

    • Trigger condition: the DDoS attack ends and traffic stays stable for a period of time.

    • How it works:

      1. After the attack stops, Anti-DDoS Proxy enters a switchback waiting period (the configurable Fallback Time) to check whether the attack rebounds.

      2. When the waiting period ends, the system automatically restores the DNS record to the cloud resource IP address.

      3. Service traffic connects directly to the cloud resource again and exits the Anti-DDoS Proxy scrubbing mode.

Configure a cloud service interaction rule

  1. Log on to the Anti-DDoS Proxy console.

  2. In the top navigation bar, select the region of your instance.

    • Anti-DDoS Proxy (Chinese Mainland): Choose the Chinese Mainland region.

    • Anti-DDoS Proxy (Outside Chinese Mainland): Choose the Outside Chinese Mainland region.

  3. In the left-side navigation pane, choose Onboarding > Sec-Traffic Manager.

  4. For the Cloud Service Interaction scenario, on the General Interaction tab, click Create Rule.

  5. In the Create Rule panel, on the Cloud Service Interaction tab, configure the following parameters and click Next.

    Parameter

    Description

    Interaction Scenario

    Select Cloud Service Interaction.

    Rule Name

    The rule name can contain letters, digits, and underscores (_) and cannot exceed 128 characters in length.

    Anti-DDoS Pro or Anti-DDoS Premium Instance

    Select the Anti-DDoS Proxy instance that you want to associate with the rule.

    Resource for Interaction

    Enter the IP Address of Cloud Resource that you want to associate with the rule. You can use an ECS instance IP address, an SLB instance IP address, a WAF instance IP address, or an EIP.

    Click Add IP Address of Cloud Resource to add multiple cloud resources. You can add up to 20 IP addresses.

    Note
    • If you add multiple cloud resource IP addresses, they are associated with a single Anti-DDoS Proxy IP address. When a DDoS attack occurs on one cloud resource IP address, the other cloud resource IP addresses are used first. Traffic switches to Anti-DDoS Proxy for protection only when no cloud resource IP address is available.

    • If you want multiple cloud resources to share traffic and each resource to switch to Anti-DDoS Proxy independently when it is attacked, see Multi-path failover.

    Fallback Time

    The waiting time before the switchback process (switching traffic back to the cloud resource IP addresses) can be triggered after service traffic is switched to Anti-DDoS Proxy for protection. After the attack ends and this waiting time elapses, service traffic automatically switches back to the cloud resource IP addresses.

    Valid values: 30 to 120 minutes. The recommended value is 60 minutes.

  6. Update the DNS configuration: To ensure that the interaction rule in Sec-Traffic Manager takes effect, complete the DNS configuration changes as prompted on the page.

    1. Local verification: (Strongly recommended) Before you update the public DNS records, modify the hosts file on your local computer to simulate the resolution change and verify the traffic rerouting rule. This helps you avoid incompatibility issues caused by inconsistent back-to-origin policies. The following are typical risk cases:

      Note

      For more information about how to verify a traffic rerouting rule, see Locally validate your forwarding configuration.

      • Scenario: CDN + Anti-DDoS Proxy + OSS interaction

      • Potential conflict:

        • CDN: supports customizing the Back-to-origin HOST so that the OSS bucket is correctly identified.

        • Anti-DDoS Proxy: does not support modifying the back-to-origin HOST and uses the Host header in the request by default.

      • Symptom: When an attack triggers an automatic switchover to Anti-DDoS Proxy, the Host header passed through by Anti-DDoS Proxy does not match what OSS expects. OSS cannot identify normal traffic, which causes service access failures.

    2. Update the DNS record: After you complete the local verification and confirm that everything works as expected, perform the actual DNS change. Update the DNS record of your domain name to point to the CNAME address provided by Sec-Traffic Manager. Follow the instructions for your domain name registrar:

      Domain name registrar

      Instructions

      Alibaba Cloud

      Log on to the Alibaba Cloud DNS console and update the record.

      Third-party platform

      Log on to the management platform of the third-party registrar where your domain name is registered and update the DNS record of the domain name.

    3. Verify the result: After you update the DNS record, use a browser to test whether your website is accessible.

      Note

Traffic switching

To meet the flexibility requirements of different service scenarios, Cloud Service Interaction rules support two switching modes:

Note

Both the automatic mode and the manual mode rely on updates to the underlying DNS scheduling mechanism during switching. The switching process may be affected by network convergence time. (Recommended) Evaluate the tolerance of your service in advance.

Switching mode

Description

Scenarios

Automatic switchover

Based on real-time traffic monitoring and attack characteristics, the system automatically switches to or exits the Anti-DDoS Proxy mode.

Delivers unattended automated protection around the clock without manual intervention.

Manual switchover

You can manually trigger a switchover or a switchback in the console based on service forecasts, drill requirements, or special security events.

  • Preventive switching before major events.

  • Complex attack scenarios that are not covered by automatic policies.

  • Fault troubleshooting and emergency drills.

Automatic switchover

Switching type

Trigger condition

Switch from a cloud asset to Anti-DDoS Proxy

All IP addresses of cloud resources enter blackhole filtering.

Switch back from Anti-DDoS Proxy to a cloud asset

After the attack on the cloud asset ends, the system waits for a period of time (Fallback Time), and then automatically switches service traffic back to the cloud resource.

Manual switchover

In addition to automatic switchover, you can manually switch service traffic to Anti-DDoS Proxy for traffic scrubbing or switch it back to the cloud resource based on your service protection requirements.

Operation

Description

Limits

Switch to Anti-DDoS

  1. On the Sec-Traffic Manager page, click the General Interaction tab. Locate the rule whose Interaction Scenario is Cloud Service Interaction and for which Anti-DDoS Proxy traffic scrubbing has not been automatically triggered (under Resource for Interaction, the Green icon appears).

  2. In the Actions column of the rule, click Switch to Anti-DDoS to manually switch service traffic to Anti-DDoS Proxy for traffic scrubbing.

  • You cannot switch a cloud resource to Anti-DDoS Proxy for protection when the Anti-DDoS Proxy instance is in blackhole filtering status, or when the Fallback Time has not elapsed since the blackhole filtering event started.

  • After you manually switch service traffic to Anti-DDoS Proxy, traffic does not automatically switch back to the Resource for Interaction by default. You can only use the Switchback operation to switch traffic back to the Resource for Interaction.

Switchback

  1. On the Sec-Traffic Manager page, click the General Interaction tab. Locate the rule whose Interaction Scenario is Cloud Service Interaction and whose service traffic is already scrubbed by Anti-DDoS Proxy (under Anti-DDoS Pro or Anti-DDoS Premium Instance, the Green icon appears)

  2. In the Actions column, click Switchback. In the dialog box that appears, confirm the information and click OK to switch service traffic back to the Resource for Interaction.

Note

Before you perform a switchback, make sure that the attack has ended and that the line of the Resource for Interaction to switch back to is available. This prevents service interruptions caused by a Resource for Interaction in sandbox status.

  • If all Resources for Interaction are in blackhole filtering, you cannot perform the Switchback operation to avoid security risks.

  • After blackhole filtering is deactivated, you can immediately perform a manual Switchback. The Fallback Time limit does not apply. If blackhole filtering has been deactivated for some Resources for Interaction but not for others:

    1. Traffic switches back first to the Resources for Interaction whose blackhole filtering has been deactivated.

    2. The other resources wait for blackhole filtering to be deactivated and then automatically resume traffic.

Other operations

After you add a General Interaction rule, you can perform the following operations on the added rules in the rule list.

Operation

Description

Edit

Edit a General Interaction rule. You can modify the parameter settings other than Interaction Scenario and Rule Name.

Delete

Delete a General Interaction rule.

Warning

Before you delete an interaction rule, make sure that the DNS record of your website domain name does not point to the Sec-Traffic Manager CNAME. Otherwise, your website becomes inaccessible after the interaction rule is deleted.