cveawg

package
v0.0.0-...-27252fe Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const API = "https://cveawg.mitre.org"

Variables

View Source
var ErrNotFound = errors.New("CVE not found")

Functions

This section is empty.

Types

type Affected

type Affected struct {
	Product  string     `json:"product"`
	Vendor   string     `json:"vendor"`
	Versions []Versions `json:"versions"`
}

type AffectedVersion

type AffectedVersion struct {
	From string `json:"from"`
	To   string `json:"to"`
}

type CVE

type CVE struct {
	Containers  Containers  `json:"containers"`
	CveMetadata CveMetadata `json:"cveMetadata"`
	DataType    string      `json:"dataType"`
	DataVersion string      `json:"dataVersion"`
}

type Client

type Client struct {
	*api.Client
}

func New

func New(options []api.ClientOption) (*Client, error)

func (*Client) FetchFromTrivyDB

func (c *Client) FetchFromTrivyDB(ctx context.Context, name string) (*TrivyCVE, error)

func (*Client) GetCVE

func (c *Client) GetCVE(ctx context.Context, name string) (*CVE, error)

type Cna

type Cna struct {
	Affected     []Affected    `json:"affected"`
	DatePublic   string        `json:"datePublic"`
	Descriptions []Description `json:"descriptions"`
	References   []References  `json:"references"`
	Title        string        `json:"title"`
}

type Containers

type Containers struct {
	Cna Cna `json:"cna"`
}

type CveMetadata

type CveMetadata struct {
	AssignerOrgID     string `json:"assignerOrgId"`
	AssignerShortName string `json:"assignerShortName"`
	CveID             string `json:"cveId"`
	DatePublished     string `json:"datePublished"`
	DateReserved      string `json:"dateReserved"`
	DateUpdated       string `json:"dateUpdated"`
	State             string `json:"state"`
}

type Cvss

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

type Description

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

type FixedVersion

type FixedVersion struct {
	Fixed string `json:"fixed"`
}

type Impact

type Impact struct {
	Cvss Cvss `json:"cvss"`
}

type References

type References struct {
	Name string   `json:"name,omitempty"`
	Tags []string `json:"tags"`
	URL  string   `json:"url"`
}

type TrivyCVE

type TrivyCVE struct {
	ID              string            `json:"id"`
	CreatedAt       time.Time         `json:"created_at"`
	Summary         string            `json:"summary"`
	Component       string            `json:"component"`
	Description     string            `json:"description"`
	AffectedVersion []AffectedVersion `json:"affected_version"`
	FixedVersion    []FixedVersion    `json:"fixed_version"`
	Urls            []string          `json:"urls"`
	Cvss            string            `json:"cvss"`
	Severity        string            `json:"severity"`
	Score           float64           `json:"score"`
}

type Versions

type Versions struct {
	Status   string `json:"status"`
	Version  string `json:"version"`
	LessThan string `json:"lessThan"`
}

Jump to

Keyboard shortcuts

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