types

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: Apache-2.0 Imports: 6 Imported by: 123

Documentation

Index

Constants

View Source
const (
	// VulnTypeUnknown is a vulnerability type of unknown
	VulnTypeUnknown = VulnType("unknown")

	// VulnTypeOS is a vulnerability type of OS packages
	VulnTypeOS = VulnType("os")

	// VulnTypeLibrary is a vulnerability type of programming language dependencies
	VulnTypeLibrary = VulnType("library")

	// SecurityCheckUnknown is a security check of unknown
	SecurityCheckUnknown = SecurityCheck("unknown")

	// SecurityCheckVulnerability is a security check of vulnerabilities
	SecurityCheckVulnerability = SecurityCheck("vuln")
)

Variables

This section is empty.

Functions

func GetDockerOption

func GetDockerOption(timeout time.Duration) (types.DockerOption, error)

GetDockerOption returns the Docker scanning options using DockerConfig

Types

type BySeverity added in v0.13.0

type BySeverity []DetectedVulnerability

BySeverity implements sort.Interface based on the Severity field.

func (BySeverity) Len added in v0.13.0

func (v BySeverity) Len() int

Len returns the length of DetectedVulnerabilities

func (BySeverity) Less added in v0.13.0

func (v BySeverity) Less(i, j int) bool

Less compares 2 DetectedVulnerabilities based on package name, severity and vulnerabilityID

func (BySeverity) Swap added in v0.13.0

func (v BySeverity) Swap(i, j int)

Swap swaps 2 vulnerability

type DetectedVulnerability added in v0.2.0

type DetectedVulnerability struct {
	VulnerabilityID  string       `json:",omitempty"`
	PkgName          string       `json:",omitempty"`
	InstalledVersion string       `json:",omitempty"`
	FixedVersion     string       `json:",omitempty"`
	Layer            ftypes.Layer `json:",omitempty"`
	SeveritySource   string       `json:",omitempty"`
	PrimaryURL       string       `json:",omitempty"`

	types.Vulnerability
}

DetectedVulnerability holds the information of detected vulnerabilities

type DockerConfig

type DockerConfig struct {
	UserName      string `env:"TRIVY_USERNAME"`
	Password      string `env:"TRIVY_PASSWORD"`
	RegistryToken string `env:"TRIVY_REGISTRY_TOKEN"`
	Insecure      bool   `env:"TRIVY_INSECURE" envDefault:"false"`
	NonSSL        bool   `env:"TRIVY_NON_SSL" envDefault:"false"`
}

DockerConfig holds the config of Docker

type Library

type Library struct {
	Name    string
	Version string
}

Library holds the attribute of a package library

type ScanOptions

type ScanOptions struct {
	VulnType            []string
	SecurityChecks      []string
	ScanRemovedPackages bool
	ListAllPackages     bool
	SkipFiles           []string
	SkipDirs            []string
}

ScanOptions holds the attributes for scanning vulnerabilities

type SecurityCheck added in v0.18.2

type SecurityCheck = string

SecurityCheck represents the type of security check

func NewSecurityCheck added in v0.18.2

func NewSecurityCheck(s string) SecurityCheck

NewSecurityCheck returns an instance of SecurityCheck

type VulnType added in v0.18.2

type VulnType = string

VulnType represents vulnerability type

func NewVulnType added in v0.18.2

func NewVulnType(s string) VulnType

NewVulnType returns an instance of VulnType

Jump to

Keyboard shortcuts

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