osvscanner

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2025 License: Apache-2.0 Imports: 53 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAPIFailed = errors.New("API query failed")

ErrAPIFailed describes errors related to querying API endpoints. TODO(v2): Actually use this error

View Source
var ErrNoPackagesFound = errors.New("no packages found in scan")

ErrNoPackagesFound for when no packages are found during a scan.

View Source
var ErrVulnerabilitiesFound = errors.New("vulnerabilities found")

ErrVulnerabilitiesFound includes both vulnerabilities being found or license violations being found, however, will not be raised if only uncalled vulnerabilities are found.

Functions

func DoContainerScan

func DoContainerScan(actions ScannerActions) (models.VulnerabilityResults, error)

func DoScan

DoScan performs the osv scanner action, with optional reporter to output information

Types

type ExperimentalScannerActions

type ExperimentalScannerActions struct {
	TransitiveScanningActions

	Extractors []filesystem.Extractor
}

type ExternalAccessors

type ExternalAccessors struct {
	// Matchers
	VulnMatcher      clientinterfaces.VulnerabilityMatcher
	LicenseMatcher   clientinterfaces.LicenseMatcher
	BaseImageMatcher clientinterfaces.BaseImageMatcher

	// Required for pomxmlnet Extractor
	MavenRegistryAPIClient *datasource.MavenRegistryAPIClient
	// Required for vendored Extractor
	OSVDevClient *osvdev.OSVClient

	// DependencyClients is a map of implementations of DependencyClient
	// for each ecosystem, the following is currently implemented:
	// - [osvschema.EcosystemMaven] required for pomxmlnet Extractor
	DependencyClients map[osvschema.Ecosystem]resolve.Client
}

type FileOpenedPrinter added in v2.0.3

type FileOpenedPrinter struct {
	stats.NoopCollector
}

func (FileOpenedPrinter) AfterExtractorRun added in v2.0.3

func (c FileOpenedPrinter) AfterExtractorRun(_ string, extractorstats *stats.AfterExtractorStats)

type ScannerActions

type ScannerActions struct {
	ExperimentalScannerActions

	LockfilePaths      []string
	DirectoryPaths     []string
	GitCommits         []string
	Recursive          bool
	IncludeGitRoot     bool
	NoIgnore           bool
	Image              string
	IsImageArchive     bool
	ConfigOverridePath string
	CallAnalysisStates map[string]bool
	ShowAllPackages    bool
	ShowAllVulns       bool

	// local databases
	CompareOffline    bool
	DownloadDatabases bool
	LocalDBPath       string

	// license scanning
	ScanLicensesSummary   bool
	ScanLicensesAllowlist []string

	// Deprecated: in favor of LockfilePaths
	SBOMPaths []string
}

type TransitiveScanningActions

type TransitiveScanningActions struct {
	Disabled         bool
	NativeDataSource bool
	MavenRegistry    string
}

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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