All Products
Search
Document Center

Web Application Firewall:Configure CloudMonitor notifications

Last Updated:Mar 31, 2026

CloudMonitor integrates with Web Application Firewall (WAF) to send alerts when WAF detects attacks or when service metrics cross a threshold you define. This topic explains how to set up alert contacts, configure event-triggered alerts for attack events, and configure threshold-based alerts for service metrics.

Alert types at a glance:

Alert typeWhat it monitorsWhere to configure
Attack eventsA notification each time WAF detects a specific attack type (for example, an HTTP flood or a web attack).Event Center > System Event
Service metricsA notification when a measured metric—such as QPS or the block rate—crosses a threshold you define.Alerts > Alert Rules
Custom metricsCustom metrics defined in Simple Log Service (SLS).See Overview

Prerequisites

Before you begin, ensure that you have:

  • A website added to WAF. For more information, see Tutorial

Create an alert contact and an alert contact group

Alert contacts are the people who receive notifications. Organize them into contact groups, then assign a group when creating any alert rule.

  1. Log on to the CloudMonitor console.

  2. In the left-side navigation pane, choose Alerts > Alert Contacts.

  3. Create an alert contact.

    1. On the Alert Contacts tab, click Create Alert Contact.

    2. In the Set Alert Contact panel, enter the name, email address, and webhook URL of the contact. Leave Language of Alert Notifications set to the default value Automatic.

      Note

      Automatic means CloudMonitor selects the notification language based on the language used to create your Alibaba Cloud account.

    3. Click OK.

  4. Create an alert contact group.

    1. On the Alert Contact Group tab, click Create Alert Contact Group.

    2. In the Create Alert Contact Group panel, enter a group name, select the contacts to include, and then click Confirm.

  5. (Optional) Add contacts to a group in bulk.

    1. On the Alert Contacts tab, select the contacts you want to add, and then click Add to Contact Group.

    2. In the Add to Contact Group dialog box, select the target group and click Confirm.

Configure monitoring and alerting for attack events

Set up event-triggered alert rules to receive notifications when WAF detects specific attack events. When you receive an alert, go to the Event Monitoring tab in the CloudMonitor console to view recent events and identify the attack.

  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 Old Event Alarm Rules in the upper-right corner, and then click Create Alert Rule.

  4. In the Create/Modify Event-triggered Alert Rule panel, configure the parameters and click OK.

    ParameterDescription
    Alert Rule NameThe name of the event-triggered alert rule.
    Product TypeThe cloud service. Select Web Application Firewall (WAF).
    Event TypeThe category of event to monitor. Valid values: Attack, Exceed, and Event.
    Event LevelThe severity level that triggers alerts. All WAF events are classified as CRITICAL.
    Event NameThe specific event to monitor. Event names that contain v3 are WAF 3.0 events. All other events are WAF 2.0 events. For the full list of WAF 2.0 events, see Attack events that can be monitored by CloudMonitor.
    Keyword FilteringFilters events by keyword before sending alerts. Contains any of the keywords: suppress alerts when the event matches a keyword. Does not contain any of the keywords: suppress alerts when the event does not match a keyword.
    SQL FilterSQL statements used for additional filtering.
    Resource RangeThe resources this rule covers. Valid values: All Resources and Application Groups.
    Alert Contact GroupThe contact groups that receive alert notifications.
    Notification MethodThe severity level and delivery channels for notifications. Valid values: Critical (Phone Call + SMS Message + Email + Webhook), Warning (SMS Message + Email + Webhook), Info (Email + Webhook).
    SMQThe Simple Message Queue (SMQ, formerly MNS) queue to receive alert deliveries.
    Function ComputeThe Function Compute function to receive alert deliveries.
    URL CallbackA publicly accessible HTTP URL. CloudMonitor sends HTTP POST requests to push alert notifications to this URL. Only HTTP is supported. For configuration steps, see Configure callbacks for system event-triggered alerts (old).
    Simple Log ServiceThe SLS Logstore to receive alert deliveries.
    Mute PeriodHow long CloudMonitor waits before resending an alert that has not been cleared. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3 Hours, 6 Hours, 12 Hours, and 24 Hours.

After the rule is saved, the contacts in the specified groups receive notifications whenever WAF detects the configured attack events.

To view recent attack events, on the Event Monitoring tab, select Web Application Firewall (WAF) from the All Products drop-down list, select an event name that does not contain v3 from the Select Event Name drop-down list, and then click Search.

WAF event monitoring

Configure monitoring and alerting for service metrics

