Gatecheck

Gatecheck

CICD Pipeline Go Reference Go Report Card

Gatecheck Logo

Gatecheck automates report validation in a CI/CD Pipeline by comparing security findings to pre-determined thresholds. It also provides report aggregation, artifact integrity, and deployment validation. Gatecheck is stateless so self-hosting and provisioning servers is not required.

Gatecheck Version

Getting Started

The fastest way to get started with Gatecheck is to download the pre-built binaries for your target system.

cd <target install dir>
curl -L <OS Specific Release>.tar.gz | tar xz
./gatecheck --help

The Gatecheck CLI supports --help for every command.

Update a release binary in place. --check only prints the current and latest versions.

gatecheck update --check
gatecheck update

Generate a configuration file with the default thresholds. Every rule starts disabled, and coverage thresholds start at 0.

gatecheck config init > gatecheck.yaml

Validate a report. The config is a flag. The report type comes from the file contents. The filename is used when the contents are ambiguous, so a Grype report can still be named grype-report.json.

gatecheck validate --config gatecheck.yaml grype-report.json

gatecheck agent-guide (alias llm) prints a markdown guide for coding agents. The same text is docs/agent-guide.md.

gatecheck bootstrap installs pinned Grype, Syft, Gitleaks, semgrep’s experimental osemgrep CLI, Trivy, and osv-scanner. gatecheck grype, gatecheck syft, gatecheck gitleaks, gatecheck semgrep, gatecheck osemgrep, gatecheck trivy, and gatecheck osv-scanner run them. gatecheck bootstrap --tools gosec,hadolint,zizmor adds gosec, hadolint, and zizmor, whose SARIF output validate reads. --tools scorecard,trufflehog,cosign adds OpenSSF Scorecard and trufflehog, whose JSON validate gates, and cosign for signature checks.

Summarize Reports with List

gatecheck ls --help

List with EPSS scores is supported for Grype, CycloneDX, Trivy, and osv-scanner reports.

Gatecheck List

Validation

gatecheck validate --help

Gatecheck Validate

Bundling Artifacts

Bundling artifacts produces a gzipped tarball and a manifest. list and validate recognize a bundle from that manifest. A name that contains bundle still works when the contents are ambiguous.

gatecheck bundle create gatecheck-bundle.tar.gz grype-report.json

Gatecheck Bundle

Installation

Prerequisites

Before installing Gatecheck, make sure your system meets the following requirements:

  • Operating System: Windows, macOS, or Linux.
  • Go: Version 1.26.0 or newer (only required if you plan to build the application from source).

Installation Options

Gatecheck can be installed either by downloading the pre-compiled binary for your operating system or by compiling the source code.

Option 1: Installing from Binary

  1. Download the Binary: Visit the Gatecheck GitHub releases page at https://github.com/gatecheckdev/gatecheck/releases and download the latest version for your operating system.

  2. Unpack the Binary (if necessary): For Windows and Linux, you may need to unpack the .zip or .tar.gz file.

  3. Move the Binary to a Bin Directory:

    • Windows: Move gatecheck.exe to a directory within your PATH, such as C:\Windows.
    • macOS/Linux: Move gatecheck to a location in your PATH, such as /usr/local/bin. You can use the command mv gatecheck /usr/local/bin in the terminal.
  4. Verify Installation: Open a terminal or command prompt and type gatecheck version or gatecheck --version to ensure the application is installed correctly.

Option 2: Building from Source

  1. Clone the Repository: Clone the Gatecheck repository to your local machine using Git:

    git clone https://github.com/gatecheckdev/gatecheck
    
  2. Navigate to the Repository Directory:

    cd gatecheck
    
  3. Install Task: Ensure you have Task installed.

  4. Build and Install: Run:

    task build
    task install
    

    task build writes ./bin/gatecheck. task install copies that binary to INSTALL_DIR, which defaults to /usr/local/bin, and asks before it copies.

    To build without Task:

    go build -ldflags="-X 'main.cliVersion=$(git describe --tags)' -X 'main.gitCommit=$(git rev-parse HEAD)' -X 'main.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ)' -X 'main.gitDescription=$(git log -1 --pretty=%B)'" -o ./bin/gatecheck ./cmd/gatecheck
    
  5. Verify Installation: Check the application version to confirm successful installation:

    gatecheck version
    

Post-Installation Steps

After installing Gatecheck, you can begin using it by typing gatecheck followed by the necessary commands and options in your terminal or command prompt. For a list of available commands and their descriptions, use:

gatecheck --help

Install scanners

After gatecheck itself is installed, gatecheck bootstrap downloads pinned releases of Grype, Syft, Gitleaks, Trivy, and osv-scanner, and installs semgrep’s experimental native CLI as osemgrep. --tools gosec,hadolint,zizmor,scorecard,trufflehog,cosign adds those. The files live under the gatecheck data directory (GATECHECK_HOME, or the platform default described in Bootstrap).

gatecheck bootstrap
gatecheck grype --help

Troubleshooting

If you encounter any issues during the installation process, ensure that you have the correct permissions to install software on your system and that your Go environment is properly configured. For further assistance, please visit the Gatecheck GitHub issues page or contact support.

For more information on using Gatecheck, refer to the user documentation or the GitHub repository for examples and advanced usage.

Usage

Gatecheck is a lightweight CLI for security reports. It summarizes a report, checks it against a config, downloads EPSS and KEV data, and packs reports into one bundle.

Running gatecheck with no arguments prints nothing and exits 0. gatecheck --help lists the commands. gatecheck config, gatecheck bundle, and gatecheck download print the help for their subcommands.

Commands:

  • gatecheck version prints the build information. gatecheck --version does the same. The --version flag is only on the root command.
  • gatecheck config init prints a default config. gatecheck config convert rewrites one into another format.
  • gatecheck list (aliases ls and print) prints one report. gatecheck list-all prints several.
  • gatecheck validate compares one report, or one bundle, to the config.
  • gatecheck bundle create, bundle add, and bundle remove manage a bundle.
  • gatecheck download epss and gatecheck download kev write the upstream data to standard output. EPSS files are cached until the published date changes.
  • gatecheck bootstrap installs Grype, Syft, Gitleaks, semgrep’s experimental osemgrep CLI, Trivy, and osv-scanner. gatecheck grype, syft, gitleaks, semgrep, osemgrep, trivy, and osv-scanner run those programs. --tools gosec,hadolint,zizmor,scorecard,trufflehog,cosign also installs those, and gatecheck gosec, hadolint, zizmor, scorecard, trufflehog, and cosign run them. See Bootstrap.
  • gatecheck update (aliases self-update and upgrade) replaces this binary with a GitHub release after checking the archive checksum. gatecheck update --check only prints the current and latest versions.
  • gatecheck agent-guide (alias llm) prints a markdown guide for coding agents.
  • gatecheck completion prints a shell completion script. gatecheck help [command] prints help for that command.

list and validate decide the report type from the file contents. The filename is the fallback when the contents are ambiguous. See Supported Reports.

Logs go to standard error. Tables, downloaded data, and config init go to standard output.

Exit status:

  • 0 when the command succeeds. With validate --audit, a threshold failure also exits 0.
  • 1 when a report misses a configured threshold and --audit is off.
  • 2 for a rejected command line, a file that could not be read or written, or a report, config, or VEX file that could not be decoded. --audit does not change this.
  • 3 when EPSS or KEV data could not be downloaded or read. --audit does not change this.
  • The scanner commands return that program’s own status. A scanner that is neither installed nor on PATH exits 2.

Validation lists which validate failures are which status.

--verbose (-v) prints debug logs. --silent prints only warnings and errors. --log-level debug|info|warn|error sets the level directly, and only one of those three flags can be set. --log-format json writes one JSON object per log line instead of text. They are available on every command, and GATECHECK_VERBOSE, GATECHECK_SILENT, GATECHECK_LOG_LEVEL, and GATECHECK_LOG_FORMAT set them from the environment.

Bootstrap

gatecheck bootstrap downloads the scanners whose reports gatecheck reads, checks each file, and installs them under a gatecheck data directory.

gatecheck bootstrap
gatecheck bootstrap --tools grype,syft
gatecheck bootstrap --tools gosec,hadolint,zizmor
gatecheck bootstrap --tools scorecard,trufflehog,cosign
gatecheck bootstrap --list

Pinned versions are compiled into gatecheck. The current pins are Grype 0.121.0, Syft 1.55.0, Gitleaks 8.30.1, semgrep 1.182.1, Trivy 0.76.1, osv-scanner 2.7.0, gosec 2.30.0, hadolint 2.15.1, zizmor 1.32.0, OpenSSF Scorecard 5.6.0, trufflehog 3.99.8, and cosign 3.1.4. They live in internal/bootstrap/versions.go.

gosec, hadolint, zizmor, scorecard, trufflehog, and cosign are not in the default install. gosec, hadolint, and zizmor each check one kind of source (Go code, Dockerfiles, and GitHub Actions workflows). scorecard rates a repository’s supply-chain practices, trufflehog is a second secrets scanner, and cosign verifies signatures. Name them in --tools when you want them.

Directory

Binaries go in bin under the gatecheck home.

GATECHECK_HOME sets that directory. When it is empty, the location is:

  • Linux: $XDG_DATA_HOME/gatecheck, or ~/.local/share/gatecheck.
  • macOS: $XDG_DATA_HOME/gatecheck when XDG_DATA_HOME is set, otherwise ~/Library/Application Support/gatecheck.
  • Windows: %LOCALAPPDATA%\gatecheck, then %APPDATA%\gatecheck, then the user profile.

A second run that already has the pinned file and its version stamp prints <tool> <version> already installed and skips the download. --force downloads again. The stamp is written after the binary is in place.

