Both Anti-DDoS Pro and Anti-DDoS Premium allow you to create accurate access control rules for website services that they protect. After you enable Accurate Access Control, you can customize access control rules. These rules allow you to filter access requests based on commonly used HTTP fields, such as IP, URI, Referer, User-Agent, and Params. You can allow, block, or verify requests that match the rules. Accurate Access Control supports custom rules for different scenarios, such as hotlink protection and protection of the website management system.
Prerequisites
- The domain name of your website is added to Anti-DDoS Pro or Anti-DDoS Premium. For more information, see Add a website.
- Protection settings are enabled in Anti-DDoS Pro or Anti-DDoS Premium.
Background information
- Conditions specify the HTTP fields, logic operators, and field values to be matched.
The following table describes the HTTP fields supported by accurate access control
rules.
Note Different HTTP fields support different logical operators. For example, the source IP field supports the Is Part Of and Is Not Part Of logical operators. The URI field supports the Contains and Does Not Contain logical operators. For more information, see the Logical operator column in the following table.
Field Field description Supported logical operator IP The source IP address of the request. Is Part Of and Is Not Part Of URI The request URI. Contains, Does Not Contain, Equals, Does Not Equal, Is Shorter Than, Has a Length Of, and Is Longer Than User-Agent The information about the client browser that sends the request. Contains, Does Not Contain, Equals, Does Not Equal, Is Shorter Than, Has a Length Of, and Is Longer Than Cookie The cookie in the request. Contains, Does Not Contain, Equals, Does Not Equal, Is Shorter Than, Has a Length Of, Is Longer Than, and Does Not Exist Referer The source URL of the request, that is, the page from which the access request is redirected. Contains, Does Not Contain, Equals, Does Not Equal, Is Shorter Than, Has a Length Of, Is Longer Than, and Does Not Exist Content-Type The HTTP content type of the response specified by the request, that is, MIME type information. Contains, Does Not Contain, Equals, Does Not Equal, Is Shorter Than, Has a Length Of, and Is Longer Than X-Forwarded-For The actual client IP address of the request. Contains, Does Not Contain, Equals, Does Not Equal, Is Shorter Than, Has a Length Of, Is Longer Than, and Does Not Exist Content-Length The number of bytes in the request body. Value Less Than, Value Equals, and Value More Than Post-Body The content of the request. Contains, Does Not Contain, Equals, and Does Not Equal Http-Method The request method. Valid values: GET, POST, DELETE, PUT, OPTIONS, CONNECT, HEAD, and TRACE. Equals and Does Not Equal Header The request header that is used to customize the HTTP header fields and values. Contains, Does Not Contain, Equals, Does Not Equal, Is Shorter Than, Has a Length Of, Is Longer Than, and Does Not Exist Params The parameters in the request URI. The parameters follows a question mark ( ?
) in the URI. For example, the URIexample.aliyundoc.com/index.html? action=login
contains a parameteraction=login
.Contains, Does Not Contain, Equals, Does Not Equal, Is Shorter Than, Has a Length Of, and Is Longer Than - An action defines how a request is handled when it meets the conditions. Supported actions are Clear, Blocked, and JS Challenge. The JS Challenge action verifies source IP addresses by using JavaScript plug-ins.
Limits
The following table describes the limits on Accurate Access Control based on the function plan of an Anti-DDoS Pro or Anti-DDoS Premium instance.
Limit | Standard function plan | Enhanced function plan |
---|---|---|
Number of custom rules | ≤ 5 | ≤ 10 |
Supported match fields | IP, URI, Referer, and User-Agent | All fields that support matching |