Skip to content

witnyx cache update

witnyx cache update downloads three public data sources into the cache, whatever the age of the copies already there:

  • cisa-kev: CISA’s Known Exploited Vulnerabilities catalogue;
  • enisa-euvd: the exploited vulnerabilities of ENISA’s EU Vulnerability Database, whose EUVD ID check adds to a finding that CISA’s catalogue made;
  • endoflife-date: the products and release cycles of endoflife.date.

It checks each download the way check would before it replaces the cached copy. check keeps the cache itself: it downloads a source again when its copy is at least 24 hours old. So use cache update before a check with --offline, which uses the cache only: before you take a machine offline, or to fill a cache folder that CI keeps between runs.

OSV, the database of other known vulnerabilities, has no offline copy, because check queries it live. A check with --offline is therefore always incomplete, and --offline --strict never exits 0.

The first line of the output names the cache folder, and each source then gets a line such as cisa-kev: updated, <n> vulnerabilities. The last line is always the same:

Terminal window
$ witnyx cache update
osv: not cached; OSV is queried live, so a check with --offline is incomplete and --offline --strict never exits 0.

A source that fails keeps its cached copy and gets an error line on standard error with WX-NET-KEV, WX-NET-EUVD or WX-NET-EOL. The other sources are still tried, and the exit code is 2 when any source failed.

The cache folder is --cache-dir, or the platform’s cache folder: $XDG_CACHE_HOME/witnyx when that variable is set, otherwise ~/Library/Caches/witnyx on macOS, %LOCALAPPDATA%\witnyx\cache on Windows and ~/.cache/witnyx elsewhere. witnyx version prints it, with the age of each copy. To keep the cache with the project, for example in a CI cache, give both commands the same folder:

Terminal window
witnyx cache update --cache-dir .witnyx-cache
witnyx check bom.json --offline --cache-dir .witnyx-cache

See also: Work offline and Data sources.

Usage

witnyx cache update [-hV] [--cache-dir=DIR] [--format=FORMAT] [--timeout=SECONDS]

Options

Option Value Default Description
--cache-dir DIR Cache directory for public data (default: the platform’s cache folder).
--timeout SECONDS 120 Time budget in seconds (default: 120).
-h, --help Show this help message and exit.
-V, --version Print version information and exit.
--format FORMAT With --help: text (the default) or json, a machine-readable reference.

Exit codes

Code Meaning
0 Done.
2 Could not run: a usage error, an input error or a failed download.

Witnyx is a record-keeping and workflow tool. It does not certify compliance. Nothing on this site is legal advice.