--list prints every supported tool, or only the ones named in --tools, and does not download. --force is ignored while listing. A binary with no stamp shows unknown. A missing tool shows -.

TOOL         PINNED     INSTALLED  PATH
grype        0.121.0    0.121.0    /home/ada/.local/share/gatecheck/bin/grype
syft         1.55.0     -          -
gitleaks     8.30.1     8.30.1     /home/ada/.local/share/gatecheck/bin/gitleaks
semgrep      1.182.1    1.182.1    /home/ada/.local/share/gatecheck/bin/osemgrep
trivy        0.76.1     0.76.1     /home/ada/.local/share/gatecheck/bin/trivy
osv-scanner  2.7.0      2.7.0      /home/ada/.local/share/gatecheck/bin/osv-scanner
gosec        2.30.0     -          -
hadolint     2.15.1     2.15.1     /home/ada/.local/share/gatecheck/bin/hadolint
zizmor       1.32.0     -          -
scorecard    5.6.0      -          -
trufflehog   3.99.8     3.99.8     /home/ada/.local/share/gatecheck/bin/trufflehog
cosign       3.1.4      -          -

Flags

  • --tools: comma-separated names. The default is grype,syft,gitleaks,semgrep,trivy,osv-scanner. gosec, hadolint, zizmor, scorecard, trufflehog, and cosign are also accepted. Names are lowercased. osemgrep means semgrep. An unknown name is an error: unknown tool "not-a-scanner" (supported: grype, syft, gitleaks, semgrep, trivy, osv-scanner, gosec, hadolint, zizmor, scorecard, trufflehog, cosign).
  • --force: reinstall even when the pinned version is already present.
  • --list: print the table above.

bootstrap takes no positional arguments.

Grype, Syft, Gitleaks, Trivy, gosec, scorecard, and trufflehog

Each tool is a GitHub release asset. gatecheck downloads <name>_<version>_checksums.txt, looks up the asset’s SHA-256, downloads the archive, and checks the digest before extracting the binary. The install is a write to a temporary file in the destination directory, then a rename.

ToolReleaseAsset name
Grypeanchore/grypegrype_<version>_<os>_<arch>.tar.gz, or .zip on Windows
Syftanchore/syftsyft_<version>_<os>_<arch>.tar.gz, or .zip on Windows
Gitleaksgitleaks/gitleaksgitleaks_<version>_<os>_<arch>.tar.gz, or .zip on Windows
Trivyaquasecurity/trivytrivy_<version>_<OS>-<arch>.tar.gz, or .zip on Windows
gosecsecurego/gosecgosec_<version>_<os>_<arch>.tar.gz, on Windows too
scorecardossf/scorecardscorecard_<version>_<os>_<arch>.tar.gz, on Windows too. The checksum file is scorecard_checksums.txt.
trufflehogtrufflesecurity/trufflehogtrufflehog_<version>_<os>_<arch>.tar.gz, on Windows too

Gitleaks names amd64 as x64, 386 as x32, and arm as armv6 or armv7.

Trivy uses its own asset names: Linux-64bit, Linux-32bit, Linux-ARM (armv7), Linux-ARM64, Linux-PPC64LE, Linux-s390x, macOS-64bit, macOS-ARM64, windows-64bit, and FreeBSD-64bit. The checksum file is trivy_<version>_checksums.txt. The archive contains trivy, or trivy.exe on Windows, plus README.md, LICENSE, and template files. gatecheck installs only the binary.

Published assets:

  • Grype: macOS amd64 and arm64; Linux amd64, arm64, ppc64le, and s390x; Windows amd64.
  • Syft: macOS amd64 and arm64; Linux amd64, arm64, ppc64le, riscv64, and s390x; Windows amd64 and arm64.
  • Gitleaks: macOS x64 and arm64; Linux x64, x32, arm64, armv6, and armv7; Windows x64, x32, and arm64.
  • Trivy: macOS amd64 and arm64; Linux 386, amd64, armv7, arm64, ppc64le, and s390x; Windows amd64; FreeBSD amd64.
  • gosec: macOS amd64 and arm64; Linux amd64, arm64, ppc64le, and s390x; Windows amd64 and arm64.
  • scorecard and trufflehog: amd64 and arm64 on macOS, Linux, and Windows.

A platform with no asset fails that tool. The message looks like grype has no published release asset for windows/arm64. Other requested tools still install. The command exits 2 when any requested tool failed this way, or when a download or checksum check failed.

osv-scanner

osv-scanner publishes a raw binary, not an archive. gatecheck downloads osv-scanner_SHA256SUMS from the google/osv-scanner release, checks the asset’s SHA-256, marks the file executable, and installs it as osv-scanner, or osv-scanner.exe on Windows.

Asset names:

  • osv-scanner_linux_amd64 and osv-scanner_linux_arm64
  • osv-scanner_darwin_amd64 and osv-scanner_darwin_arm64
  • osv-scanner_windows_amd64.exe and osv-scanner_windows_arm64.exe

Those six platforms are the published set. Anything else fails that tool with the same kind of message as a missing Grype asset.

hadolint

hadolint also publishes a raw binary. gatecheck downloads checksums.sha256 from the hadolint/hadolint release, checks the asset, and installs it as hadolint, or hadolint.exe on Windows.

Asset names: hadolint-linux-x86_64, hadolint-linux-arm64, hadolint-macos-x86_64, hadolint-macos-arm64, and hadolint-windows-x86_64.exe. Windows arm64 has no asset.

cosign

cosign publishes raw binaries. gatecheck downloads cosign_checksums.txt from the sigstore/cosign release, checks the asset, and installs it as cosign, or cosign.exe on Windows. Assets: cosign-darwin-amd64, cosign-darwin-arm64, cosign-linux-amd64, cosign-linux-arm64, cosign-linux-arm (armv7), cosign-linux-ppc64le, cosign-linux-s390x, cosign-linux-riscv64, and cosign-windows-amd64.exe.

cosign is a gate on its own: cosign verify and cosign verify-blob exit non-zero when a signature does not check out, and gatecheck cosign passes that status through. Put it in the pipeline before validate:

gatecheck cosign verify-blob --bundle app.tar.gz.sigstore.json \
  --certificate-identity-regexp 'https://github.com/example/app/' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com app.tar.gz
gatecheck cosign verify --certificate-identity-regexp 'https://github.com/example/app/' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com ghcr.io/example/app:1.2.3

zizmor

zizmor publishes archives but no checksum file. The SHA-256 of each zizmorcore/zizmor asset for the pinned version is compiled into gatecheck next to the version in internal/bootstrap/versions.go. gatecheck checks the download against that digest before extracting zizmor, or zizmor.exe on Windows. Moving the zizmor pin means updating those digests too.

Asset names: zizmor-x86_64-unknown-linux-gnu.tar.gz, zizmor-aarch64-unknown-linux-gnu.tar.gz, zizmor-x86_64-apple-darwin.tar.gz, zizmor-aarch64-apple-darwin.tar.gz, and zizmor-x86_64-pc-windows-msvc.zip. zizmor’s Linux builds link glibc. Windows arm64 has no asset.

Semgrep (osemgrep)

Semgrep publishes no GitHub release assets. Bootstrap reads https://pypi.org/pypi/semgrep/<version>/json, picks the wheel for this machine, and checks the wheel against the SHA-256 in that JSON.

The wheel contains a native binary at semgrep-<version>.data/purelib/semgrep/bin/semgrep-core, and on Linux a semgrep/bin/libs/ directory of shared libraries. Invoked with argv[0] osemgrep, that binary is semgrep’s experimental native CLI.

On macOS and Linux, gatecheck installs semgrep-core and a symlink named osemgrep in the same directory, plus libs/ beside them. On Windows it installs one copy named osemgrep.exe. Success looks like installed semgrep 1.182.1 /home/ada/.local/share/gatecheck/bin/osemgrep.

Wheels exist for:

  • macOS x86_64 and arm64
  • Linux glibc (manylinux) and musl (musllinux), x86_64 and aarch64
  • Windows amd64

On Linux, gatecheck reads the dynamic linker of its own executable. An interpreter path containing musl selects the musl wheel. Anything else selects the glibc wheel.

A platform with no wheel is skipped. Standard error says semgrep: no PyPI wheel for <platform>; osemgrep wheels are published for macOS (x86_64, arm64), Linux glibc and musl (x86_64, aarch64), and Windows amd64. A wheel that has no semgrep-core is also skipped: semgrep: wheel <filename> does not contain semgrep-core; skipped. A skip leaves the command successful when every other requested tool succeeded. A bad digest or a failed download is still an error.

osemgrep scan is the command that writes Semgrep JSON. gatecheck semgrep and gatecheck osemgrep add --experimental immediately after scan when you did not pass it. Other osemgrep commands need that flag from you. osemgrep --version tries to execute pysemgrep and fails. This works:

gatecheck semgrep --experimental --version

Running a scanner

gatecheck grype dir:. -o json > grype-report.json
gatecheck syft dir:. -o cyclonedx-json > cyclonedx-syft.json
gatecheck gitleaks detect --report-format json --report-path gitleaks-report.json
gatecheck semgrep scan -e 'eval($X)' -l python --json t.py > semgrep-report.json
gatecheck trivy fs --format json --output trivy-report.json .
gatecheck osv-scanner scan source --format json . > osv-scanner-report.json
gatecheck gosec -fmt sarif -out gosec.sarif ./...
gatecheck hadolint -f sarif Dockerfile > hadolint.sarif
gatecheck zizmor --format sarif .github/workflows > zizmor.sarif
GITHUB_AUTH_TOKEN=... gatecheck scorecard --repo github.com/example/app --format json > scorecard-report.json
gatecheck trufflehog git file://. --json > trufflehog-report.json

scorecard and trufflehog JSON are their own report types, gated with the scorecard and trufflehog config sections. See Supported reports.

