debian

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: May 24, 2022 License: Apache-2.0 Imports: 24 Imported by: 4

Documentation

Index

Constants

View Source
const (
	OSReleaseName = "Debian GNU/Linux"
	OSReleaseID   = "debian"
)

identifiers commonly in debian distro os-release file

View Source
const (
	OVALTemplate   = "https://www.debian.org/security/oval/oval-definitions-%s.xml"
	PkgNameVersion = `([^\s]+) DPKG is earlier than (.+)`
)

Variables

View Source
var AllReleases = map[Release]struct{}{
	Bullseye: struct{}{},
	Buster:   struct{}{},
	Jessie:   struct{}{},
	Stretch:  struct{}{},
	Wheezy:   struct{}{},
}
View Source
var ReleaseToVersionID = map[Release]string{
	Bullseye: "11",
	Buster:   "10",
	Jessie:   "8",
	Stretch:  "9",
	Wheezy:   "7",
}

Functions

func ResolveVersionCodeName

func ResolveVersionCodeName(osrelease map[string]string) string

Resolve iterates over each os-release entry and tries to find a release string. if found we return the found release in string form. if not found empty string is returned

func UpdaterSet added in v0.0.21

func UpdaterSet(_ context.Context) (driver.UpdaterSet, error)

Types

type DistributionScanner added in v0.0.14

type DistributionScanner struct{}

DistributionScanner attempts to discover if a layer displays characteristics of a Debian 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

Scan will inspect the layer for an os-release or lsb-release file and perform a regex match for keywords indicating the associated Debian 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 Matcher

type Matcher struct{}

func (*Matcher) Filter

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

func (*Matcher) Name added in v0.0.8

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 Release

type Release string
const (
	Bullseye Release = "bullseye"
	Buster   Release = "buster"
	Jessie   Release = "jessie"
	Stretch  Release = "stretch"
	Wheezy   Release = "wheezy"
)

type SourcesMap added in v1.3.0

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

SourcesMap wraps a map that defines the relationship between a source package and it's associated binaries. It offers an Update method to populate and update the map. It is Release-centric.

It should have the same lifespan as the Updater to save allocations and take advantage of the entity tag that debian sends back.

func NewSourcesMap added in v1.3.0

func NewSourcesMap(release Release, client *http.Client) *SourcesMap

NewSourcesMap returns a SourcesMap but does not perform any inserts into the map. That needs to be done explitly by calling the Update method.

func (*SourcesMap) Get added in v1.3.0

func (m *SourcesMap) Get(source string) []string

Get returns all the binaries associated with a source package identified by a string. Empty slice is returned if the source doesn't exist in the map.

func (*SourcesMap) Update added in v1.3.0

func (m *SourcesMap) Update(ctx context.Context) error

Update pulls the Sources.gz files for the different repos and saves the resulting source to binary relationships.

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 added in v0.4.2

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 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 "debian-${RELEASE}-updater", e.g. "debian-buster-updater".

Jump to

Keyboard shortcuts

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