vulnerability

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: Apache-2.0 Imports: 9 Imported by: 9

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 *v1.Cvss) *Cvss

type Metadata

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

func NewMetadata

func NewMetadata(m *v1.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(cpe.CPE) ([]*Vulnerability, error)
}

type ProviderByDistro

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

type ProviderByLanguage

type ProviderByLanguage interface {
	GetByLanguage(pkg.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 v1.VulnerabilityStoreReader) *StoreAdapter

func (*StoreAdapter) GetByCPE

func (pr *StoreAdapter) GetByCPE(requestCPE cpe.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 pkg.Language, p *pkg.Package) ([]*Vulnerability, error)

type Vulnerability

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

func NewVulnerability

func NewVulnerability(vuln v1.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