Skip to content
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: 3 additions & 0 deletions pkg/iac/scanners/terraform/executor/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,9 @@ func ignoreByParams(params map[string]string, modules terraform.Modules, m *type
}
for key, param := range params {
val := block.GetValueByPath(key)
if val.IsNull() || !val.IsKnown() {
return false
}
switch val.Type() {
case cty.String:
if val.AsString() != param {
Expand Down
8 changes: 8 additions & 0 deletions pkg/iac/scanners/terraform/ignore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,14 @@ data "aws_iam_policy_document" "this" {
}`,
assertLength: 0,
},
{
name: "ignore marker value is unknown",
source: `#trivy:ignore:*[bucket=mybucket-bucket1]
resource "aws_s3_bucket" "test" {
bucket = "mybucket-${each.key}"
}`,
assertLength: 1,
},
}

for _, tc := range testCases {
Expand Down