Trivy Filter Functionality Scanning CloudFormation Template. #6212
Closed
Cumming5412
started this conversation in
Bugs
Replies: 2 comments 4 replies
-
Hi @Cumming5412 ! Ignoring by inline comments is not supported for CloudFormation templates, so it's not a bug. |
Beta Was this translation helpful? Give feedback.
1 reply
-
@simar7 Should we update the documentation and specify that ignore by inline comments is only supported for terraform? |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
When scanning Terraform, I can add an inline comment e.g.
#trivy:ignore:AVD-GCP-0051 trivy:ignore:AVD-GCP-0053
to ignore a specific block of HCL.
Trying to do the same thing in CloudFormation it seems the inline comment is ignored/not supported.
I have a bucket created via CloudFormation that uses AES256:
BucketEncryption:
ServerSideEncryptionConfiguration:
- ServerSideEncryptionByDefault:
SSEAlgorithm: AES256
The scanner reports the below:
HIGH: Bucket does not encrypt data with a customer managed key.
════════════════════════════════════════
Encryption using AWS keys provides protection for your S3 buckets. To increase control of the encryption and manage factors like rotation use customer managed keys.
See https://avd.aquasec.com/misconfig/avd-aws-0132
Desired Behavior
When I add
#trivy:ignore:AVD-AWS-0132
I expect the warning to be ignored.
e.g.
#trivy:ignore:AVD-AWS-0132
S3Bucket:
Type: AWS::S3::Bucket
DeletionPolicy: Retain
Properties:
Actual Behavior
The warning is repeated. I have tried adding the inline comment directly above and alongside the AES256 entry but there is no difference.
Reproduction Steps
Target
AWS
Scanner
Misconfiguration
Output Format
Table
Mode
Standalone
Debug Output
Operating System
Ubuntu
Version
Checklist
trivy image --reset
Beta Was this translation helpful? Give feedback.
All reactions