Documentation
¶
Index ¶
- Constants
- func NormalizeSeverity(severity string) claircore.Severity
- type Analyses
- type Factory
- type FactoryConfig
- type Matcher
- func (*Matcher) Filter(record *claircore.IndexRecord) bool
- func (*Matcher) Name() string
- func (*Matcher) Query() []driver.MatchConstraint
- func (m *Matcher) QueryRemoteMatcher(ctx context.Context, records []*claircore.IndexRecord) (map[string][]*claircore.Vulnerability, error)
- func (*Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, ...) (bool, error)
- type Option
- type VulnReport
- type Vulnerability
Constants ¶
const ( Low = "low" Medium = "medium" High = "high" Critical = "critical" )
Variables ¶
This section is empty.
Functions ¶
func NormalizeSeverity ¶
NormalizeSeverity takes a string[1] and normalizes it to a claircore.Severity. [1] https://github.com/fabric8-analytics/fabric8-analytics-server/blob/master/api_specs/v2/stack_analyses.yaml#L178
Types ¶
type Analyses ¶
type Analyses struct {
Vulnerabilities []Vulnerability `json:"vulnerability"`
}
type Factory ¶ added in v0.3.2
type Factory struct {
// contains filtered or unexported fields
}
Factory contains the configuration to connect with CRDA remote matcher.
type FactoryConfig ¶ added in v0.3.2
type FactoryConfig struct {
URL string `json:"url" yaml:"url"`
}
To decode the config.
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher attempts to correlate discovered python packages with reported vulnerabilities.
func NewMatcher ¶
NewMatcher returns a configured Matcher or reports an error.
func (*Matcher) Filter ¶
func (*Matcher) Filter(record *claircore.IndexRecord) bool
Filter implements driver.Matcher.
func (*Matcher) Query ¶
func (*Matcher) Query() []driver.MatchConstraint
Query implements driver.Matcher.
func (*Matcher) QueryRemoteMatcher ¶
func (m *Matcher) QueryRemoteMatcher(ctx context.Context, records []*claircore.IndexRecord) (map[string][]*claircore.Vulnerability, error)
QueryRemoteMatcher implements driver.RemoteMatcher.
func (*Matcher) Vulnerable ¶
func (*Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error)
Vulnerable implements driver.Matcher.
type Option ¶
Option controls the configuration of a Matcher.
func WithClient ¶
WithClient sets the http.Client that the matcher should use for requests.
If not passed to NewMatcher, http.DefaultClient will be used.
func WithRequestConcurrency ¶
WithRequestConcurrency sets the concurrency limit for the network calls.
If not passed to NewMatcher, a defaultRequestConcurrency will be used.
type VulnReport ¶
type Vulnerability ¶
type Vulnerability struct {
ID string `json:"vendor_cve_ids"`
CVSS string `json:"cvss"`
CVES []string `json:"cve_ids"`
Severity string `json:"severity"`
Title string `json:"title"`
URL string `json:"url"`
FixedIn []string `json:"fixed_in"`
}
Build struct to model CRDA V2 ComponentAnalysis response which delivers Snyk sourced Vulnerability information.