gosec, hadolint, and zizmor reports are read as SARIF. Gate them with the sarif section of the config. See Supported reports.

Arguments, standard input, standard output, standard error, and the scanner’s exit status are passed through. gatecheck grype --help is Grype’s help. gatecheck does not parse flags after these command names.

The managed binary is used when it is present. Otherwise gatecheck looks on PATH: grype, syft, gitleaks, trivy, osv-scanner, gosec, hadolint, zizmor, scorecard, trufflehog, or cosign for those commands; semgrep and then osemgrep for gatecheck semgrep; osemgrep only for gatecheck osemgrep. --experimental is inserted only when the program that will run is named osemgrep. A Python semgrep on PATH is left unchanged.

When neither copy exists, the command prints one line and exits 2:

gatecheck: grype is not installed; run `gatecheck bootstrap`

The name in that line is the command you typed.

What stays outside bootstrap

Coverage files (LCOV, Clover, Cobertura) come from the language toolchain. Bootstrap does not install those tools.

CycloneDX is a report format. Syft writes it with -o cyclonedx-json, and Grype can write a CycloneDX vulnerability report. Those are the files list and validate score. Any other tool’s CycloneDX JSON BOM is scored the same way. There is no separate CycloneDX scanner.

Syft’s own JSON (-o syft-json) is a package list. list prints its packages and licenses, and validate checks them with the license rules. See License gating. Syft also writes CycloneDX, which gets the same license rules plus the vulnerability rules when the BOM has vulnerabilities.

Trivy JSON (trivy fs --format json, trivy image --format json, and the other Trivy scanners’ JSON output) is a report type. The contents identify it. A filename containing trivy is the fallback when the contents are ambiguous. A CycloneDX BOM stays CycloneDX even when the name contains trivy. Misconfigurations, secrets, and licenses are ignored. Trivy SARIF is a SARIF report.

osv-scanner JSON (osv-scanner scan source --format json) is a report type. The contents identify it when results holds objects with a packages array. A filename containing osv is the fallback, so osv-scanner-report.json still works when the document is only {"results":[]}. Each vulnerability group is one finding. Aliases of that group are not counted again. max_severity is a CVSS base score. License-only packages are skipped.

CLI Reference

Global flags, accepted on every command:

  • -v, --verbose: print debug logs. The same as --log-level debug. GATECHECK_VERBOSE=true is the same setting.
  • --silent: print only warnings and errors. The same as --log-level warn. GATECHECK_SILENT=true is the same setting.
  • --log-level: debug, info, warn, or error. The default is info. GATECHECK_LOG_LEVEL is the same setting.
  • --log-format: text or json. The default is text, colored only when standard error is a terminal and NO_COLOR is unset. GATECHECK_LOG_FORMAT is the same setting.
  • -h, --help: help for that command.

--verbose, --silent, and --log-level cannot be set together. A flag wins over any of the variables. Among the variables, GATECHECK_VERBOSE and GATECHECK_SILENT win over GATECHECK_LOG_LEVEL, and setting both of them to true is an error.

Every setting is read in the same order: a flag on the command line, then its environment variable, then the default. An empty environment variable counts as unset. Boolean variables take true, false, 1, 0, t, or f. Any other value is a usage error, and the command exits 2.

Exit status

  • 0: success.
  • 1: validate found a threshold failure.
  • 2: a usage error, a file that could not be read or written, or a report, config, or VEX file that could not be decoded.
  • 3: EPSS or KEV data could not be downloaded or read.
  • The scanner commands (grype, syft, gitleaks, semgrep, osemgrep, trivy, osv-scanner, gosec, hadolint, zizmor, scorecard, trufflehog, cosign) return the scanner’s own status.

validate --audit turns status 1 into 0. It does not change 2 or 3.

gatecheck

gatecheck [flags]
gatecheck [command]

With no arguments, the command prints nothing and exits 0.

  • --version: print the same build information as gatecheck version. This flag is only on the root command.

gatecheck version

gatecheck version

Prints the logo and the build information: CLI version, git commit, build date, git description, platform, Go version, and compiler. A build that does not pass those values prints [Not Provided].

gatecheck config init

gatecheck config init

Prints a default config to standard output. Every rule is disabled and every coverage threshold is 0. JSON and YAML are indented by two spaces, and TOML tables are indented.

  • -o, --output: json, toml, yaml, or yml, with or without a leading dot, in any case. The default is yaml. Any other value is an error.
gatecheck config init > gatecheck.yaml
gatecheck config init --output json > gatecheck.json

gatecheck config convert

gatecheck config convert

Reads a config file and prints it in another format. Keys gatecheck does not read are named in a warning and left out of the output.

  • -f, --file: file to read. The default is gatecheck.yaml. The extension picks the decoder (.yaml, .yml, .json, .toml).
  • -o, --output: format to write. Same accepted values as config init. The default is yaml.
gatecheck config convert --file gatecheck.yaml --output toml

gatecheck list

gatecheck list [FILE]

Aliases: ls, print.

Prints a table for one report. Use list-all for more than one file. A Grype, CycloneDX, SARIF, Semgrep, Gitleaks, Trivy, osv-scanner, or Syft report with nothing in it prints one sentence and no table: No grype vulnerabilities, No cyclonedx vulnerabilities, No sarif findings, No semgrep findings, No gitleaks findings, No trivy vulnerabilities, No osv-scanner vulnerabilities, or No syft packages. Markdown prints that same sentence.

The report type comes from the file contents. See Supported Reports.

With no filename, the command reads standard input and --input-type is required.

  • -i, --input-type: type word used when the contents are ambiguous, and the type of standard input. It is matched with the same rules as a filename. grype, cyclonedx, sarif, semgrep, gitleaks, trivy, osv, syft, bundle, and the coverage words lcov, clover, and cobertura all work. Clear contents win over this flag. See Supported Reports.
  • --format: table (the default), markdown, or json. JSON is {"columns": [...], "rows": [{column: value}], "footer": {...}}. A report with nothing in it is {"columns": [], "rows": [], "message": "No grype vulnerabilities"}. A bundle is its manifest.
  • --markdown: the same as --format markdown. It cannot be combined with another --format.
  • --epss: add EPSS score and percentile columns. This changes the table for Grype, CycloneDX, Trivy, and osv-scanner. Other report types still list, and the EPSS data is not shown. With no local file, gatecheck downloads the current EPSS CSV and caches it until the published date changes. Requests send a User-Agent with the gatecheck version and project URL.
  • --epss-filename: read that CSV instead of calling the API. GATECHECK_EPSS_FILENAME is the same setting.
  • --epss-url: EPSS API URL. An empty value uses https://epss.cyentia.com. GATECHECK_EPSS_URL is the same setting.
  • --epss-cache-dir: cache directory for that download. GATECHECK_EPSS_CACHE_DIR is the same setting.
  • --epss-no-cache: download on every run. GATECHECK_EPSS_CACHE=off does the same.

A failed EPSS download or an unreadable EPSS file exits 3.

gatecheck list grype-report.json
gatecheck list --format markdown --epss grype-report.json
gatecheck list --format json trivy-report.json
grype bkimminich/juice-shop:latest -o json | gatecheck ls --input-type grype

gatecheck list-all

gatecheck list-all FILE...

Prints each filename, then its table, or one sentence when that report has nothing in it. A file whose contents and name are not a supported list-all type is skipped with a warning. Coverage files are in that skipped set. A file that cannot be read or listed is logged and the command goes on to the next one. When any file could not be read or listed, the command exits 2 after the last file. At least one file is required.

  • --format: table, markdown, or json. JSON is one array: [{"file": "grype-report.json", "report": {...}}], where report is what list --format json prints. Skipped files are not in the array.
  • --markdown: the same as --format markdown.
  • --epss: add EPSS data for Grype, CycloneDX, Trivy, and osv-scanner reports. The type comes from the file contents, then the filename. EPSS data is loaded once, the first time a file needs it.
  • --epss-filename, --epss-url, --epss-cache-dir, and --epss-no-cache: the same as on list, with the same environment variables.

gatecheck validate

gatecheck validate [FILE]

FILE is the report or bundle. With no FILE, --input-type is required, and the report is read from standard input. The config is a flag.

  • -f, --config: config file. GATECHECK_CONFIG_FILENAME is the same setting. With neither, the built-in default config is used (every rule disabled, coverage thresholds 0), and a warning says so. Keys in the config that gatecheck does not read are named in a warning, and the rest of the file is still used.
  • -i, --input-type: report type word, the same as on list. It is used when the contents are ambiguous, and it is required when reading standard input.
  • -a, --audit: print a threshold failure and exit 0. Any other error still fails: a missing report or config is 2, and an EPSS or KEV fetch failure is 3. GATECHECK_AUDIT is the same setting.
  • --format: also print the result to standard output as table, markdown, or json. With no --format, standard output is empty. JSON is {"report": "grype-report.json", "passed": false, "failures": ["Grype: Severity Limit Exceeded"]}, plus "error" when the check stopped on something other than a threshold.
  • --vex: OpenVEX or CycloneDX VEX file. Findings it marks not exploitable are skipped. Repeat the flag for more files. GATECHECK_VEX is a comma-separated list used when the flag is absent. Files in the config’s vex.files are read too. A VEX file that cannot be read exits 2. See VEX.
  • --epss-filename: EPSS CSV to use when an EPSS rule is enabled. GATECHECK_EPSS_FILENAME is the same setting.
  • --epss-url: EPSS feed URL. GATECHECK_EPSS_URL is the same setting.
  • --epss-cache-dir: cache directory used when that CSV is downloaded. GATECHECK_EPSS_CACHE_DIR is the same setting.
  • --epss-no-cache: download on every run. GATECHECK_EPSS_CACHE=off does the same.
  • --kev-filename: CISA KEV JSON to use when a KEV rule is enabled. GATECHECK_KEV_FILENAME is the same setting.
  • --kev-url: KEV feed URL. GATECHECK_KEV_URL is the same setting.

