trivy

package
v0.0.0-...-46fbbb1 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const SchemaVersion = 2

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username string
	Password string
}

type BearerAuth

type BearerAuth struct {
	Token string
}

type CNSIReport

type CNSIReport struct {
	GeneratedAt     string          `json:"generated_at,omitempty"`
	Artifact        harbor.Artifact `json:"artifact,omitempty"`
	Scanner         harbor.Scanner  `json:"scanner,omitempty"`
	Severity        string          `json:"severity,omitempty"`
	Vulnerabilities string          `json:"vulnerabilities,omitempty"`
	Report          Report          `json:"Report,omitempty"`
}

CNSIReport represents a scan result

type CVSSInfo

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

type CauseMetadata

type CauseMetadata struct {
	Provider  string `json:"Provider"`
	Service   string `json:"Service"`
	StartLine int    `json:"Startline"`
	EndLine   int    `json:"EndLine"`
	Code      Code   `json:"Code"`
}

type Code

type Code struct {
	Lines []Lines `json:"Lines"`
}

type ImageLayer

type ImageLayer struct {
	DiffID string `json:"DiffID"`
}

type ImageRef

type ImageRef struct {
	Name     string
	Auth     RegistryAuth
	Insecure bool
}

type Layer

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

type Lines

type Lines struct {
	Number     int    `json:"Number"`
	Content    string `json:"Content"`
	IsCause    bool   `json:"IsCause"`
	Annotation string `json:"Annotation"`
	Truncated  bool   `json:"Truncated"`
	FirstCause bool   `json:"FirstCause"`
	LastCause  bool   `json:"LastCause"`
}

type Metadata

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

type MockWrapper

type MockWrapper struct {
	mock.Mock
}

func NewMockWrapper

func NewMockWrapper() *MockWrapper

func (*MockWrapper) GetVersion

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

func (*MockWrapper) Scan

func (w *MockWrapper) Scan(imageRef ImageRef) ([]Vulnerability, error)

type NoAuth

type NoAuth struct {
}

type OS

type OS struct {
	Family string `json:"Family"`
	Name   string `json:"Name"`
}

type Reference

type Reference string

type RegistryAuth

type RegistryAuth interface {
}

RegistryAuth wraps registry credentials.

type RepoTags

type RepoTags string

type Report

type Report struct {
	SchemaVersion int            `json:"SchemaVersion"`
	ArtifactName  string         `json:"ArtifactName"`
	ArtifactType  string         `json:"ArtifactType"`
	Metadata      trivy.Metadata `json:"Metadata,omitempty"`
	Results       []ScanResult   `json:"Results,omitempty"`
}

type ScanResult

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

type VersionInfo

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

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) (*trivy.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