π AWS CloudFront Web Distribution uses Dedicated IP for SSL π’
- Contextual name: π Web Distribution uses Dedicated IP for SSL π’
- ID:
/ce/ca/aws/cloudfront/distribution-uses-dedicated-ip
- Located in: π AWS CloudFront
Flagsβ
- π’ Policy with categories
- π’ Policy with type
- π’ Production policy
Our Metadataβ
- Policy Type:
COMPLIANCE_POLICY
- Policy Category:
COST
RELIABILITY
Similar Policiesβ
- AWS Security Hub
- [[CloudFront.8] CloudFront distributions should use SNI to serve HTTPS requests]([CloudFront.8] CloudFront distributions should use SNI to serve HTTPS requests (https://docs.aws.amazon.com/securityhub/latest/userguide/cloudfront-controls.html#cloudfront-8)]
- Internal
dec-x-92f3cecf
Similar Internal Rulesβ
Rule | Policies | Flags |
---|---|---|
βοΈ dec-x-92f3cecf | 1 |
Logicβ
- π§ prod.logic.yaml π’
Descriptionβ
Descriptionβ
This policy checks that AWS CloudFront Web Distributions use a custom SSL certificate configured with Server Name Indication (SNI) extension for handling HTTPS traffic.
Rationaleβ
When CloudFront is configured to serve HTTPS requests using dedicated IP addresses, AWS imposes additional monthly charges. These charges apply as soon as a custom SSL/TLS certificate is associated with a distribution and the distribution is enabled.
The Server Name Indication (SNI) extension to the TLS protocol allows CloudFront to deliver HTTPS traffic without relying on dedicated IP addresses. When using SNI, CloudFront assigns an IP address to each edge location. During the SSL/TLS handshake, the client includes the domain name in the SNI extension, allowing CloudFront to select the appropriate certificate. DNS then routes the request to the IP address of the corresponding edge location.
Impactβ
SNI is supported by all modern browsers and HTTP clients released since 2010. Older clients lacking SNI support may fail to establish HTTPS connections, representing a compatibility risk for legacy environments.
... see more
Remediationβ
Remediationβ
From Command Lineβ
Retrieve the current distribution configuration and capture its
ETag
:aws cloudfront get-distribution-config \
--id {{distribution-id}} \
--query 'DistributionConfig' \
> {{distribution-config}}.json
ETAG=$(aws cloudfront get-distribution-config \
--id {{distribution-id}} \
--query 'ETag' \
--output text)In the downloaded
{{distribution-config}}.json
, modify theViewerCertificate
structure and set theSSLSupportMethod
key tosni-only
.Apply the updated configuration to your distribution using the saved ETag:
aws cloudfront update-distribution \
--id {{distribution-id}} \
--if-match $ETAG \
--distribution-config file://{{distribution-config}}.json