Yandex Cloud
Search
Discuss with expertTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
    • Cloud Interconnect
    • Cloud Backup
    • Cloud Registry
    • Yandex AI Studio
    • Compute Cloud
    • Object Storage
    • Managed Service for Kubernetes®
    • Yandex BareMetal
    • Smart Web Security
    • Security Deck
    • Managed Service for PostgreSQL
    • Managed Service for ClickHouse®
    • Monium
    • Cloud CDN
    • Network Load Balancer
    • Virtual Private Cloud
    • Cloud DNS
    • Application Load Balancer
    • Yandex Cloud Video
    • Stackland
    • Yandex Cloud Router
    • Yandex Managed Service for Trino
    • Managed Service for MySQL®
    • Managed Service for Valkey™
    • Managed Service for Apache Spark™
    • Yandex StoreDoc
    • Managed Service for OpenSearch
    • Managed Service for Apache Kafka®
    • Data Transfer
    • Yandex MPP Analytics Engine for PostgreSQL
    • Yandex Managed Service for Apache Airflow®
    • Data Processing
    • Yandex MetaData Hub
    • Managed Service for YDB
    • Managed Service for Sharded PostgreSQL
    • Managed Service for YTsaurus
    • Yandex WebSQL
    • DataLens
    • Yandex Search API
    • SpeechSense
    • SpeechKit
    • DataSphere
    • Vision OCR
    • Translate
    • Yandex Identity Hub
    • Key Management Service
    • Certificate Manager
    • Yandex Lockbox
    • Audit Trails
    • SmartCaptcha
    • Cloud Desktop
    • Yandex SIEM
    • SourceCraft Code Assistant
    • Container Registry
    • Managed Service for GitLab
    • Managed Service for Prometheus®
    • Cloud Functions
    • API Gateway
    • Yandex Cloud Postbox
    • Message Queue
    • Serverless Integrations
    • IoT Core
    • Data Streams
    • Serverless Containers
    • Cloud Notification Service
    • Yandex Query
    • Identity and Access Management
    • Yandex Cloud Console
    • Resource Manager
    • Yandex Cloud Billing
    • Yandex Cloud Quota Manager
    • Cloud Apps
  • System Status
  • Marketplace
    • Featured
    • Infrastructure & Network
    • Data Platform
    • AI for business
    • Security
    • DevOps tools
    • Serverless
    • Monitoring & Resources
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud CDN
    • All guides
      • Creating a resource
      • Copying configuration from one resource to another
      • Updating basic settings of a resource
      • Getting information about a resource
      • Configuring resource caching
      • Configuring log export
      • Prefetching files to the CDN server cache
      • Purging resource cache
      • Configuring request and response headers
      • Configuring CORS for responses to clients
      • Configuring HTTP methods
      • Setting up an HTTP response
      • Enabling file compression
      • Enabling file segmentation
      • Enabling origin shielding
      • Setting up a request redirect
      • Enabling a resource to follow request redirects
      • Setting up hiding of origin headers
      • Setting up access via a secure token
      • Configuring a country-based access policy
      • Setting up location rules
      • Setting up a server name for SNI
      • Suspending and resuming a resource
      • Managing resource labels
      • Configuring dedicated IP addressing
      • Configuring a TLS profile
      • Deleting a resource
      • Viewing resource statistics
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Request logs
  • Audit Trails events
  • Release notes
  • FAQ
  1. Step-by-step guides
  2. Resources
  3. Configuring a country-based access policy

Configuring a country-based access policy

Written by
Yandex Cloud
Updated at September 14, 2026
View in Markdown

You can use a country-based access policy to allow or deny access to a CDN resource for users from specific countries.

Warning

When you use country-based access policies, the system tracks client locations by running their IP addresses through GeoIP databases. Occasionally, this data may be inaccurate or out-of-date, e.g., due to IP address reallocation among providers, change of address range ownership, or delayed updates of public sources.

To configure a country-based access policy:

Management console
REST API
gRPC API
  1. In the management console, select the folder where your resource is located.

  2. Navigate to Cloud CDN.

  3. Click the resource name.

  4. Navigate to the  Security tab.

  5. In the top-right corner, click  Edit.

  6. Enable Country-based access.

  7. In the Access policy field, select:

    • Block specified countries to restrict access to the resource from countries listed in the Country list field and allow access from all other countries.
    • Allow specified countries only to allow access to the resource only from countries on the Country list and deny access from all other countries.
  8. In the Country list field, enter two-letter uppercase country codes separated by commas, e.g., RU, KZ.

  9. Click Save.

To configure a policy, add the geoAcl section when using the create or update method for a Resource:

"geoAcl": {
  "enabled": "boolean",
  "mode": "string",
  "countries": [
    "string"
  ]
}

Where:

  • enabled: Enables the country-based access policy.

  • mode: Policy type:

    • MODE_ALLOW: Allow access only from countries specified in countries.
    • MODE_DENY: Restrict access from countries specified in countries.
  • countries: List of two-letter uppercase country codes.

To configure a policy, add the geo_acl section when using the ResourceService/Create or ResourceService/Update call:

"geo_acl": {
  "enabled": "bool",
  "mode": "Mode",
  "countries": [
    "string"
  ]
}

Where:

  • enabled: Enables the country-based access policy.

  • mode: Policy type:

    • MODE_ALLOW: Allow access only from countries specified in countries.
    • MODE_DENY: Restrict access from countries specified in countries.
  • countries: List of two-letter uppercase country codes.

It may take up to 15 minutes for the new settings of the existing resource to apply to the CDN servers. After that, we recommend purging the resource cache.

Useful linksUseful links

  • Country-based access policy
  • Creating a resource

Was the article helpful?

Previous
Setting up access via a secure token
Next
Setting up location rules
© 2026 Direct Cursus Technology L.L.C.