Grype Configuration Reference
Categories:
Note
This documentation was generated with Grype version0.104.0.Grype searches for configuration files in the following locations, in order:
./.grype.yaml- current working directory./.grype/config.yaml- app subdirectory in current working directory~/.grype.yaml- home directory$XDG_CONFIG_HOME/grype/config.yaml- XDG config directory
The configuration file can use either .yaml or .yml extensions. The first configuration file found will be used.
For general information about how config and environment variables are handled, see the Configuration Reference section.
log:
# suppress all logging output (env: GRYPE_LOG_QUIET)
quiet: false
# explicitly set the logging level (available: [error warn info debug trace]) (env: GRYPE_LOG_LEVEL)
level: "warn"
# file path to write logs to (env: GRYPE_LOG_FILE)
file: ""
dev:
# capture resource profiling data (available: [cpu, mem]) (env: GRYPE_DEV_PROFILE)
profile: ""
db:
# (env: GRYPE_DEV_DB_DEBUG)
debug: false
# the output format of the vulnerability report (options: table, template, json, cyclonedx)
# when using template as the output type, you must also provide a value for 'output-template-file' (env: GRYPE_OUTPUT)
output: []
# if using template output, you must provide a path to a Go template file
# see https://github.com/anchore/grype#using-templates for more information on template output
# the default path to the template file is the current working directory
# output-template-file: .grype/html.tmpl
#
# write output report to a file (default is to write to stdout) (env: GRYPE_FILE)
file: ""
# pretty-print output (env: GRYPE_PRETTY)
pretty: false
# distro to match against in the format: <distro>[-:@]<version> (env: GRYPE_DISTRO)
distro: ""
# generate CPEs for packages with no CPE data (env: GRYPE_ADD_CPES_IF_NONE)
add-cpes-if-none: false
# specify the path to a Go template file (requires 'template' output to be selected) (env: GRYPE_OUTPUT_TEMPLATE_FILE)
output-template-file: ""
# enable/disable checking for application updates on startup (env: GRYPE_CHECK_FOR_APP_UPDATE)
check-for-app-update: true
# ignore matches for vulnerabilities that are not fixed (env: GRYPE_ONLY_FIXED)
only-fixed: false
# ignore matches for vulnerabilities that are fixed (env: GRYPE_ONLY_NOTFIXED)
only-notfixed: false
# ignore matches for vulnerabilities with specified comma separated fix states, options=[fixed not-fixed unknown wont-fix] (env: GRYPE_IGNORE_WONTFIX)
ignore-wontfix: ""
# an optional platform specifier for container image sources (e.g. 'linux/arm64', 'linux/arm64/v8', 'arm64', 'linux') (env: GRYPE_PLATFORM)
platform: ""
search:
# selection of layers to analyze, options=[squashed all-layers deep-squashed] (env: GRYPE_SEARCH_SCOPE)
scope: "squashed"
# search within archives that do not contain a file index to search against (tar, tar.gz, tar.bz2, etc)
# note: enabling this may result in a performance impact since all discovered compressed tars will be decompressed
# note: for now this only applies to the java package cataloger (env: GRYPE_SEARCH_UNINDEXED_ARCHIVES)
unindexed-archives: false
# search within archives that do contain a file index to search against (zip)
# note: for now this only applies to the java package cataloger (env: GRYPE_SEARCH_INDEXED_ARCHIVES)
indexed-archives: true
# A list of vulnerability ignore rules, one or more property may be specified and all matching vulnerabilities will be ignored.
# This is the full set of supported rule fields:
# - vulnerability: CVE-2008-4318
# fix-state: unknown
# package:
# name: libcurl
# version: 1.5.1
# type: npm
# location: "/usr/local/lib/node_modules/**"
#
# VEX fields apply when Grype reads vex data:
# - vex-status: not_affected
# vex-justification: vulnerable_code_not_present
ignore: []
# a list of globs to exclude from scanning, for example:
# - '/etc/**'
# - './out/**/*.json'
# same as --exclude (env: GRYPE_EXCLUDE)
exclude: []
external-sources:
# enable Grype searching network source for additional information (env: GRYPE_EXTERNAL_SOURCES_ENABLE)
enable: false
maven:
# search for Maven artifacts by SHA1 (env: GRYPE_EXTERNAL_SOURCES_MAVEN_SEARCH_MAVEN_UPSTREAM)
search-maven-upstream: true
# base URL of the Maven repository to search (env: GRYPE_EXTERNAL_SOURCES_MAVEN_BASE_URL)
base-url: "https://search.maven.org/solrsearch/select"
# (env: GRYPE_EXTERNAL_SOURCES_MAVEN_RATE_LIMIT)
rate-limit: 300ms
match:
java:
# use CPE matching to find vulnerabilities (env: GRYPE_MATCH_JAVA_USING_CPES)
using-cpes: false
jvm:
# (env: GRYPE_MATCH_JVM_USING_CPES)
using-cpes: true
dotnet:
# use CPE matching to find vulnerabilities (env: GRYPE_MATCH_DOTNET_USING_CPES)
using-cpes: false
golang:
# use CPE matching to find vulnerabilities (env: GRYPE_MATCH_GOLANG_USING_CPES)
using-cpes: false
# use CPE matching to find vulnerabilities for the Go standard library (env: GRYPE_MATCH_GOLANG_ALWAYS_USE_CPE_FOR_STDLIB)
always-use-cpe-for-stdlib: true
# allow comparison between main module pseudo-versions (e.g. v0.0.0-20240413-2b432cf643...) (env: GRYPE_MATCH_GOLANG_ALLOW_MAIN_MODULE_PSEUDO_VERSION_COMPARISON)
allow-main-module-pseudo-version-comparison: false
javascript:
# use CPE matching to find vulnerabilities (env: GRYPE_MATCH_JAVASCRIPT_USING_CPES)
using-cpes: false
python:
# use CPE matching to find vulnerabilities (env: GRYPE_MATCH_PYTHON_USING_CPES)
using-cpes: false
ruby:
# use CPE matching to find vulnerabilities (env: GRYPE_MATCH_RUBY_USING_CPES)
using-cpes: false
rust:
# use CPE matching to find vulnerabilities (env: GRYPE_MATCH_RUST_USING_CPES)
using-cpes: false
stock:
# use CPE matching to find vulnerabilities (env: GRYPE_MATCH_STOCK_USING_CPES)
using-cpes: true
# upon scanning, if a severity is found at or above the given severity then the return code will be 1
# default is unset which will skip this validation (options: negligible, low, medium, high, critical) (env: GRYPE_FAIL_ON_SEVERITY)
fail-on-severity: ""
registry:
# skip TLS verification when communicating with the registry (env: GRYPE_REGISTRY_INSECURE_SKIP_TLS_VERIFY)
insecure-skip-tls-verify: false
# use http instead of https when connecting to the registry (env: GRYPE_REGISTRY_INSECURE_USE_HTTP)
insecure-use-http: false
# Authentication credentials for specific registries. Each entry describes authentication for a specific authority:
# - authority: the registry authority URL the URL to the registry (e.g. "docker.io", "localhost:5000", etc.) (env: SYFT_REGISTRY_AUTH_AUTHORITY)
# username: a username if using basic credentials (env: SYFT_REGISTRY_AUTH_USERNAME)
# password: a corresponding password (env: SYFT_REGISTRY_AUTH_PASSWORD)
# token: a token if using token-based authentication, mutually exclusive with username/password (env: SYFT_REGISTRY_AUTH_TOKEN)
# tls-cert: filepath to the client certificate used for TLS authentication to the registry (env: SYFT_REGISTRY_AUTH_TLS_CERT)
# tls-key: filepath to the client key used for TLS authentication to the registry (env: SYFT_REGISTRY_AUTH_TLS_KEY)
auth: []
# filepath to a CA certificate (or directory containing *.crt, *.cert, *.pem) used to generate the client certificate (env: GRYPE_REGISTRY_CA_CERT)
ca-cert: ""
# show suppressed/ignored vulnerabilities in the output (only supported with table output format) (env: GRYPE_SHOW_SUPPRESSED)
show-suppressed: false
# orient results by CVE instead of the original vulnerability ID when possible (env: GRYPE_BY_CVE)
by-cve: false
# sort the match results with the given strategy, options=[package severity epss risk kev vulnerability] (env: GRYPE_SORT_BY)
sort-by: "risk"
# same as --name; set the name of the target being analyzed (env: GRYPE_NAME)
name: ""
# allows users to specify which image source should be used to generate the sbom
# valid values are: registry, docker, podman (env: GRYPE_DEFAULT_IMAGE_PULL_SOURCE)
default-image-pull-source: ""
# specify the source behavior to use (e.g. docker, registry, podman, oci-dir, ...) (env: GRYPE_FROM)
from: []
# a list of VEX documents to consider when producing scanning results (env: GRYPE_VEX_DOCUMENTS)
vex-documents: []
# VEX statuses to consider as ignored rules (env: GRYPE_VEX_ADD)
vex-add: []
# match kernel-header packages with upstream kernel as kernel vulnerabilities (env: GRYPE_MATCH_UPSTREAM_KERNEL_HEADERS)
match-upstream-kernel-headers: false
fix-channel:
redhat-eus:
# whether fixes from this channel should be considered, options are "never", "always", or "auto" (conditionally applied based on SBOM data) (env: GRYPE_FIX_CHANNEL_REDHAT_EUS_APPLY)
apply: "auto"
# (env: GRYPE_FIX_CHANNEL_REDHAT_EUS_VERSIONS)
versions: ">= 8.0"
# (env: GRYPE_TIMESTAMP)
timestamp: true
db:
# location to write the vulnerability database cache (env: GRYPE_DB_CACHE_DIR)
cache-dir: "~/.cache/grype/db"
# URL of the vulnerability database (env: GRYPE_DB_UPDATE_URL)
update-url: "https://grype.anchore.io/databases"
# certificate to trust download the database and listing file (env: GRYPE_DB_CA_CERT)
ca-cert: ""
# check for database updates on execution (env: GRYPE_DB_AUTO_UPDATE)
auto-update: true
# validate the database matches the known hash each execution (env: GRYPE_DB_VALIDATE_BY_HASH_ON_START)
validate-by-hash-on-start: true
# ensure db build is no older than the max-allowed-built-age (env: GRYPE_DB_VALIDATE_AGE)
validate-age: true
# Max allowed age for vulnerability database,
# age being the time since it was built
# Default max age is 120h (or five days) (env: GRYPE_DB_MAX_ALLOWED_BUILT_AGE)
max-allowed-built-age: 120h0m0s
# fail the scan if unable to check for database updates (env: GRYPE_DB_REQUIRE_UPDATE_CHECK)
require-update-check: false
# Timeout for downloading GRYPE_DB_UPDATE_URL to see if the database needs to be downloaded
# This file is ~156KiB as of 2024-04-17 so the download should be quick; adjust as needed (env: GRYPE_DB_UPDATE_AVAILABLE_TIMEOUT)
update-available-timeout: 30s
# Timeout for downloading actual vulnerability DB
# The DB is ~156MB as of 2024-04-17 so slower connections may exceed the default timeout; adjust as needed (env: GRYPE_DB_UPDATE_DOWNLOAD_TIMEOUT)
update-download-timeout: 5m0s
# Maximum frequency to check for vulnerability database updates (env: GRYPE_DB_MAX_UPDATE_CHECK_FREQUENCY)
max-update-check-frequency: 2h0m0s
exp: