Documentation
¶
Index ¶
- Constants
- func BaseScoreV3(vector string) float64
- func IsLanguagePackage(p model.Package) bool
- func Overlay(ctx context.Context, c *Client, inventory []model.Package, ...) ([]model.Finding, error)
- func SeverityFromScore(s float64) string
- type Affected
- type AffectedPackage
- type Client
- type Range
- type Reference
- type Severity
- type Vuln
Constants ¶
const (
DefaultBaseURL = "https://api.osv.dev"
)
Variables ¶
This section is empty.
Functions ¶
func BaseScoreV3 ¶
BaseScoreV3 computes the CVSS v3.0/v3.1 base score from a vector string. Returns 0 when the vector is not a complete v3 base vector.
func IsLanguagePackage ¶
func Overlay ¶
func Overlay(ctx context.Context, c *Client, inventory []model.Package, known map[string]bool) ([]model.Finding, error)
Overlay queries OSV for the inventory and returns findings not already identified by grype. known holds every id and alias grype reported.
func SeverityFromScore ¶
Types ¶
type Affected ¶
type Affected struct {
Package AffectedPackage `json:"package"`
Ranges []Range `json:"ranges"`
Versions []string `json:"versions"`
}
type AffectedPackage ¶
type Client ¶
func (*Client) QueryBatch ¶
QueryBatch returns, for each purl (with version), the OSV ids affecting it.
type Vuln ¶
type Vuln struct {
ID string `json:"id"`
Aliases []string `json:"aliases"`
Summary string `json:"summary"`
Details string `json:"details"`
Modified string `json:"modified"`
Published string `json:"published"`
Withdrawn string `json:"withdrawn"`
Severity []Severity `json:"severity"`
Affected []Affected `json:"affected"`
References []Reference `json:"references"`
DatabaseSpecific map[string]any `json:"database_specific"`
}