gobin

package
v1.5.27 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 19 Imported by: 3

Documentation

Overview

Package gobin implements a package scanner that pulls go runtime and dependency information out of a compiled executable.

Main module versioning

The go toolchain currently only fills in version information for modules obtained as a module. Most go executables are built from source checkouts, meaning they are not in module form. See issue 50603 for details on why and what's being explored to provide this information. Accordingly, claircore cannot report advisories for main modules.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidSemVer = errors.New("invalid semantic version")
View Source
var (
	Repository = claircore.Repository{
		Name: "go",
		URI:  "https://pkg.go.dev/",
	}
)

Functions

func NewEcosystem

func NewEcosystem(ctx context.Context) *indexer.Ecosystem

NewEcosystem provides the ecosystem for handling go binaries.

func ParseVersion added in v1.5.22

func ParseVersion(ver string) (c claircore.Version, err error)

ParseVersion will return a claircore.Version of type semver given a valid semantic version. If the string is not a valid semver it will return an ErrInvalidSemVer.

Types

type Detector

type Detector struct{}

Detector detects go binaries and reports the packages used to build them.

func (Detector) DefaultRepository added in v1.5.6

func (Detector) DefaultRepository(ctx context.Context) *claircore.Repository

DefaultRepository implements indexer.DefaultRepoScanner.

func (Detector) Kind

func (Detector) Kind() string

Kind implements indexer.PackageScanner.

func (Detector) Name

func (Detector) Name() string

Name implements indexer.PackageScanner.

func (Detector) Scan

Scan implements indexer.PackageScanner.

func (Detector) Version

func (Detector) Version() string

Version implements indexer.PackageScanner.

type Matcher added in v1.5.3

type Matcher struct{}

Matcher matches discovered go packages against advisories provided via OSV.

func (*Matcher) Filter added in v1.5.3

func (matcher *Matcher) Filter(record *claircore.IndexRecord) bool

Filter implements driver.Matcher.

func (*Matcher) Name added in v1.5.3

func (m *Matcher) Name() string

Name implements driver.Matcher.

func (*Matcher) Query added in v1.5.3

func (matcher *Matcher) Query() []driver.MatchConstraint

Query implements driver.Matcher.

func (*Matcher) VersionAuthoritative added in v1.5.6

func (matcher *Matcher) VersionAuthoritative() bool

func (*Matcher) VersionFilter added in v1.5.6

func (matcher *Matcher) VersionFilter()

func (*Matcher) Vulnerable added in v1.5.3

func (matcher *Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error)

Vulnerable implements driver.Matcher.

Jump to

Keyboard shortcuts

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