epss

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package epss contains data models and the service for cross referencing vulnerabilities with EPSS scores.

Index

Constants

View Source
const DefaultBaseURL = "https://epss.cyentia.com"

DefaultBaseURL for EPSS FIRST API

Variables

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

ErrAPI errors in EPSS API requests

Functions

This section is empty.

Types

type APIAgent added in v0.1.0

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

APIAgent performs the actual API query

func NewAgent added in v0.1.0

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

NewAgent used to customize the client and API URL

func (*APIAgent) Read added in v0.1.0

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

Read standard io.Reader implementation wrapped in a API request and gunzip.

Any errors from the request will be returned during read. This is to provide a common interface between API request and file based reading in the Service

type CVE

type CVE struct {
	ID          string
	Severity    string
	Link        string
	ScoreDate   time.Time
	Probability float64
	Percentile  float64
}

CVE data model

type Scores added in v0.1.0

type Scores struct {
	EPSS       string
	Percentile string
}

Scores data model for EPSS result

type Service

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

Service used to perform EPSS API request or decoding from a file

func NewService added in v0.1.0

func NewService(r io.Reader) *Service

NewService initializes internal structures, and lazily assigns reader.

func (*Service) Fetch added in v0.1.0

func (s *Service) Fetch() error

Fetch uses the internal reader to fill the internal dataStore

func (*Service) GetCVE added in v0.1.0

func (s *Service) GetCVE(match models.Match) (CVE, error)

GetCVE returns a score corresponding to a single match

func (*Service) GetCVEs added in v0.1.0

func (s *Service) GetCVEs(matches []models.Match) ([]CVE, error)

GetCVEs returns scores corresponding to each match

func (*Service) GrypeAllowRuleFunc added in v0.1.0

func (s *Service) GrypeAllowRuleFunc() func(models.Match, grype.Config) bool

GrypeAllowRuleFunc returns the function used for allow rule cross referenced with internal service data store

func (*Service) GrypeDenyRuleFunc added in v0.1.0

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

GrypeDenyRuleFunc returns the function used as a deny rule cross referenced with service data store

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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