grype

package
v0.12.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package grype implements a Matcher that uses the Grype vulnerability library (builtin) or the grype CLI binary (external), selected via build tags.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Matcher

type Matcher struct {
	// DBDir is the directory that contains the Grype vulnerability database.
	// Defaults to the OS cache directory / grype / db.
	DBDir string
	// Logger receives diagnostic messages. Maybe nil (no-op).
	Logger *zap.Logger
	// DistConfigOverride overrides the default distribution config (e.g., LatestURL).
	DistConfigOverride any
}

Matcher uses the Grype library or CLI to match packages against a vulnerability database.

func (Matcher) Applicable

func (a Matcher) Applicable(_ context.Context, _ sdk.MatchRequest) (bool, error)

func (Matcher) Descriptor

func (a Matcher) Descriptor() sdk.MatcherDescriptor

Descriptor returns the registration metadata for the Grype matcher.

func (Matcher) Match

Match attaches Grype vulnerability matches to packages in the graph.

func (Matcher) Ready

func (a Matcher) Ready() bool

Ready reports whether the bundled Grype matcher can run. The database may be downloaded during Match on first use, so a missing cache does not make the matcher unavailable.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL