trivy

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2024 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const SchemaVersion = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth added in v0.12.0

type BasicAuth struct {
	Username string
	Password string
}

type BearerAuth added in v0.12.0

type BearerAuth struct {
	Token string
}

type CVSSInfo added in v0.14.0

type CVSSInfo struct {
	V2Vector string   `json:"V2Vector,omitempty"`
	V3Vector string   `json:"V3Vector,omitempty"`
	V2Score  *float32 `json:"V2Score,omitempty"`
	V3Score  *float32 `json:"V3Score,omitempty"`
}

type Format added in v0.31.0

type Format string
const (
	FormatJSON      Format = "json"
	FormatSPDX      Format = "spdx-json"
	FormatCycloneDX Format = "cyclonedx"
)

type ImageRef added in v0.5.0

type ImageRef struct {
	Name   string
	Auth   RegistryAuth
	NonSSL bool
}

type Layer added in v0.9.0

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

type Metadata added in v0.6.0

type Metadata struct {
	NextUpdate time.Time `json:"NextUpdate"`
	UpdatedAt  time.Time `json:"UpdatedAt"`
}

type MockWrapper added in v0.5.0

type MockWrapper struct {
	mock.Mock
}

func NewMockWrapper added in v0.5.0

func NewMockWrapper() *MockWrapper

func (*MockWrapper) GetVersion added in v0.6.0

func (w *MockWrapper) GetVersion() (VersionInfo, error)

func (*MockWrapper) Scan added in v0.5.0

func (w *MockWrapper) Scan(imageRef ImageRef, opt ScanOption) (Report, error)

type NoAuth added in v0.12.0

type NoAuth struct {
}

type RegistryAuth

type RegistryAuth interface {
}

RegistryAuth wraps registry credentials.

type Report added in v0.31.0

type Report struct {
	SBOM            any
	Vulnerabilities []Vulnerability
}

type ScanOption added in v0.31.0

type ScanOption struct {
	Format Format
}

type ScanReport

type ScanReport struct {
	SchemaVersion int
	Results       []ScanResult `json:"Results"`
}

type ScanResult added in v0.23.0

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

type ScanTarget added in v0.31.0

type ScanTarget struct {
	// contains filtered or unexported fields
}

func (ScanTarget) Auth added in v0.31.0

func (t ScanTarget) Auth() RegistryAuth

func (ScanTarget) Clean added in v0.31.0

func (t ScanTarget) Clean() error

func (ScanTarget) Name added in v0.31.0

func (t ScanTarget) Name() (string, error)

func (ScanTarget) NonSSL added in v0.31.0

func (t ScanTarget) NonSSL() bool

type Target added in v0.31.0

type Target string
const (
	TargetSBOM  Target = "sbom"
	TargetImage Target = "image"
)

type VersionInfo added in v0.6.0

type VersionInfo struct {
	Version         string    `json:"Version,omitempty"`
	VulnerabilityDB *Metadata `json:"VulnerabilityDB"`
	JavaDB          *Metadata `json:"JavaDB"`
}

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         string              `json:"Severity"`
	References       []string            `json:"References"`
	PrimaryURL       string              `json:"PrimaryURL"`
	Layer            *Layer              `json:"Layer"`
	CVSS             map[string]CVSSInfo `json:"CVSS"`
	CweIDs           []string            `json:"CweIDs"`
}

type Wrapper

type Wrapper interface {
	Scan(imageRef ImageRef, opt ScanOption) (Report, error)
	GetVersion() (VersionInfo, error)
}

func NewWrapper

func NewWrapper(config etc.Trivy, ambassador ext.Ambassador) Wrapper

Jump to

Keyboard shortcuts

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