feat(misconf): Support inline ignores for CloudFormation Templates #6237
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
scan/misconfiguration
Issues relating to misconfiguration scanning
Milestone
Today Trivy does not support inline ignores for CloudFormation Templates.
Discussed in #6212
Originally posted by Cumming5412 February 27, 2024
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
The text was updated successfully, but these errors were encountered: