grype

package
v0.116.0 Latest Latest
Warning

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

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 28 Imported by: 22

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindVulnerabilities

func FindVulnerabilities(store vulnerability.Provider, userImageStr string, scopeOpt source.Scope, registryOptions *image.RegistryOptions) (match.Matches, pkg.Context, []pkg.Package, error)

TODO: deprecated, will remove before v1.0.0

func FindVulnerabilitiesForPackage

func FindVulnerabilitiesForPackage(store vulnerability.Provider, matchers []match.Matcher, packages []pkg.Package) match.Matches

TODO: deprecated, will remove before v1.0.0

func LoadVulnerabilityDB added in v0.23.0

func LoadVulnerabilityDB(distCfg v6dist.Config, installCfg v6inst.Config, update bool) (vulnerability.Provider, *vulnerability.ProviderStatus, error)

func SetBus

func SetBus(b *partybus.Bus)

func SetLogger

func SetLogger(l logger.Logger)

Types

type AlertsConfig added in v0.108.0

type AlertsConfig struct {
	// EnableEOLDistroWarnings enables tracking packages from end-of-life distros
	EnableEOLDistroWarnings bool
}

AlertsConfig controls which alerts are tracked and reported during vulnerability matching.

type VulnerabilityMatcher added in v0.54.0

type VulnerabilityMatcher struct {
	VulnerabilityProvider vulnerability.Provider
	ExclusionProvider     match.ExclusionProvider
	Matchers              []match.Matcher
	IgnoreRules           []match.IgnoreRule
	FailSeverity          *vulnerability.Severity
	NormalizeByCVE        bool
	VexProcessor          *vex.Processor
	Alerts                AlertsConfig
	// contains filtered or unexported fields
}

func (*VulnerabilityMatcher) DistroDetectionFailed added in v0.106.0

func (m *VulnerabilityMatcher) DistroDetectionFailed() bool

DistroDetectionFailed returns true if distro detection failed during scanning (linux release info was present but distro type could not be determined).

func (*VulnerabilityMatcher) EOLDistroPackages added in v0.106.0

func (m *VulnerabilityMatcher) EOLDistroPackages() []pkg.Package

EOLDistroPackages returns packages from distros that have reached end-of-life.

func (*VulnerabilityMatcher) FailAtOrAboveSeverity added in v0.54.0

func (m *VulnerabilityMatcher) FailAtOrAboveSeverity(severity *vulnerability.Severity) *VulnerabilityMatcher

func (*VulnerabilityMatcher) FindMatches added in v0.54.0

func (m *VulnerabilityMatcher) FindMatches(
	pkgs []pkg.Package,
	pkgContext pkg.Context,
) (remainingMatches *match.Matches, ignoredMatches []match.IgnoredMatch, err error)

FindMatches finds vulnerabilities for the given packages and package context. FindMatches does not support context cancellation; for that, use FindMatchesContext.

func (*VulnerabilityMatcher) FindMatchesContext added in v0.107.1

func (m *VulnerabilityMatcher) FindMatchesContext(
	ctx context.Context,
	pkgs []pkg.Package,
	pkgContext pkg.Context,
) (remainingMatches *match.Matches, ignoredMatches []match.IgnoredMatch, err error)

FindMatchesContext finds vulnerabilities for the given packages and package context, and supports context cancellation.

func (*VulnerabilityMatcher) WithIgnoreRules added in v0.54.0

func (m *VulnerabilityMatcher) WithIgnoreRules(ignoreRules []match.IgnoreRule) *VulnerabilityMatcher

func (*VulnerabilityMatcher) WithMatchers added in v0.54.0

func (m *VulnerabilityMatcher) WithMatchers(matchers []match.Matcher) *VulnerabilityMatcher

Directories

Path Synopsis
db
internal/provider/unmarshal/osvmodel
Package osvmodel is grype's representation of an OSV record.
Package osvmodel is grype's representation of an OSV record.
internal/provider/unmarshal/osvmodel/generate command
This program regenerates the osvmodel package from a pinned JSON Schema.
This program regenerates the osvmodel package from a pinned JSON Schema.
v5
v6
v6/build/transformers/os/generate command
Generates rhel_minor_span_generated.go from Red Hat's official product life-cycle API (https://access.redhat.com/product-life-cycles).
Generates rhel_minor_span_generated.go from Red Hat's official product life-cycle API (https://access.redhat.com/product-life-cycles).
v6/schema command
rootio
Package rootio detects whether a scanned package was published by Root IO (the rootio backport program), independently of any vulnerability-side qualifier logic.
Package rootio detects whether a scanned package was published by Root IO (the rootio backport program), independently of any vulnerability-side qualifier logic.
apk
hex
rpm
pkg
vex

Jump to

Keyboard shortcuts

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