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

<input>

A Vulnlog file, or -

required

File to read. - reads it from stdin.

--output-dir

A directory

current directory

Directory to write the suppression files to. The directory must exist. You can’t combine it with -o.

-o, --output

A file path, or -

none

Write one suppression file to this path, or to stdout with -. The selection must cover one reporter only, so set --reporter unless the file names one reporter. You can’t combine it with --output-dir.

--format

auto or generic

auto

auto writes the native format of each scanner that has one, and the generic Vulnlog JSON format for the others. generic writes the generic format for every reporter. The format doesn’t change which entries a file contains.

--reporter, --as-of, --tag

See Filter options

Select the entries. For how --as-of treats resolved entries, see Suppression rules.

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

0

The suppression files were written, or no reporter applied.

1

A general error, -o is set but the selection covers several reporters, -o and --output-dir are combined, or the output directory doesn’t exist. For the general errors, see Exit codes.

2

The Vulnlog file doesn’t pass validation, or an analysis contains a character the native format can’t hold.

5

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