Configure a whitelist

更新时间:
复制 MD 格式

Whitelist protection policies exempt trusted requests from all or specific protection modules, such as basic protection rules and custom rules.

Prerequisites

Create a whitelist policy

  1. Log on to the DCDN console.

  2. In the left-side navigation pane, choose WAF > Protection Policies.

  3. On the Protection Policies page, click Create Policy.

  4. On the Create Policy page, configure the following parameters.

    Section

    Parameter

    Description

    Policy information

    Policy type

    Select Whitelist.

    Policy name

    Enter a custom name for the policy. The name can be up to 64 characters long and can contain Chinese characters, uppercase and lowercase letters, digits (0-9), and underscores (_).

    Make default

    Specifies whether to use this policy as the default whitelist policy.

    Note
    • Once a policy is set as the default, this designation cannot be changed.

    • If a default policy already exists for this policy type, this switch is disabled.

    Rule information

    Rule

    Define the rules for this whitelist protection policy. For configuration details, see Whitelist rule parameters.

    Note

    You can add up to 10 rules. To increase this quota, contact your Alibaba Cloud account manager or submit a ticket.

    Protected domain names

    Select Association Mode

    You can associate a domain name with multiple policies of the same type. If the domain name is already associated with another policy of this type, you can add the new policy or replace the existing one. For domain names associated with a default policy, you can only replace the policy. Valid values:

    • Replace existing associated policies: Replaces existing policies associated with the domain name with the current policy.

    • Add to existing associated policies: Associates the domain name with the current policy while retaining existing associations. All associated policies take effect.

    Protected domain names

    Select the domain names to protect with this policy.

  5. Click Create Policy.

    By default, the new protection policy is enabled.

Whitelist rule parameters

You can create a whitelist rule when you create a whitelist protection policy, or add a rule to an existing policy.

白名单规则

Parameter

Description

Rule name

A custom name for the rule. The name can be up to 64 characters long and can contain Chinese characters, uppercase and lowercase letters, digits (0-9), and underscores (_).

Match condition

The request characteristics that trigger this rule.

Click Add Condition to add a condition. You can add up to five conditions to a single rule. If you define multiple conditions, the rule triggers only when all conditions are met.

Each condition consists of a match field, a logical operator, and match content. For configuration examples, see Match condition configuration examples.

For detailed information about match fields and logical operators, see Match conditions.

Module

The protection modules to bypass for requests that match the conditions. Valid values:

  • All modules: Matching requests bypass all protection modules and go directly to the origin server.

    Use this option for traffic you completely trust, such as requests from certified vulnerability scanners or authenticated third-party API calls.

  • Custom module: Matching requests bypass only the protection modules that you select.

    • Basic protection rule: Matching requests bypass the specified basic protection rules.

      After you select this option, specify which rules to ignore.

      • All rules: Ignores all rules. This is the default selection.

      • Specified basic web protection subrules: Ignores rules with the specified IDs.

        Enter the IDs of the rules to ignore. Rule IDs are six-digit numbers. You can enter up to 50 rule IDs, separated by commas (,).

      • Specified rule type: Ignores rules of the specified types. Types include: SQL injection, XSS, code execution, local file inclusion, remote file inclusion, webshell, Custom Rule, and Others.

    • Custom rule: Matching requests bypass custom rules.

    • IP blacklist: Matching requests bypass the IP blacklist.

    • Region blacklist: Matching requests bypass the region blacklist.

    • Bot management: Matching requests bypass bot management rules.

    • Scan protection: Matching requests bypass scan protection rules.

API reference