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

fix(aws): don't check SSLSupportMethod in AVD-AWS-0013 #85

Merged
merged 1 commit into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions checks/cloud/aws/cloudfront/use_secure_tls_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var CheckUseSecureTlsPolicy = rules.Register(
Resolution: "Use the most modern TLS/SSL policies available",
Explanation: `You should not use outdated/insecure TLS versions for encryption. You should be using TLS v1.2+.

Note: that setting *minimum_protocol_version = "TLSv1.2_2021"* is only possible when *cloudfront_default_certificate* is false (eg. you are not using the cloudfront.net domain name) and *ssl_support_method* is *sni-only*.
Note: that setting *minimum_protocol_version = "TLSv1.2_2021"* is only possible when *cloudfront_default_certificate* is false (eg. you are not using the cloudfront.net domain name).
If *cloudfront_default_certificate* is true then the Cloudfront API will only allow setting *minimum_protocol_version = "TLSv1"*, and setting it to any other value will result in a perpetual diff in your *terraform plan*'s.
The only option when using the cloudfront.net domain name is to ignore this rule.`,
Links: []string{
Expand All @@ -45,7 +45,6 @@ The only option when using the cloudfront.net domain name is to ignore this rule
for _, dist := range s.AWS.Cloudfront.Distributions {
vc := dist.ViewerCertificate
if vc.CloudfrontDefaultCertificate.IsFalse() &&
vc.SSLSupportMethod.EqualTo("sni-only") &&
vc.MinimumProtocolVersion.NotEqualTo(cloudfront.ProtocolVersionTLS1_2) {
results.Add(
"Distribution allows unencrypted communications.",
Expand Down
4 changes: 2 additions & 2 deletions checks/cloud/aws/cloudfront/use_secure_tls_policy.tf.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var terraformUseSecureTlsPolicyGoodExamples = []string{
`
resource "aws_cloudfront_distribution" "good_example" {
viewer_certificate {
cloudfront_default_certificate = aws_acm_certificate.example.arn
cloudfront_default_certificate = false
minimum_protocol_version = "TLSv1.2_2021"
}
}
Expand All @@ -15,7 +15,7 @@ var terraformUseSecureTlsPolicyBadExamples = []string{
`
resource "aws_cloudfront_distribution" "bad_example" {
viewer_certificate {
cloudfront_default_certificate = aws_acm_certificate.example.arn
cloudfront_default_certificate = false
minimum_protocol_version = "TLSv1.0"
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func TestCheckUseSecureTlsPolicy(t *testing.T) {
},
},
},
expected: false,
expected: true,
},
}
for _, test := range tests {
Expand Down