turbot/steampipe-mod-aws-compliance

Control: CloudFront distributions should have geo restriction enabled

Description

Geographic restriction is used to restrict access to all of the files that are associated with a distribution at the country level.

Usage

Run the control in your terminal:

powerpipe control run aws_compliance.control.cloudfront_distribution_geo_restrictions_enabled

Snapshot and share results via Turbot Pipes:

powerpipe login
powerpipe control run aws_compliance.control.cloudfront_distribution_geo_restrictions_enabled --share

SQL

This control uses a named query:

select
arn as resource,
case
when restrictions -> 'GeoRestriction' ->> 'RestrictionType' = 'none' then 'alarm'
else 'ok'
end as status,
case
when restrictions -> 'GeoRestriction' ->> 'RestrictionType' = 'none' then title || ' Geo Restriction disabled.'
else title || ' Geo Restriction enabled.'
end as reason
, region, account_id
from
aws_cloudfront_distribution;

Tags