EPSS data is loaded only when an EPSS limit or EPSS risk acceptance rule is enabled. When --epss-filename is not set, gatecheck downloads the current EPSS file and caches it until the published date changes. Requests send a User-Agent with the gatecheck version and project URL.

KEV data is loaded only when kevLimitEnabled is true for Grype, CycloneDX, Trivy, or osv-scanner.

gatecheck validate --config gatecheck.yaml grype-report.json
gatecheck validate --audit --config gatecheck.yaml gatecheck-bundle.tar.gz

See Validation for rule order and exit codes.

gatecheck bundle create

gatecheck bundle create BUNDLE_FILE TARGET_FILE

Alias: init.

Creates a bundle and stores the target file in it. An existing BUNDLE_FILE is replaced. The label is the base name of the target file (reports/grype-report.json is stored as grype-report.json).

  • -t, --tag: tag stored on that file. Repeat the flag for more than one tag. GATECHECK_BUNDLE_TAG is a comma-separated list used when no tag flag is passed.
gatecheck bundle create gatecheck-bundle.tar.gz grype-report.json --tag ci

gatecheck bundle add

gatecheck bundle add BUNDLE_FILE TARGET_FILE

Adds another file to an existing bundle. The label is the base name of the target file. --tag and GATECHECK_BUNDLE_TAG work the same way as on bundle create.

gatecheck bundle remove

gatecheck bundle remove BUNDLE_FILE LABEL

Alias: rm.

Deletes the file with that label. The label is the base name used when the file was added, not a path that is opened. A label that is not in the bundle is an error: the bundle is left as it was and the command exits 2.

gatecheck download epss

gatecheck download epss

Writes the FIRST.org EPSS CSV to standard output.

EPSS scores are cached in the user cache directory, under gatecheck/epss. gatecheck checks the redirect to the dated filename and downloads the CSV only when that file is not already cached. Requests send a User-Agent with the gatecheck version and project URL.

  • --epss-url: API URL. An empty value uses https://epss.cyentia.com. GATECHECK_EPSS_URL is the same setting.
  • --epss-cache-dir: cache directory. GATECHECK_EPSS_CACHE_DIR is the same setting.
  • --epss-no-cache: download on every run. GATECHECK_EPSS_CACHE=off does the same.

A failed download exits 3.

gatecheck download epss > epss.csv

gatecheck download kev

gatecheck download kev

Writes the CISA Known Exploited Vulnerabilities catalog as JSON to standard output.

  • --kev-url: API URL. An empty value uses https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json. GATECHECK_KEV_URL is the same setting.

A failed download exits 3.

gatecheck download kev > kev.json

gatecheck bootstrap

gatecheck bootstrap

Downloads Grype, Syft, Gitleaks, semgrep’s experimental osemgrep CLI, Trivy, and osv-scanner into the gatecheck data directory. gosec, hadolint, zizmor, scorecard, trufflehog, and cosign are installed when named in --tools. Each GitHub asset is checked against the project’s SHA-256 checksum file. zizmor publishes none, so its digests are compiled into gatecheck. The semgrep wheel is checked against the digest in the PyPI JSON. A tool already at the pinned version is skipped. See Bootstrap.

  • --tools: comma-separated scanners. Default grype,syft,gitleaks,semgrep,trivy,osv-scanner. Also accepts gosec, hadolint, zizmor, scorecard, trufflehog, and cosign. osemgrep selects semgrep.
  • --force: download again when the pinned version is already installed.
  • --list: print pinned version, installed version, and path for every supported tool, or for the --tools set. This does not download.

GATECHECK_HOME is the data directory. Binaries are in its bin subdirectory.

gatecheck bootstrap
gatecheck bootstrap --list

gatecheck grype, syft, gitleaks, semgrep, osemgrep, trivy, osv-scanner, gosec, hadolint, zizmor, scorecard, trufflehog, cosign

gatecheck grype [scanner arguments]
gatecheck syft [scanner arguments]
gatecheck gitleaks [scanner arguments]
gatecheck semgrep [scanner arguments]
gatecheck osemgrep [scanner arguments]
gatecheck trivy [scanner arguments]
gatecheck osv-scanner [scanner arguments]
gatecheck gosec [scanner arguments]
gatecheck hadolint [scanner arguments]
gatecheck zizmor [scanner arguments]
gatecheck scorecard [scanner arguments]
gatecheck trufflehog [scanner arguments]
gatecheck cosign [scanner arguments]

Runs the managed binary. Arguments and streams are passed through, and the process exits with the scanner’s status. Flags after the command name are not parsed by gatecheck, so gatecheck grype --help is Grype’s help.

The managed copy is preferred. If it is absent, the same tool name on PATH is used. gatecheck semgrep also accepts osemgrep on PATH. gatecheck osemgrep looks only for osemgrep.

semgrep and osemgrep run the osemgrep binary from the semgrep wheel. For scan, --experimental is added when you omitted it and the program that will run is named osemgrep. Other osemgrep commands need you to pass --experimental. gatecheck semgrep --experimental --version prints the osemgrep version.

If no binary is found, the command prints gatecheck: <name> is not installed; run gatecheck bootstrap`` and exits 2.

gatecheck agent-guide

gatecheck agent-guide

Alias: llm.

Prints a markdown guide for agents that run the CLI. The text is docs/agent-guide.md.

gatecheck agent-guide
gatecheck llm

gatecheck update

gatecheck update

Aliases: self-update, upgrade.

Replaces the running gatecheck binary with a release from https://github.com/gatecheckdev/gatecheck/releases. The running version is main.cliVersion, which goreleaser sets with ldflags. The default is the latest release.

Release archives are named gatecheck_<version>_<os>_<arch>.tar.gz for darwin, linux, and windows. The version in the name has no leading v. Windows archives are tar.gz, the same as the other operating systems. gatecheck downloads checksums.txt and checks the SHA256 before it replaces the binary. A missing or different checksum stops the update.

The new file is written next to the resolved executable (os.Executable, then filepath.EvalSymlinks) and renamed into place. On Windows the running executable is renamed aside first, because a running .exe cannot be overwritten. If that directory is not writable, the command stops and tells you to re-run with sudo or to reinstall into a directory you can write.

A build whose version is unset, dev, [Not Provided], or otherwise not a release version does not update unless --version is set.

  • --check: print the current version and the latest release, then exit 0. The archive is not downloaded.
  • --version vX.Y.Z: install that release instead of the latest. With --check, print that release as the target and do not download.
  • -y, --yes: do not ask for confirmation.

When stdin is a terminal and --yes is not set, gatecheck asks before replacing the binary. When stdin is not a terminal, the update runs only with --yes.

GITHUB_TOKEN, when set, is sent on the GitHub requests. The client uses the default transport, so the proxy environment variables apply. Requests use the same gatecheck User-Agent as EPSS downloads. No other command contacts GitHub for updates.

gatecheck update --check
gatecheck update
gatecheck update --version v0.8.1 --yes

gatecheck completion

gatecheck completion bash
gatecheck completion fish
gatecheck completion powershell
gatecheck completion zsh

Prints a completion script for that shell.

gatecheck help

gatecheck help [command]

Prints help for a command. gatecheck validate --help does the same.

Environment variables

VariableCommandsSame as
GATECHECK_CONFIG_FILENAMEvalidate--config
GATECHECK_AUDITvalidate--audit
GATECHECK_VEXvalidate--vex, comma-separated
GATECHECK_EPSS_FILENAMElist, list-all, validate--epss-filename
GATECHECK_EPSS_URLdownload epss, list, list-all, validate--epss-url
GATECHECK_EPSS_CACHE_DIRdownload epss, list, list-all, validate--epss-cache-dir
GATECHECK_EPSS_CACHEdownload epss, list, list-all, validate--epss-no-cache when the value is off
GATECHECK_KEV_FILENAMEvalidate--kev-filename
GATECHECK_KEV_URLdownload kev, validate--kev-url
GATECHECK_BUNDLE_TAGbundle create, bundle add--tag, as a comma-separated list
GATECHECK_VERBOSEevery command--verbose
GATECHECK_SILENTevery command--silent
GATECHECK_LOG_LEVELevery command--log-level
GATECHECK_LOG_FORMATevery command--log-format
GATECHECK_HOMEbootstrap, grype, syft, gitleaks, semgrep, osemgrep, trivy, osv-scanner, gosec, hadolint, zizmor, scorecard, trufflehog, cosigndata directory; binaries are in bin under it

A flag on the command line wins over its variable. An empty variable counts as unset. GATECHECK_AUDIT, GATECHECK_VERBOSE, and GATECHECK_SILENT take true, false, 1, 0, t, or f, and any other value exits 2. GATECHECK_EPSS_CACHE also disables the cache for 0, false, no, disabled, disable, and none.

List Reports

Most scanning tools can print their own table. Grype is one example:

grype bkimminich/juice-shop:latest -o table

Screenshot Example Grype Table

Gatecheck prints a shorter table from the JSON those tools already emit. Pipe the JSON in, or point the command at a file.

grype bkimminich/juice-shop:latest -o json | gatecheck ls --input-type grype
gatecheck ls grype-scan-report.json

Screenshot Example List

The report type comes from the file contents. The filename, or --input-type on standard input, is used when the contents are ambiguous. grype-scan-report.json still works. See Supported Reports.

--format markdown (or --markdown) prints a markdown table instead of the plain text table. --format json prints {"columns": [...], "rows": [{column: value}]}, plus a footer object for coverage.

