cnnvd

package
v0.5.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 3, 2021 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

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) Configure

func (f *Factory) Configure(ctx context.Context, cf driver.ConfigUnmarshaler, c *http.Client) error

Configure implements driver.Configurable.

func (*Factory) UpdaterSet

func (f *Factory) UpdaterSet(ctx context.Context) (driver.UpdaterSet, error)

UpdaterSet returns updaters for all releases that have available databases.

type Matcher

type Matcher struct{}

func (*Matcher) Filter

func (*Matcher) Filter(record *claircore.IndexRecord) bool

func (*Matcher) Name

func (*Matcher) Name() string

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) Configure

func (u *Updater) Configure(ctx context.Context, f driver.ConfigUnmarshaler, c *http.Client) error

Configure implements driver.Configurable.

func (*Updater) Fetch

func (u *Updater) Fetch(ctx context.Context, fingerprint driver.Fingerprint) (io.ReadCloser, driver.Fingerprint, error)

func (*Updater) Name

func (u *Updater) Name() string

func (*Updater) Parse

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".

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL