aws

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: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Low       = "low"
	Medium    = "medium"
	Important = "important"
	Critical  = "critical"
)

Variables

View Source
var ReleaseToRepo = map[Release]Repo{
	Linux1: amzn1,
	Linux2: amzn2,
}

Functions

func NormalizeSeverity

func NormalizeSeverity(severity string) claircore.Severity

NormalizeSeverity takes a aws.Severity and normalizes it to a claircore.Severity.

func UpdaterSet

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

Types

type Client

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

Client is an http for accessing ALAS mirrors.

func NewClient

func NewClient(ctx context.Context, hc *http.Client, release Release) (*Client, error)

func (*Client) RepoMD

func (c *Client) RepoMD(ctx context.Context) (alas.RepoMD, error)

RepoMD returns a alas.RepoMD containing sha256 information of a repositories contents

func (*Client) Updates

func (c *Client) Updates(ctx context.Context) (io.ReadCloser, error)

Updates returns the *http.Response of the first mirror to establish a connection

type DistributionScanner

type DistributionScanner struct{}

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

type Release string
const (
	Linux1 Release = "linux1"
	Linux2 Release = "linux2"
	// os-release name ID field consistently available on official amazon linux images
	ID = "amzn"
)

type Repo

type Repo string

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 a claircore.Updater

func NewUpdater

func NewUpdater(release Release) (*Updater, error)

func (*Updater) Configure

func (u *Updater) Configure(ctx context.Context, _ driver.ConfigUnmarshaler, c *http.Client) error

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

func (u *Updater) Parse(ctx context.Context, contents io.ReadCloser) ([]*claircore.Vulnerability, error)

Jump to

Keyboard shortcuts

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