vulnerability

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type Cvss

type Cvss struct {
	BaseScore           float64
	ExploitabilityScore float64
	ImpactScore         float64
	Vector              string
}

func NewCvss

func NewCvss(m *db.Cvss) *Cvss

type Metadata

type Metadata struct {
	ID          string
	Severity    string
	Links       []string
	Description string
	CvssV2      *Cvss
	CvssV3      *Cvss
}

func NewMetadata

func NewMetadata(m *db.VulnerabilityMetadata) (*Metadata, error)

type MetadataProvider

type MetadataProvider interface {
	GetMetadata(id, recordSource string) (*Metadata, error)
}

type MetadataStoreAdapter

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

func (*MetadataStoreAdapter) GetMetadata

func (pr *MetadataStoreAdapter) GetMetadata(id, recordSource string) (*Metadata, error)

type Provider

type Provider interface {
	ProviderByDistro
	ProviderByLanguage
	ProviderByCPE
}

type ProviderByCPE

type ProviderByCPE interface {
	GetByCPE(syftPkg.CPE) ([]*Vulnerability, error)
}

type ProviderByDistro

type ProviderByDistro interface {
	GetByDistro(distro.Distro, pkg.Package) ([]*Vulnerability, error)
}

type ProviderByLanguage

type ProviderByLanguage interface {
	GetByLanguage(syftPkg.Language, pkg.Package) ([]*Vulnerability, error)
}

type Set

type Set map[string]struct{}

func NewSet

func NewSet() Set

func (Set) Add

func (s Set) Add(v *Vulnerability)

func (Set) Contains

func (s Set) Contains(v *Vulnerability) bool

func (Set) Remove

func (s Set) Remove(v *Vulnerability)

type Severity

type Severity int
const (
	UnknownSeverity Severity = iota
	NegligibleSeverity
	LowSeverity
	MediumSeverity
	HighSeverity
	CriticalSeverity
)

func ParseSeverity

func ParseSeverity(severity string) Severity

func (Severity) String

func (f Severity) String() string

type StoreAdapter

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

func NewProviderFromStore

func NewProviderFromStore(store db.VulnerabilityStoreReader) *StoreAdapter

func (*StoreAdapter) GetByCPE

func (pr *StoreAdapter) GetByCPE(requestCPE syftPkg.CPE) ([]*Vulnerability, error)

func (*StoreAdapter) GetByDistro

func (pr *StoreAdapter) GetByDistro(d distro.Distro, p pkg.Package) ([]*Vulnerability, error)

func (*StoreAdapter) GetByLanguage

func (pr *StoreAdapter) GetByLanguage(l syftPkg.Language, p pkg.Package) ([]*Vulnerability, error)

type Vulnerability

type Vulnerability struct {
	Constraint     version.Constraint
	CPEs           []pkg.CPE
	ID             string
	RecordSource   string
	FixedInVersion string
}

func NewVulnerability

func NewVulnerability(vuln db.Vulnerability) (*Vulnerability, error)

func (Vulnerability) String

func (v Vulnerability) String() string

Jump to

Keyboard shortcuts

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