grype

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ConfigFieldName = "grype"
View Source
const ReportType = "Anchore Grype Scan Report"

Variables

This section is empty.

Functions

func AllowListRule

func AllowListRule(match models.Match, config Config) bool

func DenyListRule

func DenyListRule(matches []models.Match, config Config) error

func NewReportDecoder

func NewReportDecoder() *gce.JSONWriterDecoder[ScanReport]

func NewValidator

func NewValidator() gcv.Validator[models.Match, Config]

func ThresholdRule

func ThresholdRule(matches []models.Match, config Config) error

Types

type Config

type Config struct {
	AllowList          []ListItem `yaml:"allowList,omitempty" json:"allowList,omitempty"`
	DenyList           []ListItem `yaml:"denyList,omitempty" json:"denyList,omitempty"`
	EPSSAllowThreshold float64    `yaml:"epssAllowThreshold,omitempty" json:"epssAllowThreshold,omitempty"`
	EPSSDenyThreshold  float64    `yaml:"epssDenyThreshold,omitempty" json:"epssDenyThreshold,omitempty"`
	Critical           int        `yaml:"critical"   json:"critical"`
	High               int        `yaml:"high"       json:"high"`
	Medium             int        `yaml:"medium"     json:"medium"`
	Low                int        `yaml:"low"        json:"low"`
	Negligible         int        `yaml:"negligible" json:"negligible"`
	Unknown            int        `yaml:"unknown"    json:"unknown"`
}

type ListItem

type ListItem struct {
	Id     string `yaml:"id"     json:"id"`
	Reason string `yaml:"reason" json:"reason"`
}

type ScanReport

type ScanReport models.Document

func (*ScanReport) String

func (r *ScanReport) String() string

Jump to

Keyboard shortcuts

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