Check ID:
Provider: AWS
Service:
Severity: MEDIUM
Categories:
Resource type:
cloudfront_distributions_https_enabledProvider: AWS
Service:
cloudfrontSeverity: MEDIUM
Categories:
internet-exposedResource type:
AwsCloudFrontDistributionWhat this check verifies
CloudFront distributions require viewer connections over HTTPS when the default cache behaviorviewer_protocol_policy is https-only or redirect-to-https. Configurations that use allow-all permit HTTP.
Risk
Allowing HTTP exposes traffic to man-in-the-middle interception and session hijacking, enabling theft of cookies, tokens, or PII. Attackers can tamper with responses, inject malware, or perform downgrade/strip attacks, undermining confidentiality and integrity.Recommendation
Enforce HTTPS-only access for viewers by settingviewer_protocol_policy to https-only or redirect-to-https; avoid allow-all. Extend encryption end-to-end to origins, enable HSTS, prefer modern TLS and ciphers, and mark cookies Secure. This supports defense in depth and prevents downgrade.
Remediation
- CLI
- Terraform
- Native IaC
- Dashboard steps
aws cloudfront get-distribution-config —id <DISTRIBUTION_ID> —output json > current-config.json && echo ‘Manually edit current-config.json to change DefaultCacheBehavior.ViewerProtocolPolicy to “redirect-to-https” or “https-only”, 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
- https://www.trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/aws/CloudFront/security-policy.html
- https://docs.aws.amazon.com/IAM/latest/UserGuide/what-is-access-analyzer.html
- https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/using-https.html
Where this check fires
This check runs on every scheduled scan against your AWS account. Findings appear at Cloud Security → Findings filterable byCheck ID = cloudfront_distributions_https_enabled. 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