result.Misconfigurations can be a nil value.
I encountered this by explicitly ignoring two Terraform misconfiguration rules.
In the example below, there are two #trivy:ignore comments.
Having two ignore comments results in result.Misconfigurations being nil.
#trivy:ignore:AVD-AWS-0089
resource "aws_s3_bucket" "this" {
bucket = "some-bucket-name"
}
#trivy:ignore:AVD-AWS-0132
resource "aws_s3_bucket_server_side_encryption_configuration" "this" {
bucket = aws_s3_bucket.this.id
rule {
apply_server_side_encryption_by_default {
sse_algorithm = "AES256"
}
}
}
To solve this, I followed the pattern from two lines above where possible falsy value was pair with an "or {}".
result.Misconfigurations
can be a nil value. I encountered this by explicitly ignoring two Terraform misconfiguration rules.In the example below, there are two #trivy:ignore comments. Having two ignore comments results in
result.Misconfigurations
being nil.