alpine

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2022 License: Apache-2.0 Imports: 17 Imported by: 4

Documentation

Index

Constants

View Source
const (
	Name = "Alpine Linux"
	ID   = "alpine"
)

Common os-release fields applicable for *claircore.Distribution usage.

Variables

This section is empty.

Functions

func DBUrl

func DBUrl(release Release, repo Repo) string

DBUrl will return a URL for the given release and repo pair.

func NewEcosystem

func NewEcosystem(ctx context.Context) *indexer.Ecosystem

NewEcosystem provides the set of scanners and coalescers for the alpine ecosystem

func UpdaterSet added in v0.0.21

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

Types

type Details

type Details struct {
	Name string `json:"name"`
	// Fixed package version string mapped to an array of CVE ids affecting the
	// package.
	Secfixes map[string][]string `json:"secfixes"`
}

Details define a package's name and relevant security fixes included in a given version.

type DistributionScanner added in v0.0.14

type DistributionScanner struct{}

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

type Option func(*Updater) error

Option configures the provided Updater

func WithClient added in v0.1.15

func WithClient(c *http.Client) Option

WithClient allows changing the client used for fetching databases.

func WithURL

func WithURL(url string) Option

WithURL overrides the default URL to fetch an OVAL database.

The default is derived from the Release and Repo arguments passed to NewUpdater.

type Package

type Package struct {
	Pkg Details `json:"pkg"`
}

Package wraps the Details.

type Release

type Release string

Release is a particular release of the Alpine linux distribution

const (
	V3_15 Release = "v3.15"
	V3_14 Release = "v3.14"
	V3_13 Release = "v3.13"
	V3_12 Release = "v3.12"
	V3_11 Release = "v3.11"
	V3_10 Release = "v3.10"
	V3_9  Release = "v3.9"
	V3_8  Release = "v3.8"
	V3_7  Release = "v3.7"
	V3_6  Release = "v3.6"
	V3_5  Release = "v3.5"
	V3_4  Release = "v3.4"
	V3_3  Release = "v3.3"
)

These are known releases.

type Repo

type Repo string
const (
	Main      Repo = "main"
	Community Repo = "community"
)

type Scanner

type Scanner struct{}

Scanner scans for packages in an apk database.

The zero value is ready to use.

func (*Scanner) Kind

func (*Scanner) Kind() string

Kind implements indexer.VersionedScanner.

func (*Scanner) Name

func (*Scanner) Name() string

Name implements indexer.VersionedScanner.

func (*Scanner) Scan

func (*Scanner) Scan(ctx context.Context, layer *claircore.Layer) ([]*claircore.Package, error)

Scan examines a layer for an apk installation database, and extracts the packages listed there.

A return of (nil, nil) is expected if there's no apk database.

func (*Scanner) Version

func (*Scanner) Version() string

Version implements indexer.VersionedScanner.

type SecurityDB

type SecurityDB struct {
	Distroversion string    `json:"distroversion"`
	Reponame      string    `json:"reponame"`
	Urlprefix     string    `json:"urlprefix"`
	Apkurl        string    `json:"apkurl"`
	Packages      []Package `json:"packages"`
}

SecurityDB is the security database structure.

type Updater

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

func NewUpdater

func NewUpdater(release Release, repo Repo, opts ...Option) (*Updater, error)

NewUpdater returns an updater configured according to the provided Options.

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 (*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 accepted by Alpine updaters.

By convention, this should be in a map called "alpine-${REPO}-${RELEASE}-updater". For example, "alpine-main-v3.12-updater".

Jump to

Keyboard shortcuts

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