-
Notifications
You must be signed in to change notification settings - Fork 7
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(cloudformation): fix some resources #69
Conversation
@@ -0,0 +1,66 @@ | |||
package ec2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: typo in file name, should be adapt_test.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed 20a2496
Enabled: defsecTypes.BoolDefault(false, clusterResource.Metadata()), | ||
KMSKeyID: defsecTypes.StringDefault("", clusterResource.Metadata()), | ||
Enabled: clusterResource.GetBoolProperty("PerformanceInsightsEnabled"), | ||
KMSKeyID: clusterResource.GetStringProperty("PerformanceInsightsKmsKeyId"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be the following?
KMSKeyID: clusterResource.GetStringProperty("PerformanceInsightsKmsKeyId"), | |
KMSKeyID: clusterResource.GetStringProperty("PerformanceInsightsKMSKeyId"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either way, we should add it to the test case so we can cover it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Must be PerformanceInsightsKmsKeyId
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the tests
b405917
to
f7d88ab
Compare
Fix aquasecurity/trivy#5802
CloudFormation casts the types to the required types if possible. So a boolean property can be passed the string
"false"
, which will be cast to bool. We could infer the type at the parsing stage so that we don't have to worry about it later, but we don't know the type of the property and so it's not safe. We must useGetBoolProperty
to get the boolean value of the property, because this method converts the string representation of a boolean value to a boolean value.Also fixed incorrect property names and default property values.