Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var All = []Type{ Debian, Ubuntu, RedHat, CentOS, Fedora, Alpine, Busybox, AmazonLinux, OracleLinux, ArchLinux, OpenSuseLeap, SLES, Photon, Echo, Windows, Mariner, Azure, RockyLinux, AlmaLinux, Gentoo, Wolfi, Chainguard, MinimOS, Raspbian, }
All contains all Linux distribution options
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, "echo": Echo, "mariner": Mariner, "azurelinux": Azure, "rocky": RockyLinux, "almalinux": AlmaLinux, "gentoo": Gentoo, "wolfi": Wolfi, "chainguard": Chainguard, "minimos": MinimOS, "raspbian": Raspbian, }
IDMapping maps a distro ID from the /etc/os-release (e.g. like "ubuntu") to a Distro type.
Functions ¶
This section is empty.
Types ¶
type Distro ¶
type Distro struct {
Type Type
Version string // major.minor.patch
Codename string // in lieu of a version e.g. "fossa" instead of "20.04"
Channels []string // distinguish between different feeds for fix and vulnerability data, e.g. "eus" for RHEL
IDLike []string
// contains filtered or unexported fields
}
Distro represents a Linux Distribution.
func FromRelease ¶ added in v0.92.0
func FromRelease(linuxRelease *linux.Release, channels []FixChannel) *Distro
FromRelease attempts to get a distro from the linux release, only logging any errors
func NewFromNameVersion ¶ added in v0.92.0
NewFromNameVersion creates a new Distro object derived from the provided name and version
func NewFromRelease ¶
func NewFromRelease(release linux.Release, channels []FixChannel) (*Distro, error)
NewFromRelease creates a new Distro object derived from a syft linux.Release object.
func (Distro) Disabled ¶ added in v0.58.0
Disabled is a way to convey if a Linux distribution is not supported by Grype.
func (Distro) MajorVersion ¶
MajorVersion returns the major version value from the pseudo-semantically versioned distro version value.
func (Distro) MinorVersion ¶ added in v0.88.0
MinorVersion returns the minor version value from the pseudo-semantically versioned distro version value.
func (Distro) RemainingVersion ¶ added in v0.91.0
func (Distro) VersionString ¶ added in v0.97.1
type FixChannel ¶ added in v0.97.1
type FixChannel struct {
// Name is the name of the channel, e.g. "eus" for RHEL
Name string
// IDs is a list of distro release IDs that this channel applies to, e.g. "rhel" for RHEL (this is relative to the /etc/os-release ID field)
IDs []string
// Apply indicates how the channel should be applied to the distro
Apply FixChannelEnabled
// Versions is a version constraint that indicates which versions of the distro this channel applies to (e.g. ">= 8.0" for RHEL 8 and above)
Versions version.Constraint
}
FixChannel represents a subscription or repository where package fixes and updates are provided for a Linux distribution
type FixChannelEnabled ¶ added in v0.97.1
type FixChannelEnabled string
const ( // ChannelNeverEnabled means that the channel should never be applied to the distro ChannelNeverEnabled FixChannelEnabled = "never" // ChannelAlwaysEnabled means that the channel should always be applied to the distro ChannelAlwaysEnabled FixChannelEnabled = "always" // ChannelConditionallyEnabled means that the channel should conditionally be applied to the distro if there is SBOM material that indicates the channel was configured at build time ChannelConditionallyEnabled FixChannelEnabled = "auto" )
type FixChannels ¶ added in v0.97.1
type FixChannels []FixChannel
func DefaultFixChannels ¶ added in v0.97.1
func DefaultFixChannels() FixChannels
func (FixChannels) Apply ¶ added in v0.97.1
func (f FixChannels) Apply(enable FixChannelEnabled) FixChannels
func (FixChannels) Get ¶ added in v0.97.1
func (f FixChannels) Get(name string) *FixChannel
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" Echo Type = "echo" Windows Type = "windows" Mariner Type = "mariner" Azure Type = "azurelinux" RockyLinux Type = "rockylinux" AlmaLinux Type = "almalinux" Gentoo Type = "gentoo" Wolfi Type = "wolfi" Chainguard Type = "chainguard" MinimOS Type = "minimos" Raspbian Type = "raspbian" )