ospkg

package
v0.25.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2022 License: Apache-2.0 Imports: 19 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrUnsupportedOS defines error for unsupported OS
	ErrUnsupportedOS = xerrors.New("unsupported os")

	// SuperSet binds dependencies for OS scan
	SuperSet = wire.NewSet(
		wire.Struct(new(Detector)),
		wire.Bind(new(Operation), new(Detector)),
	)
)

Functions

func RegisterDriver added in v0.23.0

func RegisterDriver(name string, driver Driver)

RegisterDriver is defined for extensibility and not supposed to be used in Trivy.

Types

type DetectExpectation

type DetectExpectation struct {
	Args       DetectInput
	ReturnArgs DetectOutput
}

type DetectInput

type DetectInput struct {
	ImageName string
	OSFamily  string
	OSName    string
	Created   time.Time
	Pkgs      []ftypes.Package
}

type DetectOutput

type DetectOutput struct {
	Vulns []types.DetectedVulnerability
	Eosl  bool
	Err   error
}

type Detector

type Detector struct{}

Detector implements Operation

func (Detector) Detect

func (d Detector) Detect(_, osFamily, osName string, _ time.Time, pkgs []ftypes.Package) ([]types.DetectedVulnerability, bool, error)

Detect detects the vulnerabilities

type Driver

type Driver interface {
	Detect(string, []ftypes.Package) ([]types.DetectedVulnerability, error)
	IsSupportedVersion(string, string) bool
}

Driver defines operations for OS package scan

type MockDetector

type MockDetector struct {
	mock.Mock
}

func NewMockDetector

func NewMockDetector(detectExpectations []DetectExpectation) *MockDetector

func (*MockDetector) Detect

type Operation

type Operation interface {
	Detect(string, string, string, time.Time, []ftypes.Package) ([]types.DetectedVulnerability, bool, error)
}

Operation defines operation of OSpkg scan

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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