trivytype

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetToolVersion

func GetToolVersion(sbom TrivySbomType) string

SBOM accessors for nexted properties

Types

type TrivyCvss

type TrivyCvss struct {
	Azure      TrivyCvssEntry `json:"azure"`
	CblMariner TrivyCvssEntry `json:"cbl-mariner"`
	Nvd        TrivyCvssEntry `json:"nvd"`
	RedHat     TrivyCvssEntry `json:"redhat"`
	Ubuntu     TrivyCvssEntry `json:"ubuntu"`
}

`json:""`

type TrivyCvssEntry

type TrivyCvssEntry struct {
	V2Vector string  `json:"V2Vector"`
	V2Score  float64 `json:"V2Score"`

	V3Vector string  `json:"V3Vector"`
	V3Score  float64 `json:"V3Score"`

	V4Vector string  `json:"V4Vector"`
	V4Score  float64 `json:"V4Score"`
}

type TrivyDataSource

type TrivyDataSource struct {
	Id   string `json:"ID"`
	Name string `json:"Name"`
	Url  string `json:"URL"`
}

type TrivyImageConfig

type TrivyImageConfig struct {
	Architecture string    `json:"architecture"`
	Created      time.Time `json:"created"`
	OS           string    `json:"os"`
	Rootfs       struct {
		Type string `json:"type"`
	} `json:"rootfs"`
}

type TrivyLayer

type TrivyLayer struct {
	Size   uint64 `json:"Size"`
	DiffId string `json:"DiffID"`
}

type TrivyMetadata

type TrivyMetadata struct {
	ImageId string `json:"ImageID"`
	//Size    uint64 `json:"Size"`
	OS struct {
		Famile string `json:"Family"`
		Name   string `json:"Name"`
		EOSL   bool   `json:"EOSL"`
	} `json:"OS"`
	RepoTags    []string         `json:"RepoTags"`
	RepoDigests []string         `json:"RepoDigests"`
	ImageConfig TrivyImageConfig `json:"ImageConfig"`
	Layers      []TrivyLayer     `json:"Layers"`
}

`json:""`

type TrivyPkgIdentifier

type TrivyPkgIdentifier struct {
	Purl   string `json:"PURL"`
	Uid    string `json:"UID"`
	BomRef string `json:"BOMRef"`
}

type TrivyResult

type TrivyResult struct {
	Target          string               `json:"Target"`
	Class           string               `json:"Class"`
	Type            string               `json:"Type"`
	Vulnerabilities []TrivyVulnerability `json:"Vulnerabilities"`
}

type TrivySbomType

type TrivySbomType struct {
	cdx.BOM
}

func (*TrivySbomType) FromBytes

func (rx *TrivySbomType) FromBytes(input []byte) error

parse []bytes to model

type TrivyScanType

type TrivyScanType struct {
	SchemaVersion int       `json:"SchemaVersion"`
	CreatedAt     time.Time `json:"CreatedAt"`

	ArtifactName string `json:"ArtifactName"`
	ArtifactType string `json:"ArtifactType"`

	Metadata TrivyMetadata `json:"Metadata"`
	Results  []TrivyResult `json:"Results"`
}

func (*TrivyScanType) ListVulnerabilities

func (rx *TrivyScanType) ListVulnerabilities() []TrivyVulnerability

return complete list of vulnerabilities

func (*TrivyScanType) ReadBytes

func (rx *TrivyScanType) ReadBytes(data []byte) error

parse trivy scan

type TrivyVendorSevurity

type TrivyVendorSevurity struct {
	Azure      int `json:"azure"`
	CblMariner int `json:"cbl-mariner"`
	NVD        int `json:"nvd"`
	RedHat     int `json:"redhat"`
	Ubuntu     int `json:"ubuntu"`
}

type TrivyVulnerability

type TrivyVulnerability struct {
	VulnerabilityId  string              `json:"VulnerabilityID"`
	PkgId            string              `json:"PkgID"`
	PkgName          string              `json:"PkgName"`
	PkgIdentifier    TrivyPkgIdentifier  `json:"PkgIdentifier"`
	InstalledVersion string              `json:"InstalledVersion"`
	FixedVersion     string              `json:"FixedVersion"`
	Status           string              `json:"Status"`
	SeveritySource   string              `json:"SeveritySource"`
	PrimaryURL       string              `json:"PrimaryURL"`
	DataSource       TrivyDataSource     `json:"DataSource"`
	Title            string              `json:"Title"`
	Description      string              `json:"Description"`
	Severity         string              `json:"Severity"`
	CweIds           []string            `json:"CweIDs"`
	VendorSecurity   TrivyVendorSevurity `json:"VendorSeverity"`
	Cvss             TrivyCvss           `json:"CVSS"`
	References       []string            `json:"References"`
	PublishedDate    time.Time           `json:"PublishedDate"`
	LastModifiedDate time.Time           `json:"LastModifiedDate"`
}

Jump to

Keyboard shortcuts

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