Documentation ¶
Index ¶
- Constants
- func NormalizeSeverity(severity string) claircore.Severity
- type Factory
- type FactoryConfig
- type Matcher
- func (m *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 Package
- type VulnReport
- type VulnRequest
- 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 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"` Ecosystems []string `json:"ecosystems" yaml:"ecosystems"` }
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 (m *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 WithBatchSize ¶ added in v0.4.1
WithBatchSize sets the number of records to be batched per request.
If not passed to NewMatcher, a defaultBatchSize will be used.
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 VulnReport struct { Name string `json:"package"` Version string `json:"version"` RecommendedVersion string `json:"recommended_versions"` Message string `json:"message"` Vulnerabilities []Vulnerability `json:"vulnerability"` }
type VulnRequest ¶ added in v0.4.1
type Vulnerability ¶
type Vulnerability struct { ID string `json:"id"` 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.