Geo restrictions

Learn how geo restrictions work, where they are placed in the filtering hierarchy, and how to configure them.

  • The country of a request source is determined by its IP address, so geo filtering is not always 100% accurate. This is because subnets are regularly resold, including between countries. The geolocation data is not updated immediately, so addresses in a resold subnet may temporarily show the previous country.

  • If a user enables a VPN, their country is determined by the VPN server location.

What are geo restrictions?

Geo restrictions are a tool for blocking access to your web resource from specific countries. There are two options:

  • Block requests from selected countries.

  • Block requests from all countries except selected countries.

For example, the settings below block traffic from India and Pakistan from accessing the resource.

Geo restrictions example

When to use them

Geo restrictions can be useful when:

  • Your service is intended only for users from specific countries.

  • You must comply with country-specific legal, contractual, or licensing restrictions.

  • You want to reduce unwanted traffic from regions that often send attacks or suspicious requests.

Where they are placed in the filtering hierarchy

The table below shows the full sequence of filtering mechanisms in Anti-bot and Anti-DDoS protection modes.

Stage Anti-bot Anti-DDoS

1

Black and white lists

Black and white lists

2

Verified bot list

Verified bot list

3

Geo restrictions

Geo restrictions

4

Custom rules

Rate limits

5

Individual protection profile

During a DDoS attack: filtering based on request source class

For a description of each mechanism, see Protection modes and filtering stages.

The filtering stages run in sequence. As shown in the table, geo restrictions are stage 3. This means that the system first checks the request against the black and white lists (stage 1), then against the verified bot list (stage 2), and only then applies geo restrictions.

Example: suppose IP address 203.0.113.10 belongs to India. You add it to the white list but block India in geo restrictions. Requests from this IP address still reach the resource, because the white list, whose requests are automatically allowed, has a higher position in the filtering hierarchy than geo restrictions.

How to configure geo restrictions

  1. Go to Application protection → Resources. Click the ellipsis (…) next to the required resource and select Settings.

  2. Go to the Geo restrictions tab.

    Geo restrictions settings
  3. Select an option:

    • No restrictions, the default setting: geo filtering is disabled.

    • Block selected countries: geo filtering is enabled and requests from the specified countries are blocked.

    • Allow selected countries only: geo filtering is enabled and requests from all countries except the specified countries are blocked.

  4. For Block selected countries or Allow selected countries only, select the required countries from the drop-down list.

    Select countries
  5. Click Save.

    Geo restrictions example

Done. Geo filtering is enabled and blocks traffic from unwanted countries.