aws

package
v1.6.5 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2026 License: Apache-2.0 Imports: 25 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	Low       = "low"
	Medium    = "medium"
	Important = "important"
	Critical  = "critical"
)
View Source
const (
	// PURLType is the type of package URL for RPM packages.
	PURLType = "rpm"
	// PURLNamespace is the namespace of AWS RPMs.
	PURLNamespace = "aws"
)

Variables

View Source
var AL1Dist = &claircore.Distribution{
	Name:       "Amazon Linux AMI",
	DID:        ID,
	Version:    "2018.03",
	VersionID:  "2018.03",
	PrettyName: "Amazon Linux AMI 2018.03",
	CPE:        cpe.MustUnbind("cpe:/o:amazon:linux:2018.03:ga"),
}
View Source
var AL2023Dist = &claircore.Distribution{
	Name:       "Amazon Linux",
	DID:        ID,
	Version:    "2023",
	VersionID:  "2023",
	PrettyName: "Amazon Linux 2023",
	CPE:        cpe.MustUnbind("cpe:2.3:o:amazon:amazon_linux:2023:*:*:*:*:*:*:*"),
}
View Source
var AL2Dist = &claircore.Distribution{
	Name:       "Amazon Linux",
	DID:        ID,
	Version:    "2",
	VersionID:  "2",
	PrettyName: "Amazon Linux 2",
	CPE:        cpe.MustUnbind("cpe:2.3:o:amazon:amazon_linux:2:*:*:*:*:*:*:*"),
}
View Source
var ReleaseToRepo = map[Release]Repo{
	AmazonLinux1:    amzn1,
	AmazonLinux2:    amzn2,
	AmazonLinux2023: amzn2023,
}

Functions

func GeneratePURL added in v1.5.49

GeneratePURL generates an RPM PURL for a given claircore.IndexRecord.

func NormalizeSeverity added in v0.0.15

func NormalizeSeverity(severity string) claircore.Severity

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

func ParsePURL added in v1.5.49

func ParsePURL(ctx context.Context, purl packageurl.PackageURL) ([]*claircore.IndexRecord, error)

ParsePURL parses an RPM PURL into a list of [claircore.IndexRecord]s.

func UpdaterSet added in v0.0.21

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 added in v0.0.14

type DistributionScanner struct{}

DistributionScanner attempts to discover if a layer displays characteristics of a AWS 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 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 added in v0.0.14

func (*DistributionScanner) Version() string

Version implements scanner.VersionedScanner.

type Matcher added in v0.0.6

type Matcher struct{}

func (*Matcher) Filter added in v0.0.6

func (*Matcher) Filter(record *claircore.IndexRecord) bool

func (*Matcher) Name added in v0.0.8

func (*Matcher) Name() string

func (*Matcher) Query added in v0.0.6

func (*Matcher) Query() []driver.MatchConstraint

func (*Matcher) Vulnerable added in v0.0.6

func (*Matcher) Vulnerable(ctx context.Context, record *claircore.IndexRecord, vuln *claircore.Vulnerability) (bool, error)

type Release

type Release string
const (
	AmazonLinux1    Release = "AL1"
	AmazonLinux2    Release = "AL2"
	AmazonLinux2023 Release = "AL2023"
	// 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 added in v0.4.2

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)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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