WAF allows you to customize protection rules by combining HTTP headers, cookies, URLs, request parameters, and client IP addresses.
You can combine common HTTP fields, such as IP, Path, Referer, User Agent, and Params in a protection rule to let WAF allow, block, or only log the requests that match the combined conditions.
A reference table can be added to a precise protection rule. The reference table takes effect for all protected domain names.
A website has been added to WAF.
Precise protection rules are used for anti-leeching and website management background protection.
The settings shown in Figure 3 are used as an example. If a visitor tries to access a URL containing /admin, WAF will block the request.
To ensure that WAF blocks only attack requests, configure Protective Action to Log only first and check whether normal requests are blocked on the Events page. If no normal requests are blocked, configure Protective Action to Block.
Parameter |
Description |
Example Value |
---|---|---|
Protective Action |
You can select Block, Allow, or Log only. Default value: Block |
Block |
Known Attack Source |
If you set Protective Action to Block, you can select a blocking type for a known attack source rule. Then, WAF blocks requests matching the configured IP, Cookie, or Params for a length of time that depends on the selected blocking type. |
Long-term IP address blocking |
Effective Date |
Select Immediate to enable the rule immediately, or select Custom to configure when you wish the rule to be enabled. |
Immediate |
Condition List |
Click Add to add conditions. At least one condition needs to be added. You can add up to 30 conditions to a protection rule. If more than one condition is added, all of the conditions must be met for the rule to be applied. A condition includes the following parameters: Parameters for configuring a condition are described as follows:
NOTE:
For more details about the configurations in general, see Table 2. |
Path Include /admin |
Priority |
Rule priority. If you have added multiple rules, rules are matched by priority. The smaller the value you set, the higher the priority. |
5 |
Rule Description |
A brief description of the rule. This parameter is optional. |
None |
Field |
Example Subfield |
Logic |
Example Content |
---|---|---|---|
Path: Part of a URL that does not include a domain name. This value supports exact matches only. For example, if the path to be protected is /admin, Path must be set to /admin. |
None |
Select a logical relationship from the drop-down list. |
/buy/phone/ NOTICE:
If Path is set to /, all paths of the website are protected. |
User Agent: A user agent of the scanner to be checked. |
None |
Mozilla/5.0 (Windows NT 6.1) |
|
IP: An IP address of the visitor for the protection. |
None |
XXX.XXX.1.1 |
|
Params: A request parameter. |
sttl |
201901150929 |
|
Referer: A user-defined request resource. For example, if the protected path is /admin/xxx and you do not want visitors to access the page from www.test.com, set Content to http://www.test.com. |
None |
http://www.test.com |
|
Cookie: A small piece of data to identify web visitors. |
name |
jsessionid |
|
Header: A user-defined HTTP header. |
Accept |
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 |
|
Method: the user-defined request method. |
None |
GET, POST, PUT, DELETE, and PATCH |
|
Request Line: Length of a user-defined request line. |
None |
50 |
|
Request: Length of a user-defined request. It includes the request header, request line, and request body. |
None |
None |
|
Protocol: the protocol of the request. |
None |
http |
If you have configured a precise protection rule as shown in Figure 3 for your domain name, to verify WAF is protecting your website (www.example.com) against the rule:
Analysis of a specific type of WordPress pingback attack shows that the User Agent field contains WordPress. See Figure 5.
A precise rule as shown in the figure can block this type of attack.