kev

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: 11 Imported by: 0

Documentation

Index

Constants

View Source
const CVERecordURL = "https://www.cve.org/CVERecord?id=%s"
View Source
const DefaultBaseURL = "https://www.cisa.gov/sites/default/files/feeds/known_exploited_vulnerabilities.json"
View Source
const FileTypeJSON = "CISA KEV Catalog [JSON]"

Variables

View Source
var ErrAPI = errors.New("KEV API error")

Functions

func NewJSONDecoder

func NewJSONDecoder() *gce.JSONWriterDecoder[Catalog]

Types

type APIAgent

type APIAgent struct {
	// contains filtered or unexported fields
}

func NewAgent

func NewAgent(client *http.Client, url string) *APIAgent

func (*APIAgent) Read

func (a *APIAgent) Read(p []byte) (int, error)

type Catalog

type Catalog struct {
	Title           string          `json:"title"`
	CatalogVersion  string          `json:"catalogVersion"`
	DateReleased    time.Time       `json:"dateReleased"`
	Count           int             `json:"count"`
	Vulnerabilities []Vulnerability `json:"vulnerabilities"`
}

type Service

type Service struct {
	// contains filtered or unexported fields
}

func NewService

func NewService(r io.Reader) *Service

func (*Service) Catalog

func (s *Service) Catalog() Catalog

func (*Service) Fetch

func (s *Service) Fetch() error

func (*Service) GrypeDenyRuleFunc

func (s *Service) GrypeDenyRuleFunc() func([]models.Match, grype.Config) error

func (*Service) MatchedVulnerabilities

func (s *Service) MatchedVulnerabilities(r *grype.ScanReport) []models.Match

func (*Service) NewValidator

func (s *Service) NewValidator() gcv.Validator[models.Match, grype.Config]

type Vulnerability

type Vulnerability struct {
	CveID             string `json:"cveID"`
	VendorProject     string `json:"vendorProject"`
	Product           string `json:"product"`
	VulnerabilityName string `json:"vulnerabilityName"`
	DateAdded         string `json:"dateAdded"`
	ShortDescription  string `json:"shortDescription"`
	RequiredAction    string `json:"requiredAction"`
	DueDate           string `json:"dueDate"`
	Notes             string `json:"notes"`
}

Jump to

Keyboard shortcuts

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