Configuring a Known Attack Source Rule
If WAF blocks a malicious request by IP address, Cookie, or Params, you can configure a known attack source rule to let WAF automatically block all requests from the attack source for a blocking duration set in the known attack source rule. For example, if a blocked malicious request originates from IP address 192.168.1.1 and you set the blocking duration to 500 seconds, WAF will block the source IP address for 500 seconds after the known attack source rule takes effect.
If you have enabled enterprise projects, you can select your enterprise project from the Enterprise Project drop-down list and add protection policies for the domain names in the project.
Prerequisites
A website has been added to WAF.
Specification Limitations
- Only six blocking types are supported, and only one known attack source rule can be configured for each type.
- The maximum time an IP address can be blocked for is 30 minutes.
Constraints
- For a known attack source rule to take effect, it must be enabled when you configure basic web protection, precise protection, blacklist, or whitelist protection rules.
- It takes several minutes for a new rule to take effect. After the rule takes effect, protection events triggered by the rule will be displayed on the Events page.
- Before adding a known attack source rule for malicious requests blocked by Cookie or Params, a traffic identifier must be configured for the corresponding domain name. For more details, see Configuring a Traffic Identifier for a Known Attack Source.
Procedure
- Log in to the management console.
- Go to the protection policy configuration page by following the steps shown in Figure 1.
- In the Known Attack Source configuration area, change Status if needed and click Customize Rule to go to the Known Attack Source page. Figure 2 shows an example.
- In the upper left corner of the known attack source rules, click Add Known Attack Source Rule.
- In the displayed dialog box, specify the parameters by referring to Table 1. Figure 3 shows an example.
Table 1 Known attack source parameters Parameter
Description
Example Value
Blocking Type
Specifies the blocking type. The options are:
- Long-term IP address blocking
- Short-term IP address blocking
- Long-term Cookie blocking
- Short-term Cookie blocking
- Long-term Params blocking
- Short-term Params blocking
Long-term IP address blocking
Blocking Duration (s)
The blocking duration must be an integer and range from:
- (300, 1800] for long-term blocking
- (0, 300] for short-term blocking
500
Rule Description
A brief description of the rule. This parameter is optional.
None
- Click OK. You can then view the added known attack source rule in the list. Figure 4 Known attack source rules
Other Operations
- To modify a rule, click Modify in row containing the rule.
- To delete a rule, click Delete in the row containing the rule.
Example Configuration
Protection Effect
If you add a website to WAF, to verify WAF is protecting your website (www.example.com) against the configured rule:
- Clear the browser cache and enter the domain name in the address box of a browser to check whether the website is accessible.
- If the website is inaccessible, connect the website domain name to WAF by following the instructions provided in Step 3: Routing Website Traffic to WAF.
- If the website is accessible, go to 2.
- Set Mode to Block by referring to Configuring Basic Web Protection Rules and select Long-term IP address blocking for Known Attack Source. Figure 6 Specifying known attack source
- Clear the browser cache. If a malicious crawler is detected on http://www.example.com web pages, WAF will block the malicious crawler and the IP address from where the crawler originates for 500 seconds. To view protection records, in the navigation pane on the left, choose Events.Figure 7 Viewing known attack source protection events
Last Article: Configuring an IP Address Blacklist or Whitelist Rule
Next Article: Configuring a Geolocation Access Control Rule


Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.