zephyr: west spdx output SBOM files incorrect?

Hello, I am trying to generate an SBOM for my project. I followed this guide using the west spdx command. I use the zephyr workspace application setup.

west spdx --init -d
west build -b MY_BOARD -d build
west spdx --analyze-includes -d build

My output files zephyr.spdx and modules-deps.spdx are attached (I changed the file ending to json since .spdx is not supported by github) modules-deps.spdx.json zephyr.spdx.json . It seems like all project source files are scannend correctly but not mapped to the correct package. So in the end, I am missing the crucial information which components of zephyr are used and which not. E.g. I am sure to use hal_nordic, mcuboot, zcbor but they look no different in the output spdx files than all the rest.

  1. How should a correct spdx file look like such that it is possible to read the used components from it?
  2. What could go wrong in my case?

My ultimate goal is to load the spdx files to BlackDuck. But the above seems to me a neccessary step to get a correct scan.

Thanks a lot, Joanna

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 1
  • Comments: 18 (13 by maintainers)

Most upvoted comments

I’m not sure about blackduck specifically, but I think this section of the docs is relevant: https://docs.zephyrproject.org/latest/develop/modules.html#vulnerability-monitoring

Modules can specify a cpe and/or purl in the module.yml file:

security:
  external-references:
    - cpe:2.3:a:arm:mbed_tls:3.6.2:*:*:*:*:*:*:*
    - pkg:github/Mbed-TLS/mbedtls@V3.6.2

But it seems mbedtls is the only module that actually does this currently.

This issue is potentially relevant too: https://github.com/zephyrproject-rtos/zephyr/issues/53479, I’ve posted in there to see if there’s any plan to extend this to other modules.

Hello @greuljoSICKAG,

I wasn’t able to reproduce your issue. I did a quick test with the following configuration: west build -b nrf5340dk/nrf5340/cpuapp zephyr/samples/hello_world/ and the Nordic HAL files are in the correct packages (hal-nordic-sources).

Could you provide me an example to reproduce it on my end ? Can you give me:

  • a zephyr example
  • a board
  • any modification in the prj.conf (if needed)

Thanks

@tgagneret-embedded can you please chime in?

These commands are Zephyr extensions and are not related west itself. Please move this issue to the https://github.com/zephyrproject-rtos/zephyr project.

EDIT: moved to zephyr