Check ID: cloudfront_distributions_s3_origin_access_control
Provider: AWS
Service: cloudfront
Severity: MEDIUM
Categories: trust-boundaries, internet-exposed
Resource type: AwsCloudFrontDistribution

What this check verifies

CloudFront distributions with Amazon S3 origins are expected to use Origin Access Control (OAC) on each S3 origin. The evaluation inspects distributions that include s3_origin_config and identifies S3 origins that lack an associated OAC.

Risk

Without OAC, S3 objects can be reached outside CloudFront, bypassing edge controls and weakening confidentiality and integrity.
  • Direct access enables data exfiltration
  • Loss of WAF, rate-limiting, and detailed logging; cost abuse
  • Limited support for signed writes and SSE-KMS, increasing tampering risk

Recommendation

Enable Origin Access Control for all S3 origins and keep buckets non-public. Apply least privilege: scope bucket and key permissions to CloudFront and the intended distribution. Ensure origin requests are signed, migrate from legacy OAI, and use defense in depth with WAF and monitoring to protect and observe access.

Remediation

aws cloudfront create-origin-access-control --origin-access-control-config '{Name":"<example_resource_name>","SigningProtocol":"sigv4","SigningBehavior":"always","OriginAccessControlOriginType":"s3"}' && aws cloudfront get-distribution-config --id <DISTRIBUTION_ID> --output json > current-config.json && echo 'Manually edit current-config.json to add OriginAccessControlId to S3 origins, then run:' && echo 'aws cloudfront update-distribution --id <DISTRIBUTION_ID> --distribution-config file://current-config.json --if-match $(aws cloudfront get-distribution-config --id <DISTRIBUTION_ID> --query "ETag" --output text)'

References

Where this check fires

This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable by Check ID = cloudfront_distributions_s3_origin_access_control. To re-evaluate after a fix, hit Run now on the account’s schedule under Cloud Security → Schedules — the next scan re-checks this control and marks the finding fixed or keeps it persistent.
← Back to AWS checks