Documentation
¶
Index ¶
- Constants
- Variables
- func AdvisoryLink(version, alasID string) string
- func Namespace(version string) string
- func TransformUpdate(u Update, namespace, version string) schema.OSVulnerability
- type Collection
- type DateAttr
- type Pkg
- type PkgList
- type Provider
- type Reference
- type References
- type Update
- type UpdateInfo
Constants ¶
const ( ProviderName = "amazon" SchemaName = "os" SchemaVersion = "1.1.0" Version = 1 VersionFormat = "rpm" )
Variables ¶
var AmazonVersions = []string{"1", "2", "2023"}
AmazonVersions lists the Amazon Linux versions to fetch.
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 ¶
AdvisoryLink returns the ALAS advisory URL for a given version and advisory ID.
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 ¶
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 (*Provider) FetchIncremental ¶
func (*Provider) MetadataPath ¶
func (*Provider) ResultsPath ¶
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 ¶
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.