A Zephyr SBOM with west spdx, checked for CVEs after you ship

Zephyr can describe its own build in SPDX: the kernel, the modules and the files compiled into your image. Here is how to produce it, what to check it against, and how to keep doing that for releases already in the field.

Generate the SPDX documents

west spdx --init -d build                 # before the build, once per build directory
west build -b <board> app -- -DCONFIG_BUILD_OUTPUT_META=y
west spdx -d build                        # writes build/spdx/app.spdx, zephyr.spdx, build.spdx

zephyr.spdx describes the Zephyr sources and modules that went into the image, app.spdx your application, and build.spdx how they were combined. CONFIG_BUILD_OUTPUT_META records the module revisions so the versions in the SBOM are exact.

What to check, and how often

Zephyr publishes its own security advisories, and the modules you use (mbedTLS, MCUboot, the HAL of your vendor, littlefs) have CVEs of their own in the NVD. A check at build time sees today's list. Devices shipped with that release need the same check every time the list changes, which is what the CRA asks for during the support period.

Keep every release checked

Upload the signed image and its SBOM together, from CI or from the Security tab:

curl -fsSL https://pinscope.dev/ci.sh | sh -s -- build/zephyr/zephyr.signed.bin --sbom build/spdx/zephyr.spdx

Pinscope checks each uploaded release against the NVD and the CISA exploited list daily, emails you about new matches, records your decision on each CVE, and shows which devices run an affected release. With the Pinscope module in the firmware, the fix goes out by OTA through MCUboot in waves that stop at the first failure. See remote logging and OTA for Zephyr.

Try it

Three devices are free, and no card is needed. Create an account, or read the guide for your platform: ESP32, Zephyr, Raspberry Pi Pico, Linux, ESP8266.

More