trivy

package
v0.0.0-...-0fc2ddc Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Plugin the name of this plugin.
	Plugin = "Trivy"
)
View Source
const PolicyReportSource string = "Trivy"

Variables

This section is empty.

Functions

func GetScoreFromCVSS

func GetScoreFromCVSS(CVSSs map[string]*CVSS) *float64

func NewPlugin

func NewPlugin(clock ext.Clock, idGenerator ext.IDGenerator) vulnerabilityreport.Plugin

NewPlugin constructs a new vulnerabilityreport.Plugin, which is using an upstream Trivy container image to scan Kubernetes workloads.

This Plugin supports both Standalone and ClientServer modes depending on the settings returned by Config.GetMode.

The ClientServer mode is usually more performant, however it requires a Trivy server accessible at the configurable Config.GetServerURL.

Types

type CVSS

type CVSS struct {
	V3Score *float64 `json:"V3Score,omitempty"`
}

type Config

type Config struct {
	imgvuln.PluginConfig
}

Config defines configuration params for the Trivy vulnerabilityreport.Plugin.

func (Config) GetImageRef

func (c Config) GetImageRef() (string, error)

func (Config) GetInsecureRegistries

func (c Config) GetInsecureRegistries() map[string]bool

func (Config) GetMode

func (c Config) GetMode() (Mode, error)

func (Config) GetServerURL

func (c Config) GetServerURL() (string, error)

func (Config) IgnoreFileExists

func (c Config) IgnoreFileExists() bool

type Layer

type Layer struct {
	Digest string `json:"Digest"`
	DiffID string `json:"DiffID"`
}

type Mode

type Mode string

Mode describes mode in which Trivy client operates.

const (
	Standalone   Mode = "Standalone"
	ClientServer Mode = "ClientServer"
)

type ScanReport

type ScanReport struct {
	Target          string          `json:"Target"`
	Vulnerabilities []Vulnerability `json:"Vulnerabilities"`
}

type Vulnerability

type Vulnerability struct {
	VulnerabilityID  string            `json:"VulnerabilityID"`
	PkgName          string            `json:"PkgName"`
	InstalledVersion string            `json:"InstalledVersion"`
	FixedVersion     string            `json:"FixedVersion"`
	Title            string            `json:"Title"`
	Description      string            `json:"Description"`
	Severity         v1alpha1.Severity `json:"Severity"`
	Layer            Layer             `json:"Layer"`
	PrimaryURL       string            `json:"PrimaryURL"`
	References       []string          `json:"References"`
	Cvss             map[string]*CVSS  `json:"CVSS"`
}

Jump to

Keyboard shortcuts

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