Use the Rule Libraries page in Web Application Firewall (WAF) 3.0 to view system protection rules and configure custom protection rules for hybrid cloud protection. This topic describes how to configure your custom protection rules.
System protection rules
The Alibaba Cloud security team maintains and updates system protection rules. These rules are view-only.
Log on to the WAF 3.0 console. In the top navigation bar, select the resource group and region of your WAF instance (Chinese Mainland or Outside Chinese Mainland). In the left-side navigation pane, choose .
Click the System Protection Rules tab. The left side of the tab displays rule information, and the right side displays the rule update status.
Custom protection rules
Custom protection rules apply only to assets protected by hybrid cloud protection. You can create, view, edit, and delete custom rules on the Rule Libraries page.
Create custom protection rule
Log on to the WAF 3.0 console. In the top navigation bar, select the resource group and region of your WAF instance (Chinese Mainland or Outside Chinese Mainland).
In the left-side navigation pane, choose .
On the Custom Protection Rules tab, click Create Rule. Configure the following parameters and click OK.
Parameter
Description
Rule Name
The name of the rule. The name can contain Chinese characters, letters, digits, periods (.), underscores (_), and hyphens (-).
Module Name
The type of attack that the rule detects. Supported modules include SQL Injection, XSS, Code Execution, CRLF, Local File Inclusion, Remote File Inclusion, webshell, Others, OS Command Injection, Expression Injection, Java Deserialization, PHP Deserialization, SSRF, Path Traversal, Protocol Non-compliance, Arbitrary File Upload, and File Inclusion.
Rule Level
The sensitivity level of the rule. Valid values: Loose, Medium, Strict, and Super Strict.
Status
The rule is disabled by default and must be enabled on the engine configuration page of a protection template.
Rule Action
The default action for a new rule is Block. You can change this action in the engine configuration of the Core Web Protection rule template.
Rule Description
A description of the rule's conditions and purpose. This parameter is optional.
Match Field
Defines the request characteristics that trigger the rule.
You can add up to 10 conditions to a rule. If you define multiple conditions, a request must meet all of them to match the rule.
Each condition consists of a Match Field, a Logical Operator, and Match Content. The following provides some examples:
Example 1: Set Match Field to URI, Logical Operator to Contains, and Match Content to
/login.php. A request matches the rule if its path contains/login.php.Example 2: Set Match Field to IP, Logical Operator to Belongs to, and Match Content to
192.1X.XX.XX. A request matches the rule if the client IP address is192.1.XX.XX.
For more information about match fields and logical operators, see Match conditions.
NoteAn Alibaba Cloud account, including its RAM users, can create a maximum of 200 custom rules.
If the The operation is successful. message appears, the rule is created.
Enable custom protection rule
After you create a custom protection rule, you must enable it in the engine configuration to apply it to the protected assets in your hybrid cloud deployment.
In the left-side navigation pane, choose . On the Core Web Protection page, find the target Rule Templates in the Core Protection Rule section and click Actions in the Edit column.
In the Edit panel, click Configure Engine. Go to the Custom Protection Rules tab, find your target rule, and turn on its Status switch.
Edit custom protection rule
On the Custom Protection Rules tab, find the rule that you want to modify and click Edit in the Actions column. In the Edit Rule dialog box, you can modify the rule name, rule level, rule status, rule description, and match conditions. After you finish editing, click OK. After a success message appears, the updated rule information is displayed on the page.
Delete custom protection rule
On the Custom Protection Rules tab, find the rule that you want to delete and click Delete in the Actions column.
Deleting a rule removes it from the detection engine and deactivates it immediately, regardless of its previous status.