Documentation
¶
Overview ¶
Package vex reads OpenVEX v0.2.0 documents and suppresses advisories by vulns.ignore entries and VEX statements.
Index ¶
Constants ¶
const ( StatusNotAffected = "not_affected" StatusAffected = "affected" StatusFixed = "fixed" StatusUnderInvestigation = "under_investigation" )
OpenVEX statuses.
const Context = "https://openvex.dev/ns/v0.2.0"
Context is the @context of an OpenVEX v0.2.0 document.
const DateLayout = time.DateOnly
DateLayout is how a vulns.ignore entry writes its until date.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Component ¶
type Component struct {
ID string `json:"@id,omitempty"`
Identifiers map[string]string `json:"identifiers,omitempty"`
Subcomponents []Component `json:"subcomponents,omitempty"`
}
Component is a product or a subcomponent, named by an IRI such as a purl, or by identifiers.
type Document ¶
type Document struct {
Context string `json:"@context"`
ID string `json:"@id"`
Author string `json:"author"`
Timestamp time.Time `json:"timestamp"`
Version int `json:"version"`
Tooling string `json:"tooling,omitempty"`
Statements []Statement `json:"statements"`
}
Document is an OpenVEX v0.2.0 document, with the fields relgap reads and writes.
type Ignore ¶
type Ignore struct {
ID string
Reason string
Until string // a date in [DateLayout]; empty never expires
Tools []string // globs on the tool name, * spanning any characters; empty means every tool
}
Ignore is a vulns.ignore entry: an advisory ID or alias, why it is accepted, the last day it applies and the tools it applies to.
type Rules ¶
type Rules struct {
// contains filtered or unexported fields
}
Rules suppresses advisories by vulns.ignore entries and OpenVEX statements. It is safe for concurrent use and counts which entries matched.
func New ¶
New returns the rules of the ignore entries in effect on day today and the statements of files. An entry whose until date is before today has expired: it matches nothing and Rules.Expired lists it.
func (*Rules) Covers ¶
Covers reports whether the rules suppress the advisory named names for s, without counting the match as a use.
func (*Rules) Expired ¶
Expired returns the ignore entries whose until date has passed, in config order.
type Statement ¶
type Statement struct {
Vulnerability Vulnerability `json:"vulnerability"`
Timestamp *time.Time `json:"timestamp,omitempty"`
Products []Component `json:"products,omitempty"`
Status string `json:"status"`
Justification string `json:"justification,omitempty"`
ImpactStatement string `json:"impact_statement,omitempty"`
ActionStatement string `json:"action_statement,omitempty"`
}
Statement says how a vulnerability affects products.