alpine

package
v0.4.11 Latest Latest
Warning

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

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

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

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

type DistributionScanner struct{}

DistributionScanner attempts to discover if a layer displays characteristics of a alpine distribution

func (*DistributionScanner) Kind

func (*DistributionScanner) Kind() string

Kind implements scanner.VersionedScanner.

func (*DistributionScanner) Name

func (*DistributionScanner) Name() string

Name implements scanner.VersionedScanner.

func (*DistributionScanner) Scan

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

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

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

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_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

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

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