Documentation ¶
Index ¶
- Constants
- Variables
- type Factory
- type Matcher
- type Updater
- func (u *Updater) Configure(ctx context.Context, f driver.ConfigUnmarshaler, c *http.Client) error
- func (u *Updater) Fetch(ctx context.Context, fingerprint driver.Fingerprint) (io.ReadCloser, driver.Fingerprint, error)
- func (u *Updater) Name() string
- func (u *Updater) Parse(ctx context.Context, r io.ReadCloser) ([]*claircore.Vulnerability, error)
- type UpdaterConfig
Constants ¶
View Source
const ( OSReleaseID = "cnnvd" OSReleaseName = "cnnvd" )
View Source
const (
OVALTemplate = "https://raw.githubusercontent.com/Asia-Lee/Vulnerability_classify/master/dataset_source/CNNVD/%s.xml"
)
Variables ¶
View Source
var Releases = []Release{
2002,
2003,
2004,
2005,
2006,
2007,
2008,
2009,
2010,
2011,
2012,
2013,
2014,
2015,
2016,
2017,
}
Releases is a list of supported cnnvd releases.
Functions ¶
This section is empty.
Types ¶
type Factory ¶
type Factory struct { Releases []Release `json:"releases" yaml:"releases"` // contains filtered or unexported fields }
Factory implements driver.UpdaterSetFactory.
A Factory should be constructed directly, and Configure must be called to provide an http.Client.
func (*Factory) UpdaterSet ¶
UpdaterSet returns updaters for all releases that have available databases.
type Matcher ¶
type Matcher struct{}
func (*Matcher) Query ¶
func (*Matcher) Query() []driver.MatchConstraint
func (*Matcher) Vulnerable ¶
func (*Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error)
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
Updater implements the claircore.Updater.Fetcher and claircore.Updater.Parser interfaces making it eligible to be used as an Updater.
func NewUpdater ¶
func NewUpdater(release Release) *Updater
func (*Updater) Fetch ¶
func (u *Updater) Fetch(ctx context.Context, fingerprint driver.Fingerprint) (io.ReadCloser, driver.Fingerprint, error)
func (*Updater) Parse ¶
func (u *Updater) Parse(ctx context.Context, r io.ReadCloser) ([]*claircore.Vulnerability, error)
type UpdaterConfig ¶
type UpdaterConfig struct {
URL string `json:"url" yaml:"url"`
}
UpdaterConfig is the configuration for the updater.
By convention, this is in a map called "cnnvd-${RELEASE}-updater", e.g. "cnnvd-2002-updater".
Click to show internal directories.
Click to hide internal directories.