--epss adds the EPSS score and percentile for Grype, CycloneDX, Trivy, and osv-scanner. Other reports ignore that data. With no --epss-filename, gatecheck downloads the CSV from FIRST. GATECHECK_EPSS_FILENAME and GATECHECK_EPSS_URL are the same settings as those flags.

gatecheck download epss > epss.csv
gatecheck list --epss --epss-filename epss.csv grype-scan-report.json

Columns:

  • Grype: severity, package, version, link. With --epss: CVE id, severity, EPSS score, EPSS percentile, package, version, link.
  • CycloneDX: CVE id, severity, package, link. With --epss: CVE id, severity, EPSS score, EPSS percentile, affected packages, link.
  • Semgrep: check id, OWASP ids, severity, impact, link. Runtime errors from the report are logged as warnings.
  • Gitleaks: rule id, file, commit, start line.
  • SARIF: rule id, severity, location, tool. A result that passed, is suppressed, or has level none is left out.
  • Trivy: severity, package, version, link. With --epss: CVE id, severity, EPSS score, EPSS percentile, package, version, link. Misconfigurations are omitted.
  • osv-scanner: severity, package, version, link. With --epss: id, severity, EPSS score, EPSS percentile, package, version, link. The id is the first CVE alias, or the OSV id when there is no CVE. Groups are listed once.
  • Coverage: lines, functions, and branches covered, with a percent in the footer. The percent is only for display. The config file uses a ratio. See Configuration.
  • Syft JSON: package, version, type, licenses.
  • Bundle: label, SHA-256 digest, tags, size. With --format json, the bundle manifest.

A Grype, CycloneDX, SARIF, Semgrep, Gitleaks, Trivy, osv-scanner, or Syft report with nothing in it prints one sentence and no table. The lines are No grype vulnerabilities, No cyclonedx vulnerabilities, No sarif findings, No semgrep findings, No gitleaks findings, No trivy vulnerabilities, No osv-scanner vulnerabilities, and No syft packages. Markdown prints that same line. JSON prints {"columns": [], "rows": [], "message": "..."}.

list takes one filename. A second one is a usage error. list-all walks every filename, prints the name, then the table or that sentence, and skips files it does not support. Coverage files are in that skipped set. --epss on list-all adds EPSS columns for Grype, CycloneDX, Trivy, and osv-scanner, including a file whose name does not contain those words when the contents do. The EPSS data is loaded once per run, from --epss-filename or the API. With --format json, list-all prints one array of {"file": ..., "report": ...}. When a file cannot be read or listed, the others are still listed and the command exits 2.

gatecheck list-all grype-scan-report.json semgrep-report.json

Gatecheck Bundle

A bundle is a gzipped tar with a JSON manifest. It holds the report bytes, a SHA-256 digest, and any tags you set. The suggested name is gatecheck-bundle.tar.gz. list and validate treat a file as a bundle when the gzipped tar contains gatecheck-manifest.json. When the contents are ambiguous, validate still requires bundle in the name, and list also accepts gatecheck.

Create

gatecheck bundle create gatecheck-bundle.tar.gz grype-report.json --tag ci

bundle init is the same command. The label stored in the manifest is the base name of the target file. validate reads each stored file’s contents to pick the type, and uses the label only when the contents are ambiguous. A CycloneDX, Trivy, or osv-scanner file is still validated as that type when the stored name would suggest something else.

Repeat --tag for more than one tag. When the flag is omitted, GATECHECK_BUNDLE_TAG is read as a comma-separated list.

Add

gatecheck bundle add gatecheck-bundle.tar.gz semgrep-report.json
gatecheck bundle add gatecheck-bundle.tar.gz gitleaks-report.json --tag audit

The bundle file has to exist already.

Remove

gatecheck bundle remove gatecheck-bundle.tar.gz semgrep-report.json

bundle rm is the same command. The second argument is the label. A label that is not in the bundle is an error. The bundle is left unchanged and the command exits 2.

Inspect

There is no bundle list subcommand. List the manifest with list:

gatecheck list gatecheck-bundle.tar.gz

The table columns are label, digest, tags, and size.

Validate

gatecheck validate --config gatecheck.yaml gatecheck-bundle.tar.gz

Each stored file is checked on its own with the same rules as a standalone file. Files that do not match a supported type are skipped. Syft JSON is checked with the license rules. A Grype failure and a Semgrep failure in the same bundle are both reported, and the command exits 1.

Validation

gatecheck validate --config gatecheck.yaml grype-report.json
gatecheck validate --config gatecheck.yaml gatecheck-bundle.tar.gz

Pass the config with --config or -f, or with GATECHECK_CONFIG_FILENAME. The positional argument is the report path. With no path, --input-type names the report type and the report is read from standard input:

grype dir:. -o json | gatecheck validate --config gatecheck.yaml --input-type grype

--format table, markdown, or json also prints the result to standard output. Keys in the config that gatecheck does not read are named in a warning, so a typo such as severityLimt does not silently disable a rule.

The report type comes from the file contents, and from the filename when the contents are ambiguous. See Supported Reports.

With no config, gatecheck warns and uses the default: every rule disabled, coverage thresholds 0. Grype, CycloneDX, Trivy, osv-scanner, SARIF, Semgrep, Gitleaks, coverage, and bundle reports pass under that default. Syft JSON passes too, since the license rules are off by default. An old config with no sarif section leaves those limits disabled.

Exit status

  • 0: the report passed.
  • 1: a threshold failed. The error text starts with validation failure:.
  • 2: the report, config, VEX, EPSS, or KEV file could not be opened or decoded, the report type is not supported, the config extension is not supported, or the command line was rejected.
  • 3: EPSS or KEV data could not be downloaded or read.

--audit (-a) prints a threshold failure and exits 0. It does not hide anything else: those errors still exit 2 or 3. GATECHECK_AUDIT=true is the same setting, and --audit=false overrides it.

Grype, CycloneDX, Trivy, and osv-scanner

Trivy uses these same rules. It counts vulnerability entries from Results[].Vulnerabilities. Misconfigurations, secrets, and licenses are not scored. An id matches VulnerabilityID or a VendorIDs entry, without regard to case. EPSS and KEV look up the first id that starts with CVE-.

osv-scanner uses these same rules. It counts one finding per vulnerability group, so aliases are not double-counted. License-only packages are skipped. max_severity is a CVSS base score (9.8 is critical, 7.5 is high, 4.0 is medium, 0.1 is low). The words CRITICAL, HIGH, MEDIUM, LOW, MODERATE, and UNKNOWN are accepted, and MODERATE maps to medium. A CVSS vector with no numeric score is unknown unless database_specific.severity supplies a rating. Deny, allow, and KEV match the OSV id or any alias. EPSS and KEV look up the first id that starts with CVE-.

Rules run in this order. A failure returns immediately, except where a rule only removes findings.

  1. CVE limit. cveLimit, when enabled, fails if any listed id is in the report. Ids are compared without regard to case.
  2. Disabled Grype, Trivy, and osv-scanner severities. Grype, Trivy, and osv-scanner drop findings whose severity limit is disabled. If the EPSS limit is also enabled, a finding at a disabled severity stays in the report when it has an EPSS score greater than or equal to that limit. CycloneDX leaves findings at a disabled severity in the report, so they still go through the KEV and EPSS rules.
  3. CVE risk acceptance and VEX. Matching ids are removed and skip the remaining rules. Findings that a VEX file passed with --vex, GATECHECK_VEX, or vex.files marks not_affected, fixed, false_positive, or resolved are removed too. See VEX.
  4. KEV limit. When kevLimitEnabled is true, a CVE that is in the catalog fails the report. The catalog is --kev-filename (GATECHECK_KEV_FILENAME) or, with no file, the CISA feed. --kev-url (GATECHECK_KEV_URL) changes the feed. Grype ids are compared without regard to case, and a Grype match’s related CVE ids are checked too.
  5. EPSS risk acceptance. A CVE is removed when the configured score is greater than that CVE’s EPSS score. A CVE with no EPSS row is kept. A CVE whose score is equal to the configured score is kept.
  6. EPSS limit. A CVE fails when its EPSS score is greater than score. A CVE with no EPSS row passes this rule. A score equal to the limit passes. Data comes from --epss-filename or GATECHECK_EPSS_FILENAME, or from the API. --epss-url (GATECHECK_EPSS_URL) changes the API.
  7. Severity limit. For each enabled severity, the report fails when the count is greater than limit. limit: 0 allows none. Counts that are equal to the limit pass. Grype, CycloneDX, Trivy, and osv-scanner severities are critical, high, medium, and low. negligible and unknown have no limit field.

Any CycloneDX JSON BOM uses the cyclonedx rules, including a BOM from Grype, Trivy, Syft, or another tool. The severity is the highest rating. A rating with a score and no severity word uses CVSS ranges. A CVSS v2 method does not produce critical. important counts as high, and moderate counts as medium. negligible counts as none. Empty ratings use a top-level severity string when the producer set one, otherwise unknown. unknown, none, and info are not counted by the critical, high, medium, or low limits. The id is the vulnerability id, or the bom-ref when id is empty.

EPSS scores in the config are ratios from 0 to 1.

When a rule needs EPSS scores and --epss-filename is not set, gatecheck downloads the current EPSS file and caches it until the published date changes. Requests send a User-Agent with the gatecheck version and project URL.

Licenses

Syft JSON and CycloneDX BOMs are checked against the license section of the config: deny patterns, an optional allow list, packages with no license, and per-package risk acceptance. For a CycloneDX BOM the license rules run alongside the vulnerability rules above, and both failures are reported. See License gating.

Semgrep

  1. Findings whose severity limit is disabled are dropped.
  2. Impact risk acceptance. When enabled, a finding is removed when its impact is high, medium, or low and that level’s boolean is true. The three booleans are independent.
  3. Severity limit. Severities are error, warning, and info. The report fails when an enabled severity has more findings than its limit.

