VulnCheck.Feeds.Store (VulnCheck v1.0.1)

Copy Markdown View Source

Facade of Stage 2: returns the enriched advisories that affect the locked packages of a workspace.

  1. Imports --bundle archives into the cache (air-gapped CI).
  2. Loads the OSV Hex archive and keeps only advisories whose package is locked at an affected version.
  3. Enriches those matches (and only those) with EEF CNA CVE 5.1 records, four at a time.
  4. Falls back to strict backtick signatures from the advisory text when no structured symbol data exists.
  5. Adds Hex.pm retirement advisories (unless check_retired is off) and mix.lock hygiene warnings.

Summary

Functions

Like match_workspace/3 but also returns warnings and feed statistics.

Filters an advisory index down to the advisories affecting locked packages. The advisory package is rewritten to the lockfile key.

Returns the advisories affecting the workspace.

Types

result()

@type result() :: %{
  advisories: [VulnCheck.Types.Advisory.t()],
  warnings: [String.t()],
  stats: map()
}

Functions

load(workspace, config, opts \\ [])

@spec load(VulnCheck.Types.Workspace.t(), VulnCheck.Config.t(), keyword()) ::
  {:ok, result()} | {:error, term()}

Like match_workspace/3 but also returns warnings and feed statistics.

Options: :http_client, :osv_url, :cna_base_url, :mitre_base_url, :hex_api_url, :enrich (default true) and :retired (default config.check_retired).

match(index, workspace)

Filters an advisory index down to the advisories affecting locked packages. The advisory package is rewritten to the lockfile key.

match_workspace(workspace, config, opts \\ [])

@spec match_workspace(VulnCheck.Types.Workspace.t(), VulnCheck.Config.t(), keyword()) ::
  {:ok, [VulnCheck.Types.Advisory.t()]} | {:error, term()}

Returns the advisories affecting the workspace.