nvd

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIResponse

type APIResponse struct {
	ResultsPerPage  int             `json:"resultsPerPage"`
	StartIndex      int             `json:"startIndex"`
	TotalResults    int             `json:"totalResults"`
	Format          string          `json:"format"`
	Version         string          `json:"version"`
	Timestamp       string          `json:"timestamp"`
	Vulnerabilities []Vulnerability `json:"vulnerabilities"`
}

type CVE

type CVE struct {
	ID               string        `json:"id"`
	SourceIdentifier string        `json:"sourceIdentifier"`
	Published        string        `json:"published"`
	LastModified     string        `json:"lastModified"`
	VulnStatus       string        `json:"vulnStatus"`
	Descriptions     []Description `json:"descriptions"`
	Metrics          Metric        `json:"metrics"`
	Weaknesses       []Weakness    `json:"weaknesses"`
	References       []Reference   `json:"references"`
}

type CvssData

type CvssData struct {
	Version               string  `json:"version"`
	VectorString          string  `json:"vectorString"`
	AttackVector          string  `json:"attackVector"`
	AttackComplexity      string  `json:"attackComplexity"`
	PrivilegesRequired    string  `json:"privilegesRequired"`
	UserInteraction       string  `json:"userInteraction"`
	Scope                 string  `json:"scope"`
	ConfidentialityImpact string  `json:"confidentialityImpact"`
	IntegrityImpact       string  `json:"integrityImpact"`
	AvailabilityImpact    string  `json:"availabilityImpact"`
	BaseScore             float64 `json:"baseScore"`
	BaseSeverity          string  `json:"baseSeverity"`
}

type CvssMetricV31

type CvssMetricV31 struct {
	Source              string   `json:"source"`
	Type                string   `json:"type"`
	CvssData            CvssData `json:"cvssData"`
	ExploitabilityScore float64  `json:"exploitabilityScore"`
	ImpactScore         float64  `json:"impactScore"`
}

type Description

type Description struct {
	Lang  string `json:"lang"`
	Value string `json:"value"`
}

type Metric

type Metric struct {
	CvssMetricV31 []CvssMetricV31 `json:"cvssMetricV31"`
}

type NVDClient

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

func NewClient

func NewClient(c NVDConfig, inclFilters, exclFilters []string) *NVDClient

func (*NVDClient) Do

func (c *NVDClient) Do(req *http.Request) (*http.Response, error)

func (*NVDClient) FilterCVEs

func (n *NVDClient) FilterCVEs(v []Vulnerability) []CVE

func (*NVDClient) Get

func (c *NVDClient) Get(url string) (resp *http.Response, err error)

type NVDConfig

type NVDConfig struct {
	NvdApiKey      string   `json:"nvd_api_key"`
	CveSeverities  string   `json:"cve_severities"`
	IncludeFilters []string `json:"include_filters"`
	ExcludeFilters []string `json:"exclude_filters"`
}

func DefaultConfig

func DefaultConfig() NVDConfig

func (*NVDConfig) Parameters

func (config *NVDConfig) Parameters() []cli.Flag

func (*NVDConfig) Validate

func (config *NVDConfig) Validate() error

type Reference

type Reference struct {
	URL    string   `json:"url"`
	Source string   `json:"source"`
	Tags   []string `json:"tags,omitempty"`
}

type Vulnerability

type Vulnerability struct {
	CVE CVE `json:"cve"`
}

type Weakness

type Weakness struct {
	Source      string        `json:"source"`
	Type        string        `json:"type"`
	Description []Description `json:"description"`
}

Jump to

Keyboard shortcuts

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