advisory

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const CompiledIndexName = "devscan.json"

CompiledIndexName is the filename written by CompileBlocklists and given priority over raw source files during matching.

Variables

This section is empty.

Functions

func CompileBlocklists added in v0.2.2

func CompileBlocklists() (outPath string, count int, err error)

CompileBlocklists merges all raw source files into a single compiled index at compiledIndexPath() and returns a summary of what was written. It returns the output path and total entry count.

func MatchBlocklists added in v0.2.2

func MatchBlocklists(packages []schema.Package) ([]schema.Vulnerability, error)

MatchBlocklists checks the given packages against all loaded blocklist files and returns synthetic Vulnerability entries for any matches.

func ResourceDirs added in v0.2.2

func ResourceDirs() []string

ResourceDirs returns the directories that are searched for raw blocklist source files (*.csv, *.json). Earlier entries take priority.

Priority:

  1. ~/.devscan/resources/ — primary user location
  2. <executable dir>/resources/ — bundled defaults
  3. <cwd>/resources/ — dev convenience

func UpdateDB added in v0.2.7

func UpdateDB(log func(string)) (int, error)

UpdateDB fetches the latest malware databases from Aikido's public feed into ~/.devscan/resources/. The log callback receives progress messages. Returns the number of files successfully fetched.

Types

type Client

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

func NewClient

func NewClient(noCache bool) *Client

func (*Client) QueryPackages

func (c *Client) QueryPackages(packages []schema.Package) ([]schema.Vulnerability, error)

QueryPackages queries OSV for vulnerabilities across a set of packages.

type CompiledEntry added in v0.2.2

type CompiledEntry struct {
	Ecosystem string   `json:"ecosystem"`
	Name      string   `json:"name"`
	Version   string   `json:"version,omitempty"`
	Reason    string   `json:"reason,omitempty"`
	Sources   []string `json:"sources,omitempty"`
}

CompiledEntry is the on-disk schema for a compiled blocklist entry. It is also the generic JSON shape accepted by parseGenericJSON.

type OSVAdvisory added in v0.3.5

type OSVAdvisory struct {
	ID          string
	Severity    string
	Summary     string
	Details     string
	Ecosystem   string
	Package     string
	Affected    []OSVAffectedRange
	References  []string
	PublishedAt string
}

OSVAdvisory is a self-contained advisory result returned by the OSV search functions. It is richer than schema.Vulnerability because it includes the full affected version ranges and all references.

func LookupID added in v0.3.5

func LookupID(id string) (*OSVAdvisory, error)

LookupID fetches a single advisory by its OSV/CVE/GHSA ID.

func SearchByPackage added in v0.3.5

func SearchByPackage(name, ecosystem, version string, noCache bool) ([]OSVAdvisory, error)

SearchByPackage queries OSV for all advisories affecting the named package. If ecosystem is empty, all ecosystems defined in osvEcosystem are tried and results are merged. If version is non-empty, only advisories affecting that exact version are returned.

func SearchFreeText added in v0.3.5

func SearchFreeText(term, ecosystem string) ([]OSVAdvisory, error)

SearchFreeText queries OSV for each known ecosystem using the term as a package name, then filters results so that the term appears somewhere in the advisory ID, summary, details, or package name.

type OSVAffectedRange added in v0.3.5

type OSVAffectedRange struct {
	Introduced string
	Fixed      string
}

OSVAffectedRange describes one affected version range for a package.

type UserAdvisory added in v0.3.3

type UserAdvisory struct {
	Ecosystem string `yaml:"ecosystem"`
	Package   string `yaml:"package"`
	// Version may be a specific version ("1.2.3") or "*" / "" to match all versions.
	Version   string `yaml:"version"`
	Severity  string `yaml:"severity"`
	Reason    string `yaml:"reason"`
	Reference string `yaml:"reference"`
}

UserAdvisory is one entry in a .devscan/advisories.yaml file.

Jump to

Keyboard shortcuts

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