intel

package
v0.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package intel provides vulnerability intelligence: it matches a software bill of materials (packages + versions) against known-vulnerability databases. The default source is OSV.dev, which aggregates NVD, the GitHub Advisory Database, RustSec, PyPA, the Go vuln DB and more. An offline snapshot can be added later behind the same DB interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	// Query returns the vulns affecting each input package, aligned by index.
	Query(ctx context.Context, pkgs []Package) ([][]Vuln, error)
	// Source names the data source, for provenance.
	Source() string
}

DB is a source of vulnerability intelligence. Live (OSV API) and offline (snapshot) implementations satisfy it.

type Enricher added in v0.4.3

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

Enricher adds exploitation signals to vulns: CISA KEV (observed in-the-wild exploitation) and FIRST EPSS (probability of exploitation in the next 30 days). It is best-effort: any network or parse failure leaves vulns unchanged rather than failing the scan, matching the rest of the intel layer.

func NewEnricher added in v0.4.3

func NewEnricher() *Enricher

NewEnricher returns an Enricher backed by the live feeds (disk-cached).

func (*Enricher) Enrich added in v0.4.3

func (e *Enricher) Enrich(ctx context.Context, vulns []*Vuln)

Enrich resolves each vuln's CVE and attaches KEV and EPSS signals in place. Vulns without a CVE are left untouched.

func (*Enricher) Source added in v0.4.3

func (e *Enricher) Source() string

Source summarizes the feeds used, for provenance.

type OSV

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

OSV queries the live OSV.dev API.

func NewOSV

func NewOSV() *OSV

NewOSV returns a client for the live OSV.dev API.

func (*OSV) Query

func (o *OSV) Query(ctx context.Context, pkgs []Package) ([][]Vuln, error)

Query batches the packages to OSV's querybatch endpoint, then fetches the details for each returned id (cached) and extracts severity and fix.

func (*OSV) Source

func (*OSV) Source() string

type Package

type Package struct {
	Ecosystem string // OSV ecosystem: npm, Go, PyPI, Maven, Packagist, crates.io, RubyGems, NuGet
	Name      string
	Version   string
	PURL      string // package URL, for display/provenance
	File      string // the manifest/lockfile it came from (repo-relative)
}

Package is one component of a bill of materials, in OSV terms.

type Vuln

type Vuln struct {
	ID       string   `json:"id"`
	Aliases  []string `json:"aliases,omitempty"`
	Summary  string   `json:"summary,omitempty"`
	Severity string   // normalized: Critical | High | Medium | Low | Unknown
	Fixed    string   // first fixed version for the queried package, if known
	Ref      string   // a canonical reference URL

	// Exploitation intelligence, filled by an Enricher (CISA KEV + FIRST EPSS).
	CVE        string  // canonical CVE id resolved from ID/Aliases, if any
	KEV        bool    // listed in the CISA Known Exploited Vulnerabilities catalog
	Ransomware bool    // KEV: known use in ransomware campaigns
	EPSS       float64 // FIRST EPSS exploitation probability, 0..1
	EPSSPctl   float64 // EPSS percentile among all scored CVEs, 0..1
}

Vuln is a known vulnerability affecting a package.

func (Vuln) CVEID added in v0.4.3

func (v Vuln) CVEID() string

CVEID returns the canonical CVE identifier for the vuln: its own ID if it is a CVE, otherwise the first CVE alias. Empty when no CVE is associated.

Directories

Path Synopsis
Package stack detects a target's technology stack — languages, frameworks, runtimes — from a repo's manifests and from a running app's fingerprint findings.
Package stack detects a target's technology stack — languages, frameworks, runtimes — from a repo's manifests and from a running app's fingerprint findings.

Jump to

Keyboard shortcuts

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