CloudFront distribution uses a custom SSL/TLS certificate
cloudfront_distributions_custom_ssl_certificate
CloudFront distributions are configured with a custom SSL/TLS certificate rather than the default *.cloudfront.net certificate for viewer connections.
Risk
Using the default certificate prevents HTTPS on your own hostnames, breaking hostname validation. Clients may face errors or avoid TLS, impacting authentication and availability. Control over TLS posture and domain-bound security headers is reduced, weakening confidentiality and user trust.
prowler aws --checks cloudfront_distributions_custom_ssl_certificate
Recommendation
- Use a custom SSL/TLS certificate covering your domains and configure aliases.
- Enforce modern TLS policy, SNI, and HSTS; disable legacy protocols.
- Apply least privilege to certificate lifecycle and rotate/monitor keys.
Remediation
aws cloudfront get-distribution-config --id <DISTRIBUTION_ID> --output json > current-config.json && echo 'Manually edit current-config.json to add Aliases and ViewerCertificate fields, 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)'
- Open the CloudFront console and select your distribution
- Go to the Settings/General tab and click Edit
- In Alternate domain name (CNAME), add <example_domain>
- In SSL certificate, choose Custom SSL certificate and select your ACM certificate (issued in us-east-1 and covering <example_domain>)
- Click Save/Yes, Edit and wait for the distribution to deploy
Source Code
Resource Type
AwsCloudFrontDistribution
References
- https://trendmicro.com/trendaivisiononecloudriskmanagement/knowledge-base/aws/CloudFront/cloudfront-distro-custom-tls.html
- https://docs.aws.amazon.com/securityhub/latest/userguide/cloudfront-controls.html#cloudfront-7
- https://support.icompaas.com/support/solutions/articles/62000233491-ensure-cloudfront-distributions-use-custom-ssl-tls-certificates
- https://reintech.io/blog/configure-https-ssl-certificates-cloudfront-distributions