amazon

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderName  = "amazon"
	SchemaName    = "os"
	SchemaVersion = "1.1.0"
	Version       = 1

	VersionFormat = "rpm"
)

Variables

View Source
var AmazonVersions = []string{"1", "2", "2023"}

AmazonVersions lists the Amazon Linux versions to fetch.

View Source
var VersionRepos = map[string]string{
	"1":    "http://repo.us-east-1.amazonaws.com/2018.03/updates/x86_64/",
	"2":    "https://cdn.amazonlinux.com/2/core/latest/x86_64/",
	"2023": "https://cdn.amazonlinux.com/al2023/core/mirrors/latest/x86_64/",
}

VersionRepos maps Amazon Linux version to the base URL of its YUM repository.

Functions

func AdvisoryLink(version, alasID string) string

AdvisoryLink returns the ALAS advisory URL for a given version and advisory ID.

func Namespace

func Namespace(version string) string

Namespace returns the Amazon Linux namespace for a given version (e.g., "amzn:2").

func TransformUpdate

func TransformUpdate(u Update, namespace, version string) schema.OSVulnerability

TransformUpdate converts an UpdateInfo advisory into an OSVulnerability. namespace is the target namespace (e.g., "amzn:2"). version is the Amazon Linux version string (e.g., "2") used for link generation.

Types

type Collection

type Collection struct {
	Short   string `xml:"short,attr"`
	Package []Pkg  `xml:"package"`
}

Collection is a named group of packages (e.g., "amazon-linux-2").

type DateAttr

type DateAttr struct {
	Date string `xml:"date,attr"`
}

DateAttr captures a date attribute from elements like <issued date="2018-01-11 18:43"/>.

type Pkg

type Pkg struct {
	Arch     string `xml:"arch,attr"`
	Epoch    string `xml:"epoch,attr"`
	Name     string `xml:"name,attr"`
	Release  string `xml:"release,attr"`
	Version  string `xml:"version,attr"`
	Filename string `xml:"filename"`
}

Pkg is a single RPM package entry.

type PkgList

type PkgList struct {
	Collection []Collection `xml:"collection"`
}

PkgList wraps collections of packages.

type Provider

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

func NewProvider

func NewProvider(cfg provider.Config) (*Provider, error)

func (*Provider) FetchAll

func (p *Provider) FetchAll(ctx context.Context) error

func (*Provider) FetchIncremental

func (p *Provider) FetchIncremental(ctx context.Context, lastUpdated time.Time) error

func (*Provider) MetadataPath

func (p *Provider) MetadataPath() string

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) ResultsPath

func (p *Provider) ResultsPath() string

type Reference

type Reference struct {
	Href  string `xml:"href,attr"`
	ID    string `xml:"id,attr"`
	Title string `xml:"title,attr"`
	Type  string `xml:"type,attr"`
}

Reference is a single CVE or bugzilla reference.

type References

type References struct {
	Reference []Reference `xml:"reference"`
}

References wraps the list of CVE/bugzilla references.

type Update

type Update struct {
	From        string     `xml:"from,attr"`
	Status      string     `xml:"status,attr"`
	Type        string     `xml:"type,attr"`
	Version     string     `xml:"version,attr"`
	ID          string     `xml:"id"`
	Title       string     `xml:"title"`
	Issued      DateAttr   `xml:"issued"`
	Updated     DateAttr   `xml:"updated"`
	Severity    string     `xml:"severity"`
	Description string     `xml:"description"`
	References  References `xml:"references"`
	PkgList     PkgList    `xml:"pkglist"`
}

Update represents a single security advisory in UpdateInfo XML.

type UpdateInfo

type UpdateInfo struct {
	XMLName xml.Name `xml:"updates"`
	Updates []Update `xml:"update"`
}

UpdateInfo is the top-level element of a YUM UpdateInfo XML file.

func ParseUpdateInfo

func ParseUpdateInfo(r io.Reader) (*UpdateInfo, error)

ParseUpdateInfo parses a YUM UpdateInfo XML document.

Jump to

Keyboard shortcuts

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