Skip to content

Work offline

witnyx check reads a software bill of materials (SBOM) and looks up its components in public data sources. Three of them are lists it keeps in a local cache: CISA’s Known Exploited Vulnerabilities catalogue, which makes a vulnerability actively exploited; ENISA’s list of exploited vulnerabilities, which only adds its EUVD ID to a vulnerability that CISA’s catalogue lists; and endoflife.date. The fourth, OSV, is queried live for the known vulnerabilities of each package, and it has no offline copy.

On this page you fill the cache, check how old it is, and run the check with --offline, for example on a build machine without network access.

On a machine with network access, run witnyx cache update. It downloads the three lists, whatever the age of the copies already cached, and prints the cache folder, one line per list with the number of entries it holds, and a note on OSV:

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.

The cache folder is --cache-dir when you give it. Otherwise it is $XDG_CACHE_HOME/witnyx when that variable is set, else ~/Library/Caches/witnyx on macOS, %LOCALAPPDATA%\witnyx\cache on Windows, and ~/.cache/witnyx elsewhere. Give cache update and check the same --cache-dir, or neither.

Each list is checked before it is saved. A list that cannot be downloaded keeps its old copy, and cache update tries the others, prints an error for the failed one on standard error, and exits with code 2.

witnyx version prints the cache folder and the age of each cached list. In an empty cache, every list is not cached:

Terminal window
$ witnyx version
cisa-kev: not cached
enisa-euvd: not cached
endoflife-date: not cached

After cache update, each line gives the copy’s age instead: less than an hour old, then in hours up to 48 hours, then in days. The age is the modification time of the file in the cache folder. If you copy the folder to another machine, use a tool that keeps modification times.

--offline uses the cached copies only, whatever their age. It sends no request: OSV is not queried, and a securityTxtUrl is not fetched.

Without OSV, Witnyx cannot tell which vulnerabilities affect your components. So an offline check finds no actively exploited and no other known vulnerabilities, and it is always incomplete. It still checks end of life with the cached endoflife.date copy, the quality of the SBOM, and the SECURITY.md and .well-known/security.txt files in the repository.

This run had an empty cache, so the headline also names CISA’s list, and the two optional lists add notes:

Terminal window
$ witnyx check bom.json --offline
[INCOMPLETE] 3 components not checked (osv: offline mode; cisa-kev: No cached CISA KEV data available for offline use)
Note: enisa-euvd: No cached ENISA data available for offline use; exploited findings are shown without the ENISA tag
Note: endoflife-date: No cached end-of-life data available for offline use; end-of-life check skipped

After cache update, the headline names only osv: offline mode, and the notes are gone. In the JSON report, dataSources lists each cached list with the status cached and its age in ageHours.

An offline check is incomplete, so with --strict it never exits with code 0. It exits with code 2, or with code 1 when a failure rule triggers, for example --fail-on eol with a component past its end of life:

Terminal window
$ witnyx check bom.json --offline --strict
[INCOMPLETE] 3 components not checked (osv: offline mode; cisa-kev: No cached CISA KEV data available for offline use)

In an offline pipeline, leave out --strict: with it, every run ends with exit code 2 or 1. Choose when the build fails explains incomplete checks.

See also: keeping the cache between CI runs in GitHub Actions, GitLab CI, Jenkins and Docker.

What you see What to do
No cached CISA KEV data available for offline use Run witnyx cache update with network access, with the same --cache-dir as the check.
cisa-kev: not cached in witnyx version after an update version and cache update read different cache folders. Give both the same --cache-dir.
An error line from cache update, such as WX-NET-KEV, and exit code 2 That list was not updated; its old copy, if any, is kept. Run witnyx cache update again later.
An offline check with no vulnerabilities That is expected: vulnerabilities need OSV. Run the check online before a release.

Privacy lists what an online check sends to each source.

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