Documentation
¶
Index ¶
- Constants
- Variables
- func PackageToPackageUrl(pkp Package) *packageurl.PackageURL
- func ToAdvisoryUrl(pkg Package) string
- func ToPackageUrl(url string) (packageurl.PackageURL, error)
- type Advisory
- type Cve
- type Cwe
- type Descriptor
- type Distro
- type ImageSource
- type IndexResult
- type LayerMapping
- type Location
- type Package
- type Platform
- type Reference
- type Sbom
- type Score
- type Source
- type Url
Constants ¶
View Source
const ( Success string = "success" Failed string = "failed" )
Variables ¶
View Source
var NamespaceMapping = map[string]string{
"oracle": "oraclelinux",
"ol": "oraclelinux",
"amazon": "amazonlinux",
"amzn": "amazonlinux",
"rhel": "redhatlinux",
}
View Source
var PackageTypeMapping = map[string]string{
"apk": "alpine",
"debian": "deb",
"ubuntu": "deb",
"node-pkg": "npm",
"java": "maven",
"gobinary": "golang",
"go": "golang",
"go-module": "golang",
"java-archive": "maven",
"jenkins-plugin": "maven",
"python": "pypi",
"python-pkg": "pypi",
"jar": "maven",
"gemspec": "gem",
"centos": "rpm",
"oracle": "rpm",
"ol": "rpm",
"amzn": "rpm",
"amazon": "rpm",
"redhat": "rpm",
"photon": "rpm",
"sles": "rpm",
"rhel": "rpm",
"pip": "pypi",
"rubygems": "gem",
"rust": "cargo",
"crates.io": "cargo",
"packagist": "composer",
}
Functions ¶
func PackageToPackageUrl ¶ added in v0.0.7
func PackageToPackageUrl(pkp Package) *packageurl.PackageURL
func ToAdvisoryUrl ¶
func ToPackageUrl ¶
Types ¶
type Advisory ¶
type Advisory struct { Source string `edn:"vulnerability/source" json:"source"` SourceId string `edn:"vulnerability/source-id" json:"source_id"` References []Reference `edn:"vulnerability/references" json:"references"` Description string `edn:"vulnerability/description" json:"description,omitempty"` Cwes []Cwe `edn:"vulnerability/cwes" json:"cwes,omitempty"` Urls []Url `edn:"vulnerability/urls" json:"urls,omitempty"` }
type Cve ¶
type Cve struct { Purl string `edn:"purl" json:"purl"` Source string `edn:"source" json:"source"` SourceId string `edn:"source-id" json:"source_id"` VulnerableRange string `edn:"vulnerable-range" json:"vulnerable_range"` AdvisoryUrl string `edn:"url" json:"-"` FixedBy string `edn:"fixed-by" json:"fixed_by,omitempty"` Advisory *Advisory `edn:"v" json:"vendor_advisory,omitempty"` Cve *Advisory `edn:"cve" json:"nist_cve,omitempty"` }
type Descriptor ¶
type ImageSource ¶
type ImageSource struct { Name string `json:"name"` Digest string `json:"digest"` Tags *[]string `json:"tags,omitempty"` Manifest *v1.Manifest `json:"manifest"` Config *v1.ConfigFile `json:"config"` RawManifest string `json:"raw_manifest"` RawConfig string `json:"raw_config"` Distro Distro `json:"distro"` Platform Platform `json:"platform"` Size int64 `json:"size"` }
type IndexResult ¶
type LayerMapping ¶
type Package ¶
type Package struct { Type string `json:"type"` Namespace string `json:"namespace,omitempty"` Name string `json:"name"` Version string `json:"version"` Purl string `json:"purl"` Author string `json:"author,omitempty"` Description string `json:"description,omitempty"` Licenses []string `json:"licenses,omitempty"` Url string `json:"url,omitempty"` Size int `json:"size,omitempty"` InstalledSize int `json:"installed_size,omitempty"` Locations []Location `json:"locations"` Files []Location `json:"files,omitempty"` Parent string `json:"parent,omitempty"` }
func MergePackages ¶
func MergePackages(results ...IndexResult) []Package
func NormalizePackages ¶
type Sbom ¶
type Sbom struct { Source Source `json:"source"` Artifacts []Package `json:"artifacts"` Vulnerabilities []Cve `json:"vulnerabilities,omitempty"` Descriptor Descriptor `json:"descriptor"` }
type Source ¶
type Source struct { Type string `json:"type"` Image ImageSource `json:"image"` }
Click to show internal directories.
Click to hide internal directories.