cla sbom - SBOM Scans and Local Vulnerability Database
cla sbom: downloads, updates and loads the local copy of the OSV vulnerability database used by the
SBOM scans in local mode. The Admin > System > SBOM page runs the same tasks; the command is
handy to schedule the updates with cron or to load the files by hand.
| Command | Description |
|---|---|
cla sbom-status |
The ecosystems loaded, with their number of records and last update |
cla sbom-download --ecosystems Maven,npm |
Downloads the full dump of each ecosystem and loads it |
cla sbom-update [--ecosystems Maven] |
Fetches the records changed since the last load (every loaded ecosystem by default) |
cla sbom-load --file all.zip |
Loads a dump downloaded elsewhere; the ecosystem is read from its records |
cla sbom-scan --repo <name or mid> [--ref <branch, tag or commit>] |
Generates and scans the SBOM of a repository |
cla sbom-scan --path <dir> --project <name or mid> |
Generates and scans the SBOM of a directory of the server |
sbom-download and sbom-update need the server to reach https://storage.googleapis.com/osv-vulnerabilities.
Without it, download the all.zip files on a workstation and load them with sbom-load or from the admin page.
sbom-scan¶
The report goes to a project: the one of --project, which must be associated to the repository when --repo is
given too, or else every project of the repository. A Git repository is analyzed at its default branch, or at
--ref; a directory can be tied to a repository with --repo, its report then replaces the one of the repository.
| Option | Description |
|---|---|
--repo |
Repository, by name or mid (the mid when several share the name) |
--ref |
Branch, tag or commit of a Git repository |
--path |
Directory or manifest file to analyze instead of the repository |
--project |
Project of the report, by name or mid |
--name, --version |
Name and version of the application in the SBOM |
--no-scan |
Generate the SBOM only, without looking for vulnerabilities |
--fail-on CRITICAL\|HIGH\|MEDIUM\|LOW |
Exit with code 2 when there are vulnerabilities of that severity or higher |
--exclude-packages |
Private packages, never sent to the vulnerability database, added to the global and project ones |
--output |
File where the CycloneDX document is written |
cla sbom-scan --repo GitRepository-26 --ref release/2.1 --fail-on CRITICAL -c myconfig cla sbom-scan --path /data/build/foo --project Foo --name foo-app --version 2.1 --output foo-sbom.json -c myconfig
A daily update from cron:
0 5 * * * cd /opt/clarive/clarive && bin/cla sbom-update -c myconfig >> /opt/clarive/logs/sbom-update.log 2>&1