Set up threshold-based alert rules to receive notifications when a WAF service metric crosses a value you define. When you receive an alert, check the Alert Rules page to identify which metric triggered the rule.

  1. Log on to the CloudMonitor console.

  2. In the left-side navigation pane, choose Alerts > Alert Rules.

  3. On the Alert Rules page, click Create Alert Rule.

  4. In the Create Alert Rule panel, configure the parameters and click Confirm.

    ParameterDescription
    ProductSelect Web Application Firewall (WAF) from the drop-down list.
    Resource RangeThe resources this rule covers. Valid values: All Resources (all WAF resources), Application Groups (all resources in a specified application group), Instances (specific WAF resources).
    Rule DescriptionThe alert condition. Click Add Rule, and in the Config Rule Description panel configure the alert rule, metric type, metric, threshold, and alert level. For the list of available service metrics, see Service metrics that can be monitored by CloudMonitor.
    Mute PeriodHow long CloudMonitor waits before resending an active alert. Valid values: 5 Minutes, 15 Minutes, 30 Minutes, 60 Minutes, 3 Hours, 6 Hours, 12 Hours, and 24 Hours. If the alert condition is met again within the mute period, CloudMonitor suppresses the duplicate notification.
    Effective PeriodThe time window during which CloudMonitor monitors the resources and generates alerts.
    Alert Contact GroupThe contact groups that receive alert notifications.
    Alert CallbackA publicly accessible HTTP URL. CloudMonitor sends HTTP POST requests to push alert notifications to this URL. Only HTTP is supported. For configuration steps, see Use the alert callback feature to send notifications about threshold-triggered alerts. Click Advanced Settings to configure this parameter.
    Auto ScalingWhen enabled, triggers the specified scaling rule when an alert fires. Configure Region, ESS Group, and ESS Rule. For details, see Manage scaling groups and Configure scaling rules. Click Advanced Settings to configure this parameter.
    Simple Log ServiceWhen enabled, writes alert data to a specified SLS Logstore. Configure Region, ProjectName, and Logstore. For details, see Getting started. Click Advanced Settings to configure this parameter.
    Simple Message Queue (formerly MNS) - TopicWhen enabled, writes alert data to a specified MNS topic. Configure Region and topicName. For details, see Create a topic. Click Advanced Settings to configure this parameter.
    Method to handle alerts when no monitoring data is foundHow to handle the alert state when data is unavailable. Valid values: Do not do anything (default), Send alert notifications, Treated as normal. Click Advanced Settings to configure this parameter.
    TagA name-value tag attached to the alert rule.

After the rule is saved, find it on the Alert Rules page by selecting Web Application Firewall (WAF) from the Product drop-down list and selecting a metric dimension from the Metric drop-down list.

Service metrics
Note

The Metric drop-down list controls which WAF version's metrics are displayed:

  • domain: WAF 2.0 metrics

  • resource: WAF 3.0 metrics

  • Instance: Hybrid Cloud WAF metrics. Metric names that contain v3 are WAF 3.0 metrics; all others are WAF 2.0 metrics.

Configure monitoring and alerting for custom metrics

Use Simple Log Service to configure monitoring and alerting for custom metrics. For more information, see Overview.

Attack events that can be monitored by CloudMonitor

CloudMonitor can monitor web attacks, HTTP flood attacks, scan attacks, and access control events on domain names added to WAF. All WAF events have a severity level of CRITICAL.

Event typeEvent nameDescriptionEvent statusSeverity level
Attackwaf_event_aclattackAn access control event occurs.aclCritical
Exceedwaf_event_bandwidth_exceedThe bandwidth exceeds the upper limit.overrunCritical
Attackwaf_event_ccattackAn HTTP flood attack occurs.ccCritical
Exceedwaf_event_qps_exceedThe number of queries per second (QPS) exceeds the upper limit.overrunCritical
Attackwaf_event_webattackA web attack occurs.webCritical
Attackwaf_event_webscanA scan attack occurs.webscanCritical

Service metrics that can be monitored by CloudMonitor

CloudMonitor can monitor WAF service metrics for domain names added to WAF. All metrics have a domain name dimension.

MetricDescriptionRemarks
4XX_ratioProportion of HTTP 4xx status codes returned per minute. Excludes HTTP 405.Displayed as a decimal.
5XX_ratioProportion of HTTP 5xx status codes returned per minute.Displayed as a decimal.
acl_blocks_5mNumber of requests blocked by access control policies in the previous 5 minutes.
acl_rate_5mProportion of requests blocked by access control policies in the previous 5 minutes.Displayed as a decimal.
cc_blocks_5mNumber of requests blocked by HTTP flood protection in the previous 5 minutes.
cc_rate_5mProportion of requests blocked by HTTP flood protection in the previous 5 minutes.Displayed as a decimal.
waf_blocks_5mNumber of requests blocked by web application attack prevention in the previous 5 minutes.
waf_rate_5mProportion of requests blocked by web application attack prevention in the previous 5 minutes.Displayed as a decimal.
QPSNumber of queries per second.
qps_ratioMinute-granularity growth rate of QPS.Displayed as a percentage.
qps_ratio_downMinute-granularity decrease rate of QPS.Displayed as a percentage.