vulnerability

package
v0.77.4 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: Apache-2.0 Imports: 9 Imported by: 9

Documentation

Index

Constants

View Source
const SchemaVersion = grypeDB.SchemaVersion

Variables

This section is empty.

Functions

func AllFixStates added in v0.72.0

func AllFixStates() []grypeDb.FixState

Types

type Advisory added in v0.13.0

type Advisory struct {
	ID   string
	Link string
}

type Cvss

type Cvss struct {
	Source         string
	Type           string
	Version        string
	Vector         string
	Metrics        CvssMetrics
	VendorMetadata interface{}
}

func NewCvss

func NewCvss(m []grypeDB.Cvss) []Cvss

type CvssMetrics added in v0.13.0

type CvssMetrics struct {
	BaseScore           float64
	ExploitabilityScore *float64
	ImpactScore         *float64
}

func NewCvssMetrics added in v0.13.0

func NewCvssMetrics(baseScore, exploitabilityScore, impactScore float64) CvssMetrics

type Fix added in v0.13.0

type Fix struct {
	Versions []string
	State    grypeDb.FixState
}

type Metadata

type Metadata struct {
	ID          string
	DataSource  string
	Namespace   string
	Severity    string
	URLs        []string
	Description string
	Cvss        []Cvss
}

func NewMetadata

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

type MetadataProvider

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

type Provider

type Provider interface {
	Get(id, namespace string) ([]Vulnerability, error)
	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(syftPkg.Language, pkg.Package) ([]Vulnerability, error)
}

type Reference added in v0.13.0

type Reference struct {
	ID        string
	Namespace string
}

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 Severities added in v0.59.0

type Severities []Severity

func (Severities) Len added in v0.59.0

func (s Severities) Len() int

func (Severities) Less added in v0.59.0

func (s Severities) Less(i, j int) bool

func (Severities) Swap added in v0.59.0

func (s Severities) Swap(i, j int)

type Severity

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

func AllSeverities

func AllSeverities() []Severity

func ParseSeverity

func ParseSeverity(severity string) Severity

func (Severity) String

func (f Severity) String() string

type Vulnerability

type Vulnerability struct {
	Constraint             version.Constraint
	PackageQualifiers      []qualifier.Qualifier
	CPEs                   []cpe.CPE
	ID                     string
	Namespace              string
	Fix                    Fix
	Advisories             []Advisory
	RelatedVulnerabilities []Reference
}

func NewVulnerability

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