grype

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package grype defines data model, Config, Decoder, Validator, and validation rules for Anchore Grype vulnerability reports.

Index

Constants

View Source
const ConfigFieldName = "grype"

ConfigFieldName ...

View Source
const ReportType = "Anchore Grype Scan Report"

ReportType the Grype Type plain text

Variables

This section is empty.

Functions

func AllowListRule

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

AllowListRule allow vulnerabilities in custom allow list

func DenyListRule

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

DenyListRule reject vulnerabilities in custom deny list

func NewReportDecoder

func NewReportDecoder() *gce.JSONWriterDecoder[ScanReport]

NewReportDecoder ...

func NewValidator

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

NewValidator ...

func ThresholdRule

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

ThresholdRule will error if there are more vulnerabilities in X severity

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"`
}

Config data model for grype thresholds configuration

type ListItem

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

ListItem for Allow/Deny list

type ScanReport

type ScanReport models.Document

ScanReport data model for grype reports aliased from grype code base

func (*ScanReport) String

func (r *ScanReport) String() string

String ...

Jump to

Keyboard shortcuts

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