result

package
v0.46.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2023 License: Apache-2.0 Imports: 23 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// DefaultIgnoreFile is the file name to be evaluated
	DefaultIgnoreFile = ".trivyignore"
)

Variables

This section is empty.

Functions

func Filter added in v0.29.0

func Filter(ctx context.Context, report types.Report, opt FilterOption) error

Filter filters out the report

func FilterResult added in v0.41.0

func FilterResult(ctx context.Context, result *types.Result, ignoreConf IgnoreConfig, opt FilterOption) error

FilterResult filters out the result

Types

type FilterOption added in v0.41.0

type FilterOption struct {
	Severities         []dbTypes.Severity
	IgnoreStatuses     []dbTypes.Status
	IncludeNonFailures bool
	IgnoreFile         string
	PolicyFile         string
	IgnoreLicenses     []string
	VEXPath            string
}

type IgnoreConfig added in v0.45.0

type IgnoreConfig struct {
	Vulnerabilities   IgnoreFindings `yaml:"vulnerabilities"`
	Misconfigurations IgnoreFindings `yaml:"misconfigurations"`
	Secrets           IgnoreFindings `yaml:"secrets"`
	Licenses          IgnoreFindings `yaml:"licenses"`
}

IgnoreConfig represents the structure of .trivyignore.yaml.

type IgnoreFinding added in v0.45.0

type IgnoreFinding struct {
	// ID is the identifier of the vulnerability, misconfiguration, secret, or license.
	// e.g. CVE-2019-8331, AVD-AWS-0175, etc.
	// required: true
	ID string `yaml:"id"`

	// Paths is the list of file paths to be ignored.
	// If Paths is not set, the ignore finding is applied to all files.
	// required: false
	Paths []string `yaml:"paths"`

	// ExpiredAt is the expiration date of the ignore finding.
	// If ExpiredAt is not set, the ignore finding is always valid.
	// required: false
	ExpiredAt time.Time `yaml:"expired_at"`

	// Statement describes the reason for ignoring the finding.
	// required: false
	Statement string `yaml:"statement"`
}

IgnoreFinding represents an item to be ignored.

type IgnoreFindings added in v0.45.0

type IgnoreFindings []IgnoreFinding

func (*IgnoreFindings) Filter added in v0.45.0

func (f *IgnoreFindings) Filter()

func (*IgnoreFindings) Match added in v0.45.0

func (f *IgnoreFindings) Match(path, id string) bool

Jump to

Keyboard shortcuts

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