debian

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Overview

Package debian contains an Indexer, Matcher, and Updater for Debian GNU/Linux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DistributionScanner

type DistributionScanner struct{}

DistributionScanner attempts to discover if a layer displays characteristics of a Debian distribution.

func (*DistributionScanner) Kind

func (*DistributionScanner) Kind() string

Kind implements indexer.VersionedScanner.

func (*DistributionScanner) Name

func (*DistributionScanner) Name() string

Name implements indexer.VersionedScanner.

func (*DistributionScanner) Scan

Scan implements indexer.DistributionScanner.

func (*DistributionScanner) Version

func (*DistributionScanner) Version() string

Version implements indexer.VersionedScanner.

type Factory

type Factory struct {
	// contains filtered or unexported fields
}

Factory creates Updaters for all Debian distributions that exist in the mirror, and have entries in the JSON security tracker.

[Configure] must be called before [UpdaterSet].

func NewFactory

func NewFactory(_ context.Context) (*Factory, error)

NewFactory constructs a Factory.

[Configure] must be called before [UpdaterSet].

func (*Factory) Configure

func (f *Factory) Configure(_ 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 implements driver.UpdaterSetFactory.

type FactoryConfig

type FactoryConfig struct {
	// ArchiveURL is a URL to a Debian archive.
	//
	// Deprecated: Only MirrorURL should be used.
	ArchiveURL string `json:"archive_url" yaml:"archive_url"`
	MirrorURL  string `json:"mirror_url" yaml:"mirror_url"`
	// OVALURL is a URL to a collection of OVAL XML documents.
	//
	// Deprecated: Use JSONURL instead.
	OVALURL string `json:"oval_url" yaml:"oval_url"`
	// JSONURL is a URL to a JSON vulnerability feed.
	JSONURL string `json:"json_url" yaml:"json_url"`
}

FactoryConfig is the configuration honored by the Factory.

The "mirror" URLs expect to find HTML at "dists/" formatted like the HTML from the Debian project (that is to say, HTML containing relative links to distribution directories).

The "mirror" URL needs a trailing slash.

The "JSON" URL expects to find a JSON array of packages mapped to related vulnerabilities.

type JSONData

type JSONData map[string]Vulnerabilities

JSONData maps source package -> related vulnerabilities

type Matcher

type Matcher struct{}

Matcher is a driver.Matcher for Debian distributions.

func (*Matcher) Filter

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

Filter implements driver.Matcher.

func (*Matcher) Name

func (*Matcher) Name() string

Name implements driver.Matcher.

func (*Matcher) Query

func (*Matcher) Query() []driver.MatchConstraint

Query implements driver.Matcher.

func (*Matcher) Vulnerable

func (*Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error)

Vulnerable implements driver.Matcher.

type ReleaseData

type ReleaseData struct {
	Status       string `json:"status"`
	FixedVersion string `json:"fixed_version"`
	Urgency      string `json:"urgency"`
}

ReleaseData is data related to releases related to a vulnerability

type UpdaterConfig

type UpdaterConfig struct {
	// Deprecated: Use JSONURL instead.
	OVALURL string `json:"url" yaml:"url"`
	JSONURL string `json:"json_url" yaml:"json_url"`
	// Deprecated: Use DistsURLs instead.
	DistsURL  string      `json:"dists_url" yaml:"dists_url"`
	DistsURLs []sourceURL `json:"dists_urls" yaml:"dists_urls"`
}

UpdaterConfig is the configuration for the updater.

type Vulnerabilities

type Vulnerabilities map[string]*Vulnerability

Vulnerabilities maps vulnerability ID (CVE) -> related data

type Vulnerability

type Vulnerability struct {
	Description string                 `json:"description"`
	Releases    map[string]ReleaseData `json:"releases"`
}

Vulnerability is data related to a vulnerability

Jump to

Keyboard shortcuts

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