All Products
Search
Document Center

Anti-DDoS:Best practices for automatic deactivation of blackhole filtering

Last Updated:Mar 31, 2026

Even after adding an asset to an Anti-DDoS Origin paid edition instance, volumetric DDoS attacks can still trigger blackhole filtering, which blocks all inbound traffic to the affected IP address. The faster you deactivate blackhole filtering, the shorter the service interruption.

Manual deactivation in the Traffic Security console (see Deactivate blackhole filtering) introduces delays and is error-prone. For services that require high availability, set up automatic deactivation instead: configure a CloudMonitor alert to detect blackhole events on your Anti-DDoS Origin instance, then attach a custom rule that calls the DeleteBlackhole API operation as soon as the event fires.

Prerequisites

Before you begin, make sure you have:

Note: This solution requires calling an API operation of Anti-DDoS Origin and is available only for Anti-DDoS Origin instances. CloudMonitor sends blackhole filtering notifications only for assets added to Anti-DDoS Origin paid edition instances. In other scenarios, no messages about blackhole filtering are sent.

How it works

The automation pipeline has two stages:

  1. Detect: CloudMonitor monitors system events from your Anti-DDoS Origin instance. When blackhole filtering is triggered on a protected IP address, CloudMonitor generates an alert and pushes an event message through your configured notification channel.

  2. Respond: A custom rule attached to the alert automatically calls the DeleteBlackhole API operation to deactivate blackhole filtering without manual intervention.

Set up automatic deactivation

Step 1: Create a CloudMonitor alert rule

  1. Log on to the CloudMonitor console.

  2. In the left-side navigation pane, choose Event Center > System Event.

  3. On the Event Monitoring tab, click Save as Alert Rule.

  4. In the Create/Modify Event-triggered Alert Rule panel, set the following fields:

    FieldValue
    Product Typeddosbgp
    Event TypeDDoS Attacks
    Event LevelCRITICAL
    Event Nameddosbgp_event_blackhole

    For all other parameters, see Manage system event-triggered alert rules.

  5. Select a notification channel, then save the rule.

When blackhole filtering is triggered on a protected asset, CloudMonitor pushes an event message through the channel you selected. The message has the following structure:

{
    "action": "add",
    "bps": 0,
    "pps": 0,
    "instanceId": "ddosbgp-cn-78v17******",
    "ip": "47.*.*.*",
    "regionId": "cn-hangzhou",
    "time": 1564104493000,
    "type": "blackhole"
}

Alert message fields:

FieldTypeDescription
actionstringEvent state. add means the event started; del means the event ended.
bpsnumberThroughput when the event was triggered. Unit: Mbit/s.
ppsnumberPacket rate when the event was triggered. Unit: packets per second (pps).
instanceIdstringID of the Anti-DDoS Origin instance.
ipstringIP address of the asset on which blackhole filtering was triggered.
regionIdstringID of the region where the Anti-DDoS Origin instance resides.
timenumberUnix timestamp (milliseconds) when the event began.
typestringEvent type. blackhole indicates a blackhole filtering event; defense indicates a traffic scrubbing event.

Step 2: Create a custom rule to call DeleteBlackhole

Create a custom rule to automatically deactivate blackhole filtering by calling the DeleteBlackhole API operation.

For the full API reference, including request parameters and response codes, see the DeleteBlackhole documentation.

What's next

As an alternative or complementary measure, create rules that call the Alibaba Cloud DNS (DNS) API to resolve your domain name to the IP address of an Anti-DDoS Pro or Anti-DDoS Premium instance during an attack.