SARIF

Rules run in this order. A failure returns immediately, except where a rule only removes findings.

  1. Rule limit. ruleLimit, when enabled, fails if any listed rule id is in the report. Ids are compared without regard to case. This runs before disabled severities are dropped, so a denied rule fails even when its severity limit is disabled.
  2. Disabled severities. Findings whose severity limit is disabled are dropped. none has no limit field and stays in the report, but the severity rule does not count it.
  3. Rule risk acceptance. Matching rule ids are removed and skip the remaining rules.
  4. Severity limit. For each enabled severity, the report fails when the count is greater than limit. limit: 0 allows none. Counts that are equal to the limit pass. Severities are critical, high, medium, and low.

The severity mapping is in Configuration. These results are not counted: kind of pass or notApplicable, level of none, a non-empty suppressions array, and baselineState of absent.

SARIF has no EPSS or KEV rules. A SARIF version other than 2.1.0 returns an error.

Gitleaks

When limitEnabled is true, any finding in the report fails validation. There is no numeric limit and no separate allow list.

trufflehog

When trufflehog.limitEnabled is true, any finding fails validation. With verifiedOnly: true, only findings trufflehog verified as live count. Empty output, from a scan with no findings, passes when the file name contains trufflehog.

Scorecard

When scorecard.enabled is true, the report fails when the aggregate score is less than minScore, or a listed check scores less than its own minScore. Inconclusive checks (score -1) and checks missing from the report are skipped with a warning. Every failing check is named in the error.

Coverage

Line, function, and branch coverage are each covered / total. The config thresholds are those ratios, from 0 to 1. The check fails when the report’s ratio is less than the threshold. A ratio equal to the threshold passes. All three checks run, and each failure is reported. A report with no records of a kind, such as LCOV without branch records, has no ratio for it. list prints N/A, and validate skips that threshold with a warning.

0.8 means 80 percent. A threshold over 1 is read as a percent, so 80 means 0.8, and a warning is logged.

list prints coverage as a percent. The config value stays a ratio.

Bundles

A bundle is validated when its contents are a Gatecheck bundle, or when the filename contains bundle and the contents do not identify another type. Each stored file is validated with the rules above. The file contents pick the type, and the label is the fallback. Labels that still do not match are skipped. Syft JSON in a bundle is checked with the license rules. Failures are combined, and the command exits 1 if any label fails a threshold.

VEX

A VEX (Vulnerability Exploitability eXchange) document says whether a vulnerability actually affects your software. validate reads OpenVEX and CycloneDX VEX files and skips the findings they mark as not exploitable. Your risk decisions can then live in a VEX file that other tools also read, not only in the cveRiskAcceptance lists in the gatecheck config.

gatecheck validate --config gatecheck.yaml --vex app.openvex.json grype-report.json
gatecheck validate --vex app.openvex.json --vex vendor.cdx.json trivy-report.json

VEX applies to Grype, CycloneDX, Trivy, and osv-scanner reports, and to those reports inside a bundle. SARIF, Semgrep, Gitleaks, and coverage reports are not affected.

Where the files come from

  • --vex FILE on validate. Repeat the flag for more files.
  • GATECHECK_VEX, a comma-separated list of files. It is read only when --vex is not given.
  • vex.files in the config. These are read along with the flag or environment files.
vex:
  files:
    - .vex/app.openvex.json

Relative paths are read from the working directory. A file that is missing, is not JSON, or is neither format is an error, and validate exits 2 without checking the report, even with --audit.

Which statuses skip a finding

FormatSkips the findingKeeps the finding
OpenVEX statusnot_affected, fixedaffected, under_investigation
CycloneDX analysis.statenot_affected, false_positive, resolved, resolved_with_pedigreeexploitable, in_triage

A CycloneDX vulnerability with no analysis is ignored.

Matching a statement to a finding

A statement matches a finding when one of its ids matches one of the finding’s ids, without regard to case.

  • OpenVEX ids are vulnerability.name, vulnerability.@id, and vulnerability.aliases. The older form, where vulnerability is a plain string, also works.
  • CycloneDX ids are the vulnerability id and its references[].id.
  • Finding ids are the Grype vulnerability id plus relatedVulnerabilities, the CycloneDX id plus its references, Trivy’s VulnerabilityID plus VendorIDs, and the osv-scanner id plus its aliases.

A statement can also name packages, as package URLs (purls):

  • OpenVEX: the subcomponents of each product, or the older statement-level subcomponents. Each one is an @id or identifiers.purl.
  • CycloneDX: the affects[].ref entries. A ref is looked up in the document’s components to find its purl. A ref that is already a purl is used as-is.

When a statement names packages, it matches only findings in one of them. The purl type, namespace, and name have to be equal. The version has to be equal too when the statement’s purl has one. Qualifiers such as ?arch=amd64 and subpaths are ignored. When a statement names no packages, or the finding has no purl, the id alone decides.

gatecheck does not check the OpenVEX product itself, such as pkg:oci/app@sha256:.... It does not know which product the report was made from. Keep one VEX file per product, and pass the one that goes with the report.

Finding purls come from Grype artifact.purl, the CycloneDX component for each affects ref, and Trivy PkgIdentifier.PURL. For osv-scanner they are built from the ecosystem, name, and version, for Go, npm, PyPI, crates.io, Maven, RubyGems, NuGet, Packagist, Pub, and Hex. A CycloneDX vulnerability that affects several packages is skipped only when every one of them is covered.

When several statements match a finding, the one with the latest timestamp decides. The timestamp is last_updated or timestamp on the statement, then on the document. For CycloneDX it is analysis.lastUpdated, then updated, analysis.firstIssued, published, and metadata.timestamp. Ties go to the statement read last. An affected statement dated after a not_affected one puts the finding back.

Where VEX runs in validation

VEX runs right after the CVE deny list and alongside cveRiskAcceptance. See Validation.

  • A cveLimit deny list entry still fails the report, even when a VEX file says the CVE is not exploitable.
  • A finding that VEX skips is not counted by the KEV limit, the EPSS rules, or the severity limits.

Each skipped finding is logged at info level with its id, the VEX status, the justification, and the file it came from.

License gating

validate can fail an SBOM whose packages use licenses you do not want, such as GPL in a closed-source product, or packages with no license at all.

License rules read two kinds of report:

  • Syft JSON (syft -o syft-json or syft -o json). Each artifacts[] entry is a package. Its licenses are each spdxExpression, or value when the expression is empty. Older Syft output, where licenses is a list of strings, also works.
  • CycloneDX JSON. Each component, including nested components, is a package. Its licenses are each licenses[].expression, licenses[].license.id, or licenses[].license.name.

Bundles check each Syft or CycloneDX file inside them the same way.

gatecheck syft dir:. -o syft-json=sbom.syft.json -o cyclonedx-json=sbom.cdx.json
gatecheck validate --config gatecheck.yaml sbom.syft.json
gatecheck list sbom.syft.json

gatecheck list on Syft JSON prints each package with its version, type, and licenses.

Config

license:
  enabled: true
  deny:
    - GPL-*
    - AGPL-*
  allow: []
  denyUnknown: false
  packageRiskAcceptance:
    - name: busybox
    - purl: pkg:apk/alpine/apk-tools
      metadata:
        tags:
          - reviewed 2026-11
  • enabled turns the rules on. With enabled: false (the default), Syft JSON and CycloneDX BOMs pass the license rules.
  • deny lists patterns that fail a license.
  • allow, when it is not empty, fails every license that matches none of its patterns. Leave it empty to allow everything that is not denied.
  • denyUnknown fails a package that declares no license, or only NOASSERTION, NONE, or UNKNOWN. With false, those packages pass.
  • packageRiskAcceptance skips the license check for listed packages. An entry with purl matches by package URL type, namespace, and name, and by version when the purl has one. Otherwise name matches the package name without regard to case.

Patterns are case-insensitive globs. * matches any run of characters, and ? matches one. GPL-* matches GPL-2.0-only and GPL-3.0-or-later. It does not match LGPL-2.1-only or a bare GPL. A pattern with no wildcard has to equal the license. Free-text names such as Public Domain are compared the same way.

Expressions

Licenses can be SPDX expressions. AND binds tighter than OR, parentheses group, and the operators are case-insensitive.

  • MIT OR GPL-3.0-only passes when either side passes, since you can choose MIT.
  • MIT AND GPL-3.0-only passes only when both sides pass.
  • GPL-2.0-only WITH Classpath-exception-2.0 is checked as the full string and as GPL-2.0-only. A deny pattern that matches either one fails it. An allow entry that matches the full WITH string passes it even when the base license is denied.

A package that lists several licenses has to pass each of them, as if they were joined with AND. A string that is not a valid expression, such as GPL v2 or later, is checked as one license name.

Results

Each failing package is logged with its name, version, purl, and the reason, such as GPL-2.0-only is denied by "GPL-*". The report then fails with validation failure: License: N package(s) failed the license policy, and validate exits 1.

For a CycloneDX BOM, the license rules and the vulnerability rules both run. Both failures are reported.

Examples

Config and one report

gatecheck config init > gatecheck.yaml
gatecheck validate --config gatecheck.yaml grype-report.json

The file from config init has every rule disabled, so this passes until you turn a rule on. For 80 percent line coverage, set coverage.lineThreshold to 0.8.

EPSS from a local file

gatecheck download epss > epss.csv
gatecheck list --epss --epss-filename epss.csv grype-report.json

Bundle

The bundle name contains bundle. Each report’s contents identify its type. The base name becomes the label inside the bundle and is used only when the contents are ambiguous.

gatecheck bundle create gatecheck-bundle.tar.gz grype-report.json --tag ci
gatecheck bundle add gatecheck-bundle.tar.gz semgrep-report.json
gatecheck bundle add gatecheck-bundle.tar.gz gitleaks-report.json
gatecheck list gatecheck-bundle.tar.gz
gatecheck validate --config gatecheck.yaml gatecheck-bundle.tar.gz

