library

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: Apache-2.0 Imports: 20 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect added in v0.17.0

func Detect(libType string, pkgs []ftypes.LibraryInfo) ([]types.DetectedVulnerability, error)

Detect scans and returns vulnerabilities of library

Types

type Advisory added in v0.11.0

type Advisory struct {
	// contains filtered or unexported fields
}

Advisory represents security advisories for each programming language

func NewAdvisory added in v0.11.0

func NewAdvisory(ecosystem string, comparer comparer.Comparer) *Advisory

NewAdvisory is the factory method of Advisory

func (*Advisory) DetectVulnerabilities added in v0.11.0

func (s *Advisory) DetectVulnerabilities(pkgName, pkgVer string) ([]types.DetectedVulnerability, error)

DetectVulnerabilities scans buckets with the prefix according to the ecosystem in "Advisory". If "ecosystem" is pip, it looks for buckets with "pip::" and gets security advisories from those buckets. It allows us to add a new data source with the ecosystem prefix (e.g. pip::new-data-source) and detect vulnerabilities without specifying a specific bucket name.

type Driver

type Driver struct {
	// contains filtered or unexported fields
}

Driver implements the advisory

func Aggregate added in v0.17.0

func Aggregate(ecosystem string, advisories ...advisory) Driver

Aggregate aggregates drivers

func NewDriver added in v0.9.0

func NewDriver(libType string) (Driver, error)

NewDriver returns a driver according to the library type

func (*Driver) Detect

func (d *Driver) Detect(pkgName string, pkgVer string) ([]types.DetectedVulnerability, error)

Detect scans and returns vulnerabilities

func (*Driver) Type

func (d *Driver) Type() string

Type returns the driver ecosystem

type MockOperation added in v0.5.0

type MockOperation struct {
	mock.Mock
}

MockOperation is an autogenerated mock type for the Operation type

func (*MockOperation) ApplyDetectExpectation added in v0.5.0

func (_m *MockOperation) ApplyDetectExpectation(e OperationDetectExpectation)

func (*MockOperation) ApplyDetectExpectations added in v0.5.0

func (_m *MockOperation) ApplyDetectExpectations(expectations []OperationDetectExpectation)

func (*MockOperation) Detect added in v0.5.0

func (_m *MockOperation) Detect(imageName string, filePath string, created time.Time, pkgs []types.LibraryInfo) ([]pkgtypes.DetectedVulnerability, error)

Detect provides a mock function with given fields: imageName, filePath, created, pkgs

type OperationDetectArgs added in v0.5.0

type OperationDetectArgs struct {
	ImageName         string
	ImageNameAnything bool
	FilePath          string
	FilePathAnything  bool
	Created           time.Time
	CreatedAnything   bool
	Pkgs              []types.LibraryInfo
	PkgsAnything      bool
}

type OperationDetectExpectation added in v0.5.0

type OperationDetectExpectation struct {
	Args    OperationDetectArgs
	Returns OperationDetectReturns
}

type OperationDetectReturns added in v0.5.0

type OperationDetectReturns struct {
	Vulns []pkgtypes.DetectedVulnerability
	Err   error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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