Documentation ¶
Index ¶
- Constants
- Variables
- func DBUrl(release Release, repo Repo) string
- func NewEcosystem(ctx context.Context) *indexer.Ecosystem
- func UpdaterSet(_ context.Context) (driver.UpdaterSet, error)
- type Details
- type DistributionScanner
- type Matcher
- type Option
- type Package
- type Release
- type Repo
- type Scanner
- type SecurityDB
- type Updater
Constants ¶
const ( Name = "Alpine Linux" ID = "alpine" )
Common os-release fields applicable for *claircore.Distribution usage.
Variables ¶
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 NewEcosystem ¶
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
func (ds *DistributionScanner) Scan(ctx context.Context, l *claircore.Layer) ([]*claircore.Distribution, error)
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) Query ¶
func (*Matcher) Query() []driver.MatchConstraint
func (*Matcher) Vulnerable ¶
func (*Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error)
type Scanner ¶
type Scanner struct{}
Scanner scans for packages in an apk database.
The zero value is ready to use.
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
type Updater ¶
type Updater struct {
// contains filtered or unexported fields
}
func NewUpdater ¶
NewUpdater returns an updater configured according to the provided Options.
func (*Updater) Fetch ¶
func (u *Updater) Fetch(ctx context.Context, hint driver.Fingerprint) (io.ReadCloser, driver.Fingerprint, error)
func (*Updater) Parse ¶
func (u *Updater) Parse(ctx context.Context, r io.ReadCloser) ([]*claircore.Vulnerability, error)