# Ensure Geo restrictions are enabled in CloudFront distributions

- Source: https://support.icompaas.com/support/solutions/articles/62000129495-ensure-geo-restrictions-are-enabled-in-cloudfront-distributions
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [Security Controls](https://support.icompaas.com/support/solutions/62000065178) › [IAM Policies](https://support.icompaas.com/support/solutions/folders/62000096130)
- Last updated: 2026-06-05
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

Description: 

CloudFront is a fast content delivery network (CDN) service that securely delivers data, videos, applications, and APIs to customers globally with low latency, high transfer speeds, all within a developer-friendly environment. CloudFront is a web service that speeds up the distribution of your static and dynamic web content, such as .html, .css, .js, and image files to your users. Through a worldwide network of data centers, It delivers your content. This network of data centers is called edge locations.

Geo-restrictions also known as geo-blocking, when the organization does not want to access any application or content for particular geographical locations, Organization needs to prevent users in specific geographic locations from accessing content. 

Here we ensure that CloudFront geo restriction feature. which use to restrict access at the country level. 

  

Rationale: 

Enabling this CloudFront geo-restriction for any particular country means it prevents users in specific countries from accessing your content. It should be enabled to allow access only from users in the whitelisted country or if the organization cannot distribute content in a particular country, It should deny access from users in the blacklisted country.

  

Impact:

-    It allows only those users who belong to one of the countries on a whitelist of approved countries.
    
-    If someone tries to access your content from one of the countries on a blacklist of banned countries it prevents those users
    
-    It gives you the ability to block IP addresses based on Geo IP.
    
-    If you enable it to secure your system or prevent DDoS attacks.
    

  

Default Value:

By default in the AWS account, no Distribution was created.

If you already created Distribution in CloudFront in this Distribution by default Geo Restrictions is disabled.

  

Pre-Requisite:

-   Your account should contain at least one CloudFront Distribution
    
-   After auditing, if you notice Geo Restriction is not enabled, follow the implementation steps to enable
    

  

Remediation:

Test Plan:

1.  Login AWS account and go to CloudFront  console [https://console.aws.amazon.com/cloudfront](https://console.aws.amazon.com/cloudfront)
    
2.  Click Distributions in the left navigation pane
    

3.  You can see if the distribution is created or not If any active distribution is available in your account then click the Viewing dropdown menu and select the Web option
    
4.  Select the CDN distribution that you want to examine and click on the Distribution Settings button
    

  
  

5.  Click on the Restriction tab and check the status of Geo Restriction. 
    

Note: If the status is Disabled for the selected CloudFront distribution,  the distribution configuration is not compliant.

→ Repeat all the above steps to verify the geo-restriction feature for other Amazon CloudFront CDN distributions

  

Using AWS CLI:

1.  To list CloudFront distributions
    

aws cloudfront list-distributions

2.  Get the information about the distribution
    

aws cloudfront get-distribution --id <distribuiton\_id>

3.  Get the configuration information about the distribution
    

aws cloudfront get-distribution-config --id <distribution\_id>

Implementation Steps:

1.  Login AWS account and go to CloudFront  console [https://console.aws.amazon.com/cloudfront](https://console.aws.amazon.com/cloudfront)
    
2.  Click Distributions in the left navigation pane
    
3.  Select the distribution that you want to update and then click on the Distribution Settings button
    

4.  In the Distribution Setting pane, click on the Restrictions tabs  
    
5.  Select Geo Restriction and click on the Edit button  
    
6.  Click on the Yes radio button then you see Restriction Type  in the restriction type it contains Whitelist and Blacklist below this Countries list select any country for whitelist or blacklist and click on Add >> button you can remove the country from the list by clicking on << Remove button 
    

  

Note: If you select restriction type to Whitelist then add countries into the list which you want to enable, for disable remove from the list. If you select restriction type to Blacklist, add countries that you don’t want to allow.

7.  As per your choice do the whitelisting or blacklisting the country list then click on the Yes, Edit button.
    

Using AWS CLI:

To enable the geo-restriction

aws cloudfront update-distribution
    --id <value>
    --distribution-config file://enable-geo-restriction.json
    --if-match <value>

 To Disable the geo-restriction

aws cloudfront update-distribution
    --id <value>
    --distribution-config file://disable-geo-restriction.json
    --if-match <value>

Backout Plan:

Remove the added country from the whitelist:

1.  Login AWS account and go to CloudFront  console [https://console.aws.amazon.com/cloudfront](https://console.aws.amazon.com/cloudfront)
    
2.  Select the distribution that you want to update and then click on the Distribution Settings button 
    
3.  In the Distribution Setting pane, click on the Restrictions tabs
    
4.  Select Geo Restriction and click on the Edit button 
    
5.  Select the country which you want to remove from the whitelist and click on the Remove button
    

6.  After removing the country from your whitelist click on the Yes, Edit button
    

  

Note: Similarly if you want to remove countries from the blacklist follow the same steps.

Note:  If you don’t want any Allow list and Blocklist then we can on No Restrictions  

  

If you want to Delete the Distribution then follow the below steps:

1.  Select the distribution and click on disable button
    
2.  Click on the Yes, Disable button 
    
3.  And click on the Delete button
    

4.  Click on the Yes, Delete button  
    

  

Using AWS CLI:

To delete a Cloudfront distribution

aws cloudfront delete-distribution --id <value> --if-match <value>

References:

-   [What is Amazon CloudFront? - Amazon CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html) 
    
-   [https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-geo-restriction/](https://aws.amazon.com/premiumsupport/knowledge-center/cloudfront-geo-restriction/) 
    
-   [Restricting the Geographic Distribution of Your Content - Amazon CloudFront](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/georestrictions.html) 
    
-   [https://aws.amazon.com/cloudfront/](https://aws.amazon.com/cloudfront/) 
    
-   [cloudfront — AWS CLI 1.19.112 Command Reference](https://docs.aws.amazon.com/cli/latest/reference/cloudfront/index.html)

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
