alpine

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

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

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

Variables

View Source
var ReleaseToPrettyName = map[Release]string{
	V3_10: "Alpine Linux v3.10",
	V3_9:  "Alpine Linux v3.9",
	V3_8:  "Alpine Linux v3.8",
	V3_7:  "Alpine Linux v3.7",
	V3_6:  "Alpine Linux v3.6",
	V3_5:  "Alpine Linux v3.5",
	V3_4:  "Alpine Linux v3.4",
	V3_3:  "Alpine Linux v3.3",
}

ReleaseToPrettyName maps a Release to the PrettyName found in alpine's os-release file.

Official Alpine images consistantly have a Pretty_Name field in their os-release files.

Functions

func DBUrl

func DBUrl(release Release, repo Repo) string

DBUrl will return a fqdn'd url for a given release,repo pair

func NewEcosystem

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

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

func UpdaterSet added in v0.0.21

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

Types

type Details

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

Details define a package's name and security fixes for said package

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 WithURL

func WithURL(url string) Option

WithURL overrides the default URL to fetch an OVAL database.

type Package

type Package struct {
	Pkg Details `yaml:pkg`
}

Package wraps the Details

type Release

type Release string

Release is a particular release of the Alpine linux distribution

const (
	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"
)

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    `yaml:"distroversion"`
	Reponame      string    `yaml:"reponame"`
	Urlprefix     string    `yaml:"urlprefix"`
	Apkurl        string    `yaml:"apkurl"`
	Packages      []Package `yaml:"packages"`
}

SecurityDB is the yaml security database structure

func (*SecurityDB) Parse

func (db *SecurityDB) Parse(contents io.Reader) error

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) Fetch

func (*Updater) Name

func (u *Updater) Name() string

func (*Updater) Parse

Jump to

Keyboard shortcuts

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