Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cloudfront): use TLS_V1_2_2021 SecurityPolicy as default version (under feature flag) #15477

Merged
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ your domain name, and provide one (or more) domain names from the certificate fo

The certificate must be present in the AWS Certificate Manager (ACM) service in the US East (N. Virginia) region; the certificate
may either be created by ACM, or created elsewhere and imported into ACM. When a certificate is used, the distribution will support HTTPS connections
from SNI only and a minimum protocol version of TLSv1.2_2019.
from SNI only and a minimum protocol version of TLSv1.2_2021.

```ts
const myCertificate = new acm.DnsValidatedCertificate(this, 'mySiteCert', {
Expand Down
7 changes: 4 additions & 3 deletions packages/@aws-cdk/aws-cloudfront/lib/distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export interface DistributionProps {
* CloudFront serves your objects only to browsers or devices that support at
* least the SSL version that you specify.
*
* @default SecurityPolicyProtocol.TLS_V1_2_2019
* @default SecurityPolicyProtocol.TLS_V1_2_2021
*/
readonly minimumProtocolVersion?: SecurityPolicyProtocol;
}
Expand Down Expand Up @@ -446,7 +446,7 @@ export class Distribution extends Resource implements IDistribution {
}

private renderViewerCertificate(certificate: acm.ICertificate,
minimumProtocolVersion: SecurityPolicyProtocol = SecurityPolicyProtocol.TLS_V1_2_2019): CfnDistribution.ViewerCertificateProperty {
minimumProtocolVersion: SecurityPolicyProtocol = SecurityPolicyProtocol.TLS_V1_2_2021): CfnDistribution.ViewerCertificateProperty {
return {
acmCertificateArn: certificate.certificateArn,
sslSupportMethod: SSLMethod.SNI,
Expand Down Expand Up @@ -531,7 +531,8 @@ export enum SecurityPolicyProtocol {
TLS_V1_2016 = 'TLSv1_2016',
TLS_V1_1_2016 = 'TLSv1.1_2016',
TLS_V1_2_2018 = 'TLSv1.2_2018',
TLS_V1_2_2019 = 'TLSv1.2_2019'
TLS_V1_2_2019 = 'TLSv1.2_2019',
TLS_V1_2_2021 = 'TLSv1.2_2021'
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/@aws-cdk/aws-cloudfront/lib/web-distribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ export class CloudFrontWebDistribution extends cdk.Resource implements IDistribu
[SSLMethod.SNI]: [
SecurityPolicyProtocol.TLS_V1, SecurityPolicyProtocol.TLS_V1_1_2016,
SecurityPolicyProtocol.TLS_V1_2016, SecurityPolicyProtocol.TLS_V1_2_2018,
SecurityPolicyProtocol.TLS_V1_2_2019,
SecurityPolicyProtocol.TLS_V1_2_2019, SecurityPolicyProtocol.TLS_V1_2_2021,
],
[SSLMethod.VIP]: [SecurityPolicyProtocol.SSL_V3, SecurityPolicyProtocol.TLS_V1],
};
Expand Down
1 change: 1 addition & 0 deletions packages/@aws-cdk/aws-cloudfront/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@
"docs-public-apis:@aws-cdk/aws-cloudfront.SecurityPolicyProtocol.TLS_V1_1_2016",
"docs-public-apis:@aws-cdk/aws-cloudfront.SecurityPolicyProtocol.TLS_V1_2_2018",
"docs-public-apis:@aws-cdk/aws-cloudfront.SecurityPolicyProtocol.TLS_V1_2_2019",
"docs-public-apis:@aws-cdk/aws-cloudfront.SecurityPolicyProtocol.TLS_V1_2_2021",
"docs-public-apis:@aws-cdk/aws-cloudfront.ViewerCertificate.aliases",
"docs-public-apis:@aws-cdk/aws-cloudfront.ViewerCertificate.props",
"docs-public-apis:@aws-cdk/aws-cloudfront.ViewerCertificateOptions",
Expand Down
4 changes: 2 additions & 2 deletions packages/@aws-cdk/aws-cloudfront/test/distribution.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ test('exhaustive example of props renders correctly', () => {
ViewerCertificate: {
AcmCertificateArn: 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012',
SslSupportMethod: 'sni-only',
MinimumProtocolVersion: 'TLSv1.2_2019',
MinimumProtocolVersion: 'TLSv1.2_2021',
},
WebACLId: '473e64fd-f30b-4765-81a0-62ad96dd167a',
},
Expand Down Expand Up @@ -343,7 +343,7 @@ describe('certificates', () => {
ViewerCertificate: {
AcmCertificateArn: 'arn:aws:acm:us-east-1:123456789012:certificate/12345678-1234-1234-1234-123456789012',
SslSupportMethod: 'sni-only',
MinimumProtocolVersion: 'TLSv1.2_2019',
MinimumProtocolVersion: 'TLSv1.2_2021',
},
},
});
Expand Down