Help Center> Edge Security> User Guide> Security Protection> Protection Policy> Configuring Protection Policies> Configuring CC Attack Protection Rules to Defend Against CC Attacks
Updated on 2024-05-27 GMT+08:00

Configuring CC Attack Protection Rules to Defend Against CC Attacks

CC attack protection can limit the access to a protected website based on a single IP address, cookie, or referer. Beyond that, CC attack protection can also limit access rate based on policies, domain names, and URLs to precisely mitigate CC attacks. In policy-based rate limiting, the number of requests for all domain names in the same policy are counted for triggering the rule. In domain-based rate limiting, the total number of requests for each domain name is counted separately for triggering the rule. In URL-based rate limiting, the number of requests for each URL is counted separately for triggering the rule. To use this protection, ensure that you have toggled on CC Attack Protection (its status should be ).

Prerequisites

A protected website has been added. For details, see Adding a Website to EdgeSec.

Constraints

  • 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.
  • A reference table can be added to a CC attack protection rule. The reference table takes effect for all protected domain names.
  • A CC attack protection rule offers protective actions such as Verification code and Block for your choice. For example, you can configure a CC attack protection rule to block requests from a visit for 600 seconds by identifying their cookie (name field) if the visitor accessed a URL (for example, /admin*) of your website over 10 times within 60 seconds.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner of the page and choose Security & Compliance > Edge Security.
  3. In the navigation pane on the left, choose Dashboard under Security Protection.
  4. In the navigation pane on the left, choose Website Settings.
  5. In the Policy column of the row containing the domain name, click the number to go to the Policies page.

    Figure 1 Website list

  6. In the CC Attack Protection configuration area, change Status as needed and click Customize Rule to go to the CC Attack Protection page.

    Figure 2 CC Attack Protection configuration area

  7. In the upper left corner of the CC Attack Protection page, click Add Rule.
  8. In the displayed dialog box, configure a CC attack protection rule by referring to Table 1.

    Table 1 Rule parameters

    Parameter

    Description

    Example Value

    Rule Name

    Name of the rule

    test

    Rule Description

    A brief description of the rule. This parameter is optional.

    --

    Rate Limit Mode

    • Source:Requests from a specific source are limited. For example, if traffic from an IP address (or user) exceeds the rate limit you configure in this rule, EdgeSec limits traffic rate of the IP address (or user) in the way you configure.

      Per IP address: A website visitor is identified by the IP address.

    --

    Trigger

    Click Add to add conditions. At least one condition is required, but up to 30 conditions are allowed. If you add more than one condition, the rule will only take effect if all of the conditions are met.

    • Field: include path, IP address, cookie, header, Params, and HTTP code.
    • Subfield: Configure this field only when Cookie, Header, or Params is selected for Field.
      NOTICE:

      The length of a subfield cannot exceed 2,048 bytes. Only digits, letters, underscores (_), and hyphens (-) are allowed.

    • Logic: Select a logical relationship from the drop-down list.
      NOTE:

      If you set Logic to Include any value, Exclude any value, Equal to any value, Not equal to any value, Prefix is any value, Prefix is not any of them, Suffix is any value, or Suffix is not any of them, select an existing reference table. For details, see Creating a Reference Table to Configure Protection Metrics In Batches.

    • Content: Enter or select the content that matches the condition.

    Path Include /admin

    Rate Limit

    The maximum requests that a website visitor can initiate within the configured period. If the configured rate limit has been reached, EdgeSec will respond according to the protective action configured.

    10 requests allowed in 60 seconds

    Protective Action

    The action that EdgeSec will take if the number of requests exceeds Rate Limit you configured. The options are as follows:

    • Verification code: EdgeSec allows requests that trigger the rule as long as your website visitors complete the required verification.
    • Block: EdgeSec blocks requests that trigger the rule.
    • Log only: EdgeSec only logs requests that trigger the rule.

    Block

    Block Duration

    Period of time for which to block the item when you set Protective Action to Block.

    600 seconds

    Block Page

    The page displayed if the maximum number of requests has been reached. This parameter is configured only when Protective Action is set to Block.

    • If you select Default settings, the default block page is displayed.
    • If you select Custom, a custom error message is displayed.

    Custom

    Block Page Type

    If you select Custom for Block Page, select a type of the block page among options application/json, text/html, and text/xml.

    text/html

    Page Content

    If you select Custom for Block Page, configure the content to be returned.

    Page content styles corresponding to different page types are as follows:

    • text/html: <html><body>Forbidden</body></html>
    • application/json: {"msg": "Forbidden"}
    • text/xml: <?xml version="1.0" encoding="utf-8"?><error> <msg>Forbidden</msg></error>

  9. Click OK. You can then view the added CC attack protection rule in the CC rule list.

    • To disable a rule, click Disable in the Operation column of the rule. The default Rule Status is Enabled.
    • To modify a rule, click Modify in the row containing the rule.
    • To delete a rule, click Delete in the row containing the rule.

Configuration Example - Verification Code

If domain name www.example.com has been connected to EdgeSec, perform the following steps to verify that EdgeSec CAPTCHA verification is enabled.

  1. Add a CC attack protection rule with Protection Action set to Verification code.

    Figure 3 Verification code

  2. Enable CC attack protection.

    Figure 4 CC Attack Protection configuration area

  3. Clear the browser cache and access http://www.example.com/admin/.

    If you access the page 10 times within 60 seconds, a verification code is required when you attempt to access the page for the eleventh time. You need to enter the verification code to continue the access.

  4. Go to the EdgeSec console. In the navigation pane on the left, choose Events. View the event on the Events page.