Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var All = []Type{ Debian, Ubuntu, RedHat, CentOS, Fedora, Alpine, Busybox, AmazonLinux, OracleLinux, ArchLinux, OpenSuseLeap, SLES, Photon, Windows, Mariner, RockyLinux, AlmaLinux, Gentoo, Wolfi, }
All contains all Linux distribution options
var CpeOsProductMapping = map[Type]string{ Debian: "debian_linux", Ubuntu: "ubuntu_linux", RedHat: "enterprise_linux", CentOS: "centos", Fedora: "fedora", Alpine: "alpine_linux", Busybox: "busybox", AmazonLinux: "amazon_linux", OracleLinux: "linux", ArchLinux: "arch_linux", OpenSuseLeap: "leap", SLES: "linux_enterprise_server", Photon: "photon_os", Windows: "windows", Mariner: "mariner", RockyLinux: "rocky", AlmaLinux: "almalinux", Gentoo: "gentoo", Wolfi: "wolfi", }
CpeOsProductMapping connects a distro type to a CPE OS product string The reason this exists is because there is low coverage of CPE_NAME in /etc/os-release file across distros. This is a best effort to map the distro type to a CPE vendor string.
var CpeOsVendorMapping = map[Type]string{ Debian: "debian", Ubuntu: "canonical", RedHat: "redhat", CentOS: "centos", Fedora: "fedoraproject", Alpine: "alpinelinux", Busybox: "busybox", AmazonLinux: "amazon", OracleLinux: "oracle", ArchLinux: "archlinux", OpenSuseLeap: "opensuse", SLES: "suse", Photon: "vmware", Windows: "microsoft", Mariner: "microsoft", RockyLinux: "rocky", AlmaLinux: "almalinux", Gentoo: "gentoo", Wolfi: "wolfi", }
CpeOsVendorMapping connects a distro type to a CPE OS vendor string The reason this exists is because there is low coverage of CPE_NAME in /etc/os-release file across distros. This is a best effort to map the distro type to a CPE vendor string.
var IDMapping = map[string]Type{ "debian": Debian, "ubuntu": Ubuntu, "rhel": RedHat, "centos": CentOS, "fedora": Fedora, "alpine": Alpine, "busybox": Busybox, "amzn": AmazonLinux, "ol": OracleLinux, "arch": ArchLinux, "opensuse-leap": OpenSuseLeap, "sles": SLES, "photon": Photon, "windows": Windows, "mariner": Mariner, "rocky": RockyLinux, "almalinux": AlmaLinux, "gentoo": Gentoo, "wolfi": Wolfi, }
IDMapping connects a distro ID like "ubuntu" to a Distro type
Functions ¶
This section is empty.
Types ¶
type CPEName ¶
type CPEName string
CPEName returns the CPE name for the distro.
func (CPEName) Destructured ¶
Destructured splits a CPE name into its (cpe:2.3:o:vendor:package) and version components.
type Distro ¶
type Distro struct { Type Type Version *hashiVer.Version RawVersion string IDLike []string CPEName CPEName }
Distro represents a Linux Distribution.
func NewFromRelease ¶
NewFromRelease creates a new Distro object derived from a syft linux.Release object.
func (Distro) FullVersion ¶
FullVersion returns the original user version value.
func (Distro) MajorVersion ¶
MajorVersion returns the major version value from the pseudo-semantically versioned distro version value.
type Type ¶
type Type string
Type represents the different Linux distribution options
const ( Debian Type = "debian" Ubuntu Type = "ubuntu" RedHat Type = "redhat" CentOS Type = "centos" Fedora Type = "fedora" Alpine Type = "alpine" Busybox Type = "busybox" AmazonLinux Type = "amazonlinux" OracleLinux Type = "oraclelinux" ArchLinux Type = "archlinux" OpenSuseLeap Type = "opensuseleap" SLES Type = "sles" Photon Type = "photon" Windows Type = "windows" Mariner Type = "mariner" RockyLinux Type = "rockylinux" AlmaLinux Type = "almalinux" Gentoo Type = "gentoo" Wolfi Type = "wolfi" )