Documentation
¶
Overview ¶
Package vulnreport implements a transformer that normalizes scanner reports (Trivy, Grype, OSV-Scanner) into the OSV results format, and optionally projects them onto the in-toto vulns/v0.2 predicate.
The conversion logic lives in the carabiner-dev/osv library; this transformer is a thin adapter that routes each input predicate to the right converter and wraps the result as a predicate.
Index ¶
Constants ¶
const ( OutputOSV = "osv" OutputVulnReport = "vulnreport" )
Output formats the vulnreport transformer can emit.
const GrypePredicateType = attestation.PredicateType("https://github.com/anchore/grype")
GrypePredicateType identifies a Grype JSON report. Grype does not define an official in-toto predicate type, so we adopt the tool's repository URL.
Variables ¶
var ClassName = "vulnreport"
var PredicateTypes = []attestation.PredicateType{ ctrivy.PredicateType, cosv.PredicateType, legacyOSVPredicateType, GrypePredicateType, }
PredicateTypes are the scanner report predicate types this transformer accepts as input.
Functions ¶
This section is empty.
Types ¶
type Config ¶ added in v1.1.5
type Config struct {
// Output selects the predicate format emitted by Mutate.
// Defaults to "osv". "vulnreport" emits an in-toto vulns/v0.2 predicate.
Output string `json:"output"`
}
Config is the user-facing configuration for the vulnreport transformer.
type Transformer ¶
type Transformer struct {
// contains filtered or unexported fields
}
Transformer implements the normalizer from scanner reports to OSV / vulns.
func New ¶ added in v1.1.5
func New() *Transformer
func (*Transformer) Init ¶ added in v1.1.5
func (t *Transformer) Init(raw *structpb.Struct) error
Init parses the policy-supplied config and applies defaults.
func (*Transformer) Mutate ¶
func (t *Transformer) Mutate( _ attestation.Subject, preds []attestation.Predicate, ) (attestation.Subject, []attestation.Predicate, error)