Audit

gatecheck validate --audit --config gatecheck.yaml grype-report.json

A threshold failure is printed and the process exits 0. A missing report still exits 2, and an EPSS or KEV download failure still exits 3.

Bootstrap a scanner

gatecheck bootstrap --tools grype,semgrep
gatecheck grype dir:. -o json > grype-report.json
gatecheck semgrep scan -e 'eval($X)' -l python --json t.py > semgrep-report.json
gatecheck validate --config gatecheck.yaml grype-report.json
gatecheck validate --config gatecheck.yaml semgrep-report.json
gatecheck bootstrap --tools trivy
gatecheck trivy fs --format json --output trivy-report.json .
gatecheck validate --config gatecheck.yaml trivy-report.json
gatecheck bootstrap --tools osv-scanner
gatecheck osv-scanner scan source --format json . > osv-scanner-report.json
gatecheck validate --config gatecheck.yaml osv-scanner-report.json
gatecheck bootstrap --tools gosec,hadolint,zizmor
gatecheck gosec -fmt sarif -out gosec.sarif ./...
gatecheck hadolint -f sarif Dockerfile > hadolint.sarif
gatecheck zizmor --format sarif .github/workflows > zizmor.sarif
gatecheck validate --config gatecheck.yaml gosec.sarif

gatecheck semgrep scan adds --experimental when you omit it. That flag selects semgrep’s experimental native CLI, osemgrep, which writes the same Semgrep JSON list and validate already accept. gatecheck semgrep --experimental --version prints the osemgrep version.

Standard input

grype bkimminich/juice-shop:latest -o json | gatecheck list --input-type grype

Several files

gatecheck list-all grype-report.json cyclonedx-report.json semgrep-report.json

list-all skips a coverage file such as lcov.info. List that file with gatecheck list lcov.info.

Supported Reports

list and validate pick a report type from the file contents. The filename is used only when the contents do not identify a type.

Content rules, in this order:

  1. A gzipped tar that contains gatecheck-manifest.json is a Gatecheck bundle.
  2. bomFormat of CycloneDX is CycloneDX JSON. This wins when the name contains grype, syft, trivy, or osv, and it wins when the tool that wrote the BOM was Grype, Syft, Trivy, or another tool.
  3. SARIF 2.1.0. The top-level version is the string 2.1.0 and runs is an array. A $schema that mentions SARIF is enough when runs is missing or null. gosec (-fmt sarif), hadolint (-f sarif), and zizmor (--format sarif) write this type, and gatecheck bootstrap --tools gosec,hadolint,zizmor installs them.
  4. Grype JSON. descriptor.name is grype, or matches is a non-empty array of objects with vulnerability and artifact.
  5. Syft JSON. descriptor.name is syft, or schema.url points at the Syft schema. list prints its packages and licenses. validate runs the license rules. A Syft CycloneDX BOM is CycloneDX, not Syft.
  6. Semgrep JSON. results is an array of objects with check_id, or results and errors are both arrays. Semgrep’s SARIF output is SARIF, not this type.
  7. Gitleaks JSON. A non-empty array of objects with RuleID and one of File, Commit, or Fingerprint.
  8. Trivy JSON (--format json). SchemaVersion is a number, and ArtifactType is set or Results is an array. Vulnerability entries are listed and validated. Misconfigurations, secrets, and licenses in the same file are ignored.
  9. osv-scanner JSON (osv-scanner scan source --format json). results is a non-empty array of objects with a packages array. One finding per vulnerability group. Aliases of that group are not counted again. License-only packages are skipped. Semgrep is checked first, so a check_id stays Semgrep.
  10. OpenSSF Scorecard JSON (scorecard --format json). scorecard.version is set and checks is an array.
  11. trufflehog JSON (trufflehog ... --json). Each line is an object with DetectorName and SourceMetadata. One line is enough. Lines that are not findings are skipped.
  12. LCOV text. A line starts with SF: and the file also has DA:, LF:, or end_of_record.
  13. Clover XML. An XML document with clover= or a <clover element.
  14. Cobertura XML. An XML document with line-rate=.

CycloneDX XML is not read. The CycloneDX support is JSON.

When none of those match, the filename is checked. The match is a lowercase substring, and the first match wins:

  1. grype
  2. cyclonedx. This is before trivy, so an ambiguous file named cyclonedx-trivy-sbom.json is CycloneDX.
  3. semgrep
  4. gitleaks
  5. trivy
  6. osv. osv-scanner-report.json matches. OSV-scanner.json does not.
  7. syft
  8. sarif
  9. scorecard
  10. trufflehog. Empty trufflehog output, from a scan that found nothing, needs this name.
  11. bundle. list also accepts a name containing gatecheck. validate requires the word bundle for this fallback. A real bundle is still detected from its contents when the name is project.gcb.
  12. Coverage, when the name contains lcov, clover, cobertura, or coverage, or when it ends in .info.

The filename match is case sensitive. Grype-report.json and OSV-scanner.json are not filename matches. A Grype report is still recognized from its contents when descriptor.name is grype. A Trivy or osv-scanner report is still recognized from the rules above.

An empty Grype document such as {"matches":[]} does not identify itself. The filename is what selects it. The same is true of {"results":[]} and [].

Coverage format when the name is the only signal, checked in this order:

  • The name contains lcov, or ends in .info: LCOV.
  • The name contains clover: Clover XML.
  • The name ends in .xml: Cobertura XML.

A name that only contains coverage, such as coverage.json, is selected as coverage and then fails, because the format is not one of those three and the contents did not identify one.

From standard input, list still requires --input-type, so the command does not wait on a terminal. The value is matched as if it were a filename called stdin:<value>, and only when the contents are ambiguous. Clear contents win over --input-type.

grype bkimminich/juice-shop:latest -o json | gatecheck list --input-type grype

list-all lists a file when the contents or the name identify Grype, Semgrep, Gitleaks, Syft, CycloneDX, SARIF, Trivy, osv-scanner, Scorecard, trufflehog, or a bundle. Coverage files are skipped with a warning. There is no --input-type flag on list-all.

Inside a bundle, validate uses the same content rules on each stored file, and falls back to the label. The label is the base name of the file you added. Labels that still do not match are skipped. Syft JSON inside a bundle is checked with the license rules.

What each command can do:

Reportlistvalidatebundle
Grypeyesyesyes
CycloneDX JSONyesyesyes
SARIF 2.1.0yesyesyes
Semgrep JSONyesyesyes
Gitleaksyesyesyes
Trivyyesyesyes
osv-scanneryesyesyes
LCOV, Clover, Coberturayesyesyes
Syft JSONyes, packages and licensesyes, license rulesyes
OpenSSF Scorecard JSONyesyes, scorecard rulesyes
trufflehog JSONyes, without secret valuesyes, trufflehog rulesyes
Bundlewhen the contents are a bundle, or the name contains bundle or gatecheckwhen the contents are a bundle, or the name contains bundleyes, as an ordinary file

Configuration

validate reads YAML, JSON, or TOML. The extension selects the format: .yaml, .yml, .json, or .toml.

gatecheck config init > gatecheck.yaml

config init writes to standard output. -o / --output accepts json, .json, toml, .toml, yaml, yml, .yaml, and .yml. The default is yaml.

gatecheck config convert --file gatecheck.yaml --output json

config convert reads --file / -f (default gatecheck.yaml) and writes the other format to standard output.

A partial file is fine. Omitted fields keep the default. Keys gatecheck does not read are named in a warning when validate or config convert loads the file, and the rest of the file is still used.

GATECHECK_CONFIG_FILENAME is the same setting as validate --config.

Field names below are the ones config init emits. In YAML they are case sensitive. Use the lowercase names.

Default file

This is what gatecheck config init prints.

version: "1"
metadata:
  tags: []
grype:
  severityLimit:
    critical:
      enabled: false
      limit: 0
    high:
      enabled: false
      limit: 0
    medium:
      enabled: false
      limit: 0
    low:
      enabled: false
      limit: 0
  epssLimit:
    enabled: false
    score: 0
  kevLimitEnabled: false
  cveLimit:
    enabled: false
    cves: []
  epssRiskAcceptance:
    enabled: false
    score: 0
  cveRiskAcceptance:
    enabled: false
    cves: []
cyclonedx:
  severityLimit:
    critical:
      enabled: false
      limit: 0
    high:
      enabled: false
      limit: 0
    medium:
      enabled: false
      limit: 0
    low:
      enabled: false
      limit: 0
  epssLimit:
    enabled: false
    score: 0
  kevLimitEnabled: false
  cveLimit:
    enabled: false
    cves: []
  epssRiskAcceptance:
    enabled: false
    score: 0
  cveRiskAcceptance:
    enabled: false
    cves: []
trivy:
  severityLimit:
    critical:
      enabled: false
      limit: 0
    high:
      enabled: false
      limit: 0
    medium:
      enabled: false
      limit: 0
    low:
      enabled: false
      limit: 0
  epssLimit:
    enabled: false
    score: 0
  kevLimitEnabled: false
  cveLimit:
    enabled: false
    cves: []
  epssRiskAcceptance:
    enabled: false
    score: 0
  cveRiskAcceptance:
    enabled: false
    cves: []
osv-scanner:
  severityLimit:
    critical:
      enabled: false
      limit: 0
    high:
      enabled: false
      limit: 0
    medium:
      enabled: false
      limit: 0
    low:
      enabled: false
      limit: 0
  epssLimit:
    enabled: false
    score: 0
  kevLimitEnabled: false
  cveLimit:
    enabled: false
    cves: []
  epssRiskAcceptance:
    enabled: false
    score: 0
  cveRiskAcceptance:
    enabled: false
    cves: []
