This layer integrates the sbom-cve-check utility into Yocto builds. It allows you to run the CVE analysis on the SPDX Software Bill of Materials (SBOM) generated by Yocto.
- Provides
sbom-cve-checkas a native build-time utility - Adds optionally a
do_sbom_cve_checkBitBake task that:- Run the CVE analysis on generated SBOM,
- Deploys export files into the image deploy directory.
- Yocto / OpenEmbedded build environment
- This layer is included in bblayers.conf
To run sbom-cve-check from Yocto sysroot:
- Clone and include this layer in your
bblayers.conf:
$ git clone https://github.com/bootlin/meta-sbom-cve-check.git layers/meta-sbom-cve-check
- Build the native tool:
bitbake python3-sbom-cve-check-native -caddto_recipe_sysroot
- Run the tool like that, for example, to see the help:
oe-run-native python3-sbom-cve-check-native sbom-cve-check --help
- Yocto / OpenEmbedded build environment
- This layer is included in bblayers.conf
- The
vexclass needs to be enabled globally - Currently only SPDX3 is supported by the
sbom-cve-checkclass - On Scarthgap: SPDX2.2 needs to be disabled and SPDX3 enabled
To run a CVE analysis on the built image:
-
Clone and include this layer in your
bblayers.conf. -
Enable the
vexclass globally, typically in yourlocal.conf:
INHERIT += "vex"
- Enable
sbom-cve-checkclass from your image recipe:
inherit sbom-cve-check
- Optionally configure CVE analysis by using the following variables:
-
SBOM_CVE_CHECK_EXTRA_ARGS: Allow to specify extra arguments tosbom-cve-check. For example to add filtering options. -
SBOM_CVE_CHECK_EXPORT_VARS: List of variables that declare export files to generate. By default equal toSBOM_CVE_CHECK_EXPORT_FILE.Each variable must have the following flags set:
[type]: The type of export, which corresponds to the value set to the--export-typeoption flag (e.g.,csvorspdx3).[ext]: The file extension of the exported file that is going to be generated.
-
SBOM_CVE_CHECK_EXPORT_FILE: Default export file configuration. The[type]flag is set by default tospdx3, and the[ext]flag is set by default to.cve-check.spdx.json.
-
Build your target image.
The resulting exported file, which is an SPDX3 file, will be available in the deploy directory, with this default name:
${IMAGE_NAME}.cve-check.spdx.json
For issues or contributions, please open an issue or pull request on GitHub.