Documentation ¶
Index ¶
- Constants
- Variables
- type DistributionScanner
- type Factory
- type Matcher
- type Release
- 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 ¶
const ( OSReleaseID = "ubuntu" OSReleaseName = "Ubuntu" )
const ( OVALTemplateBzip = "https://people.canonical.com/~ubuntu-security/oval/com.ubuntu.%s.cve.oval.xml.bz2" OVALTemplate = "https://people.canonical.com/~ubuntu-security/oval/com.ubuntu.%s.cve.oval.xml" )
Variables ¶
var AllReleases = map[Release]struct{}{ Artful: struct{}{}, Bionic: struct{}{}, Cosmic: struct{}{}, Disco: struct{}{}, Precise: struct{}{}, Trusty: struct{}{}, Xenial: struct{}{}, Eoan: struct{}{}, Focal: struct{}{}, Impish: struct{}{}, }
var ReleaseToVersionID = map[Release]string{ Artful: "17.10", Bionic: "18.04", Cosmic: "18.10", Disco: "19.04", Precise: "12.04", Trusty: "14.04", Xenial: "16.04", Eoan: "19.10", Focal: "20.04", Impish: "21.10", }
Releases is a list of supported ubuntu releases.
Functions ¶
This section is empty.
Types ¶
type DistributionScanner ¶ added in v0.0.14
type DistributionScanner struct{}
DistributionScanner attempts to discover if a layer displays characteristics of a Ubuntu distribution
func (*DistributionScanner) Kind ¶ added in v0.0.14
func (*DistributionScanner) Kind() string
Kind implements scanner.VersionedScanner.
func (*DistributionScanner) Name ¶ added in v0.0.14
func (*DistributionScanner) Name() string
Name implements scanner.VersionedScanner.
func (*DistributionScanner) Scan ¶ added in v0.0.14
func (ds *DistributionScanner) Scan(ctx context.Context, l *claircore.Layer) ([]*claircore.Distribution, error)
Scan will inspect the layer for an os-release or lsb-release file and perform a regex match for keywords indicating the associated Ubuntu release
If neither file is found a (nil,nil) is returned. If the files are found but all regexp fail to match an empty slice is returned.
func (*DistributionScanner) Version ¶ added in v0.0.14
func (*DistributionScanner) Version() string
Version implements scanner.VersionedScanner.
type Factory ¶ added in v0.1.0
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 ¶ added in v0.1.0
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 (*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 ¶ added in v0.4.2
type UpdaterConfig struct {
URL string `json:"url" yaml:"url"`
}
UpdaterConfig is the configuration for the updater.
By convention, this is in a map called "ubuntu-${RELEASE}-updater", e.g. "ubuntu-focal-updater".