Help Center/ Edge Security/ User Guide/ Security Protection/ Protection Policy/ Configuring Protection Policies/ Configuring Geolocation Access Control Rules to Block Requests from Specific Locations
Updated on 2024-10-31 GMT+08:00

Configuring Geolocation Access Control Rules to Block Requests from Specific Locations

This section describes how to configure a geolocation access control rule. A geolocation access control rule allows you to control IP addresses forwarded from or to specified countries and regions.

Prerequisites

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

Constraints

  • One region can be configured in only one geolocation access control rule. For example, if you have blocked requests from Singapore with a geolocation access control rule, then Singapore cannot be added to other geolocation access control 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.

Precautions

If you configure a regional access control rule in both EdgeSec and CDN, the rule in CDN is executed first.

Procedure

  1. Log in to the management console.
  2. Click in the upper left corner of the page and choose Content Delivery & Edge Computing > CDN and Security.
  3. In the navigation pane on the left, choose Edge Security > Website Settings. The Website Settings page is displayed.
  4. In the Policy column of the row containing the domain name, click the number to go to the Policies page.

    Figure 1 Website list

  5. In the Geolocation Access Control configuration area, change Status if needed and click Customize Rule.

    Figure 2 Geolocation Access Control configuration area

  6. In the upper left corner of the Geolocation Access Control page, click Add Rule.
  7. In the displayed dialog box, specify the parameters by referring to Table 1.

    Figure 3 Adding a geolocation access control rule
    Table 1 Rule parameters

    Parameter

    Description

    Example Value

    Rule Name

    Rule name you configured

    -

    Rule Description

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

    -

    Geolocation

    Geographical location from which an IP address is originated

    -

    Protective Action

    Action EdgeSec will take if the rule is hit. You can select Block or Log only.

    Block

  8. Click Confirm. You can then view the added rule in the list of the geolocation access control rules.

    • To modify a rule, click Modify in the row containing the rule.
    • To delete a rule, click Delete in the row containing the rule.

Protection Effect

To verify EdgeSec is protecting your website (www.example.com) against a rule:

  1. Clear the browser cache and enter the domain name in the address bar to check whether the website is accessible.

    • If the website is inaccessible, connect the website domain name to EdgeSec by following the instructions in Adding a Website to EdgeSec.
    • If the website is accessible, go to 2.

  2. Add a geolocation access control rule by referring to Procedure.
  3. Clear the browser cache and access http://www.example.com. Normally, EdgeSec blocks such requests and returns the block page.