trivy

package
v0.8.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jan 7, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewScannerPlugin added in v0.8.0

func NewScannerPlugin(idGenerator ext.IDGenerator, config Config) vulnerabilityreport.Plugin

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

This Plugin supports both starboard.Standalone and starboard.ClientServer client modes depending on the active mode returned by Config.GetTrivyMode.

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

Types

type Config added in v0.8.0

type Config interface {
	GetTrivyImageRef() (string, error)
	GetTrivyMode() (starboard.TrivyMode, error)
	GetTrivyServerURL() (string, error)
}

Config defines configuration params for the Trivy vulnerabilityreport.Plugin.

type Converter

type Converter interface {
	Convert(imageRef string, reader io.Reader) (v1alpha1.VulnerabilityScanResult, error)
}

Converter is the interface that wraps the Convert method.

Convert converts the vulnerabilities model used by Trivy to a generic model defined by the Custom Security Resource Specification.

func NewConverter

func NewConverter(config Config) Converter

type Layer

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

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"`
}

Jump to

Keyboard shortcuts

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