gcve

package
v0.0.27-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2026 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Overview

Package gcve provides functionality to synchronize vulnerability data from CIRCL's vulnerability-lookup service (GCVE/CVE data). Uses NDJSON bulk dumps for initial load and incremental API for updates.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Update

func Update(db *bun.DB, db_config *bun.DB) error

Update synchronizes GCVE/CVE data from vulnerability-lookup. Uses bulk dump for initial load, incremental API for subsequent updates.

func UseUpstream

func UseUpstream(bulk, enrichment, window string) (restore func())

UseUpstream points the mirror at other dump, enrichment and update window URLs, without pausing between window requests, and returns a function that undoes it.

Types

type ADPContainer

type ADPContainer struct {
	ProviderMetadata struct {
		OrgId     string `json:"orgId"`
		ShortName string `json:"shortName"`
	} `json:"providerMetadata"`
	Title    string            `json:"title,omitempty"`
	Affected []RawAffected     `json:"affected,omitempty"`
	Metrics  []json.RawMessage `json:"metrics,omitempty"`
}

type CNAContainer

type CNAContainer struct {
	Affected     []json.RawMessage           `json:"affected"`
	Descriptions []knowledge.GCVEDescription `json:"descriptions"`
	Metrics      []json.RawMessage           `json:"metrics"`
	ProblemTypes []knowledge.GCVEProblemType `json:"problemTypes"`
	References   []knowledge.GCVEReference   `json:"references"`
}

type CVERecordRaw

type CVERecordRaw struct {
	DataType    string `json:"dataType"`
	DataVersion string `json:"dataVersion"`
	CveMetadata struct {
		CveId             string `json:"cveId"`
		AssignerOrgId     string `json:"assignerOrgId"`
		AssignerShortName string `json:"assignerShortName"`
		State             string `json:"state"`
		DateReserved      string `json:"dateReserved"`
		DatePublished     string `json:"datePublished"`
		DateUpdated       string `json:"dateUpdated"`
	} `json:"cveMetadata"`
	Containers struct {
		CNA json.RawMessage   `json:"cna"`
		ADP []json.RawMessage `json:"adp"`
	} `json:"containers"`
}

CVERecordRaw represents the raw JSON structure from the NDJSON dump.

type RawAffected

type RawAffected struct {
	Vendor        string                  `json:"vendor"`
	Product       string                  `json:"product"`
	DefaultStatus string                  `json:"defaultStatus,omitempty"`
	Versions      []knowledge.GCVEVersion `json:"versions"`
	Platforms     []string                `json:"platforms,omitempty"`
}

Jump to

Keyboard shortcuts

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