semgrep:
  severityLimit:
    error:
      enabled: false
      limit: 0
    warning:
      enabled: false
      limit: 0
    info:
      enabled: false
      limit: 0
  impactRiskAcceptance:
    enabled: false
    high: false
    medium: false
    low: false
gitleaks:
  limitEnabled: false
sarif:
  severityLimit:
    critical:
      enabled: false
      limit: 0
    high:
      enabled: false
      limit: 0
    medium:
      enabled: false
      limit: 0
    low:
      enabled: false
      limit: 0
  ruleLimit:
    enabled: false
    rules: []
  ruleRiskAcceptance:
    enabled: false
    rules: []
coverage:
  lineThreshold: 0
  functionThreshold: 0
  branchThreshold: 0
vex:
  files: []
license:
  enabled: false
  deny: []
  allow: []
  denyUnknown: false
  packageRiskAcceptance: []
scorecard:
  enabled: false
  minScore: 0
  checks: []
trufflehog:
  limitEnabled: false
  verifiedOnly: false

version and metadata

version is the string "1". metadata.tags is a list of strings. Neither one changes validation.

Grype, CycloneDX, Trivy, and osv-scanner

grype, cyclonedx, trivy, and osv-scanner use the same fields. Trivy scores vulnerability entries. Misconfigurations, secrets, and licenses in the Trivy JSON are ignored. A Trivy id matches VulnerabilityID and each VendorIDs entry.

osv-scanner counts one finding per vulnerability group. Aliases of that group are not counted again. License-only packages are skipped. max_severity is a CVSS base score: 9.0 and above is critical, 7.0 high, 4.0 medium, 0.1 low, and anything lower is unknown. The words CRITICAL, HIGH, MEDIUM, LOW, MODERATE, and UNKNOWN are also accepted. MODERATE is medium. A CVSS vector with no numeric score is unknown. database_specific.severity is used when max_severity is empty. Deny, allow, and KEV match the OSV id or any alias. EPSS and KEV look up the first id that starts with CVE-.

severityLimit has critical, high, medium, and low. Each has enabled and limit. limit is a count. The report fails when the number of findings at that severity is greater than limit. enabled: true and limit: 0 allows none. enabled: false skips that severity.

epssLimit.score and epssRiskAcceptance.score are EPSS ratios from 0 to 1, the same scale as the FIRST CSV. The limit fails when a CVE’s score is greater than score. Risk acceptance removes a CVE when score is greater than that CVE’s score. See Validation for the order and the equal-score cases.

kevLimitEnabled fails the report when any remaining CVE is in the CISA catalog.

cveLimit and cveRiskAcceptance each have enabled and cves. A CVE entry is id plus an optional metadata.tags list. id is compared without regard to case.

VEX

vex.files lists OpenVEX or CycloneDX VEX documents. validate reads them along with any --vex files, and skips the Grype, CycloneDX, Trivy, and osv-scanner findings they mark as not exploitable. Relative paths are read from the working directory. See VEX.

grype:
  cveLimit:
    enabled: true
    cves:
      - id: CVE-2024-0001
        metadata:
          tags:
            - denied
  cveRiskAcceptance:
    enabled: true
    cves:
      - id: CVE-2023-5678
        metadata:
          tags:
            - accepted

Semgrep

severityLimit has error, warning, and info. Each has enabled and limit, with the same meaning as the Grype counts.

impactRiskAcceptance has enabled, high, medium, and low. When enabled is true, a finding is removed when its impact matches a level whose value is true. high, medium, and low are separate switches.

Gitleaks

limitEnabled: true fails validation when the report contains any finding. false skips the check. There is no count.

trufflehog

trufflehog gates trufflehog --json output, a second secrets scanner next to Gitleaks.

trufflehog:
  limitEnabled: true
  verifiedOnly: false

limitEnabled: true fails validation when the report has any finding. verifiedOnly: true counts only the secrets trufflehog verified as live, so unverified matches are logged and do not fail. Secret values in the report are never decoded, listed, or logged.

Scorecard

scorecard gates an OpenSSF Scorecard report from scorecard --format json.

scorecard:
  enabled: true
  minScore: 6
  checks:
    - name: Dangerous-Workflow
      minScore: 10
    - name: Token-Permissions
      minScore: 5

Scores are 0 to 10. minScore fails the report when the aggregate score is lower. 0 lets any aggregate pass. Each checks entry fails the report when that check scores lower than its minScore. Check names are compared without regard to case. A check scored -1 (inconclusive, such as Signed-Releases on a repo with no releases) is skipped with a warning, and so is a named check that is not in the report. A score equal to the minimum passes.

SARIF

sarif is for any SARIF 2.1.0 report. Semgrep’s own JSON still uses semgrep. semgrep --sarif uses sarif.

severityLimit has critical, high, medium, and low. Each has enabled and limit, with the same count rule as Grype.

The severity comes from the SARIF property security-severity when a result or its rule has one. The value is a number from 0 to 10, or a numeric string. The ranges are the ones GitHub code scanning uses:

  • 9.0 and above: critical
  • 7.0 to 8.9: high
  • 4.0 to 6.9: medium
  • above 0 and below 4.0: low
  • 0: none, and the severity limit does not count it

A result property wins over the same property on the rule. When neither is set, gatecheck uses the SARIF level. A missing result level uses the rule’s defaultConfiguration.level, then warning.

  • error: high
  • warning: medium
  • note: low
  • none: the result is ignored

ruleLimit is the deny list. ruleRiskAcceptance is the allow list. Each has enabled and rules. A rule entry is id plus an optional metadata.tags list. id is compared without regard to case.

sarif:
  ruleLimit:
    enabled: true
    rules:
      - id: CKV_AWS_21
        metadata:
          tags:
            - denied
  ruleRiskAcceptance:
    enabled: true
    rules:
      - id: B101
        metadata:
          tags:
            - accepted

See Validation for which results are counted and the order of the rules.

License

license gates the package licenses in Syft JSON and CycloneDX BOMs.

license:
  enabled: true
  deny: [GPL-*, AGPL-*]
  allow: []
  denyUnknown: false
  packageRiskAcceptance:
    - name: busybox
    - purl: pkg:apk/alpine/apk-tools

deny and allow are case-insensitive glob patterns. A non-empty allow fails every license that matches none of its patterns. denyUnknown fails packages with no declared license. packageRiskAcceptance entries match by purl, or by name when there is no purl. SPDX expressions with AND, OR, and WITH are evaluated. See License gating.

Coverage

lineThreshold, functionThreshold, and branchThreshold are ratios from 0 to 1:

  • line coverage is covered lines divided by total lines
  • function coverage is covered functions divided by total functions
  • branch coverage is covered branches divided by total branches

The report fails when its ratio is less than the threshold. 0.8 is 80 percent. A threshold over 1 is read as a percent: 80 means 0.8, and validate logs a warning. Write the ratio to avoid the warning.

There is no enabled flag. The default 0 allows any coverage, because a ratio is never less than 0.

gatecheck list prints these numbers as percents in the table footer. The config still wants the ratio.

A tighter file

version: "1"
metadata:
  tags:
    - ci
grype:
  severityLimit:
    critical:
      enabled: true
      limit: 0
    high:
      enabled: true
      limit: 5
  epssLimit:
    enabled: true
    score: 0.5
  kevLimitEnabled: true
semgrep:
  severityLimit:
    error:
      enabled: true
      limit: 0
    warning:
      enabled: true
      limit: 10
  impactRiskAcceptance:
    enabled: true
    high: false
    medium: true
    low: true
gitleaks:
  limitEnabled: true
coverage:
  lineThreshold: 0.8
  functionThreshold: 0.75
  branchThreshold: 0.7

Fields left out of this file keep the defaults from config init.

Library Usage

The CLI is a thin wrapper around github.com/gatecheckdev/gatecheck/pkg/gatecheck.

import "github.com/gatecheckdev/gatecheck/pkg/gatecheck"
  • NewDefaultConfig returns the same defaults as gatecheck config init: rules disabled, coverage thresholds 0.
  • NewConfigDecoder reads .yaml, .yml, .json, or .toml. The extension selects the format. When the file has keys gatecheck does not read, Decode still fills the config and returns an error wrapping ErrUnknownConfigKeys. Check it with errors.Is and treat it as a warning. DecodeConfig does the same for bytes you already have.
  • EncodeConfigTo and NewConfigEncoder write a config as json, yaml, yml, or toml, with or without the dot. JSON and YAML are indented by two spaces. ConfigFormat checks a format name.
  • Validate takes the config, a reader, and the filename. The bytes select the report type. The filename is the fallback, with the same words as the CLI.
  • List writes a table. WithDisplayFormat takes table, markdown, or json. A Grype, CycloneDX, SARIF, Semgrep, Gitleaks, Trivy, or osv-scanner report with no findings writes one sentence instead, such as No gitleaks findings, No trivy vulnerabilities, or No osv-scanner vulnerabilities. WithDisplayFormat("markdown") matches --markdown and writes that same sentence when the report is empty. WithEPSS matches --epss and takes an open CSV file or a URL.
  • CreateBundle, AppendToBundle, and RemoveFromBundle are bundle create, bundle add, and bundle remove.
  • DownloadEPSS and DownloadKEV write the API payloads. WithEPSSURL, WithKEVURL, WithEPSSFile, and WithKEVFile override the defaults. WithVEXFiles adds VEX documents to Validate.
  • Errors: ErrValidationFailure is a threshold failure. ErrExternalData means EPSS or KEV data could not be loaded. ErrBundleLabelNotFound comes from RemoveFromBundle. The CLI maps these to exit codes 1, 3, and 2 with cmd.ExitCode.

Report types are described in Supported Reports. Config fields are described in Configuration.