vulnlog suppress
vulnlog suppress generates suppression files from a Vulnlog file: one file for each reporter the entries name, except other.
A suppression file lists the findings the scanner should ignore.
Synopsis
vulnlog suppress <input> [--output-dir <dir> | -o <path>] [--format auto|generic] [<filter-options>]
Arguments and options
| Name | Value | Default | Description |
|---|---|---|---|
|
A Vulnlog file, or |
required |
File to read. |
|
A directory |
current directory |
Directory to write the suppression files to.
The directory must exist.
You can’t combine it with |
|
A file path, or |
none |
Write one suppression file to this path, or to stdout with |
|
|
|
|
|
See Filter options |
Select the entries.
For how |
For global options and standard input and output, see Global options and Standard input and output.
Output
For the entries that go into a suppression file, see Suppression rules. For the file name and format of each scanner, see Supported scanners.
Every reporter that the Vulnlog file names gets a file, even when --as-of or --tag leaves it no entry.
That file then lists no findings, so suppressions from an earlier run stop applying.
--reporter limits the output to that reporter.
If no entry names it, the command writes nothing and prints Unchanged: no suppression entries applicable.
With -v, the command shows the entries it skipped and why.
With -vv, it also shows every entry it included.
Exit codes
| Code | When |
|---|---|
|
The suppression files were written, or no reporter applied. |
|
A general error, |
|
The Vulnlog file doesn’t pass validation, or an |
|
A filter names an unknown reporter, release, or tag. |
Examples
Write the Trivy suppression file to stdout:
$ vulnlog suppress acme-shop.vl.yaml --reporter trivy -o -
# Generated by Vulnlog (https://vulnlog.dev). DO NOT EDIT.
---
vulnerabilities:
- id: CVE-2022-22965
expired_at: 2027-03-31
statement: >-
Acme Shop runs as a Spring Boot executable JAR on JDK 17. The published exploit needs a WAR deployment on Apache Tomcat,
but Spring advises all users to upgrade.
Write the suppression files of every reporter in acme-shop.vl.yaml to the directory suppressions:
$ vulnlog suppress acme-shop.vl.yaml --output-dir suppressions
Wrote: suppressions/github-dependabot.generic.json
Wrote: suppressions/dependency-check-suppressions.xml
Wrote: suppressions/.trivyignore.yaml
Wrote: suppressions/npm-audit.generic.json
Wrote: suppressions/grype.generic.json
github-dependabot.generic.json and grype.generic.json list no findings.
The requests entry is still under investigation without a suppress block, and Log4Shell is resolved.
The XZ Utils entry has only an other report, so it gets no file:
$ vulnlog -v suppress acme-shop.vl.yaml --output-dir suppressions
verbose: parsed acme-shop.vl.yaml: schema version 1, releases: 3, tags: 4, vulnerabilities: 6
verbose: skipped CVE-2024-3094 for reporter other: no suppression format available
Wrote: suppressions/github-dependabot.generic.json
verbose: wrote suppressions/github-dependabot.generic.json: generic format, 0 entries
Wrote: suppressions/dependency-check-suppressions.xml
verbose: wrote suppressions/dependency-check-suppressions.xml: dependency-check format, 1 entry
Wrote: suppressions/.trivyignore.yaml
verbose: wrote suppressions/.trivyignore.yaml: trivy format, 1 entry
Wrote: suppressions/npm-audit.generic.json
verbose: wrote suppressions/npm-audit.generic.json: generic format, 1 entry
Wrote: suppressions/grype.generic.json
verbose: wrote suppressions/grype.generic.json: generic format, 0 entries
Without --output-dir, the files go to the current directory, and the status lines show absolute paths.
Write the Trivy entries in the generic format:
$ vulnlog suppress acme-shop.vl.yaml --reporter trivy --format generic -o -
{
"vulnerabilities" : [ {
"id" : "CVE-2022-22965",
"expires_at" : "2027-03-31",
"statement" : "Acme Shop runs as a Spring Boot executable JAR on JDK 17. The published exploit needs a WAR deployment on Apache Tomcat, but Spring advises all users to upgrade."
} ]
}
-o without --reporter fails when the file names several reporters:
$ vulnlog suppress acme-shop.vl.yaml -o suppressions.json
error: -o requires a single reporter, found: dependency-check, github-dependabot, grype, npm-audit, trivy
hint: use --reporter <name> to pick one, or --output-dir for one file per reporter