Skip to content

Commit a2b6549

Browse files
authored
docs(misconf): multiple ignores in comment (#5926)
1 parent ae134a9 commit a2b6549

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

docs/docs/configuration/filtering.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ Some configuration file formats (e.g. Terraform) support inline comments.
496496
497497
In cases where trivy can detect comments of a specific format immediately adjacent to resource definitions, it is possible to filter/ignore findings from a single point of resource definition (in contrast to `.trivyignore`, which has a directory-wide scope on all of the files scanned).
498498
499-
The format for these comments is `trivy:ignore:<Vulnerability ID>` immediately following the format-specific line-comment token.
499+
The format for these comments is `trivy:ignore:<Vulnerability ID>` immediately following the format-specific line-comment token. You can add multiple ignores on the same comment line.
500500
501501
For example, to filter a Vulnerability ID "AVD-GCP-0051" in a Terraform HCL file:
502502
@@ -508,4 +508,14 @@ resource "google_container_cluster" "one_off_test" {
508508
}
509509
```
510510
511+
For example, to filter vulnerabilities "AVD-GCP-0051" and "AVD-GCP-0053" in a Terraform HCL file:
512+
513+
```terraform
514+
#trivy:ignore:AVD-GCP-0051 trivy:ignore:AVD-GCP-0053
515+
resource "google_container_cluster" "one_off_test" {
516+
name = var.cluster_name
517+
location = var.region
518+
}
519+
```
520+
511521
[^1]: license name is used as id for `.trivyignore.yaml` files

0 commit comments

Comments
 (0)