-
Notifications
You must be signed in to change notification settings - Fork 6.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
west spdx output SBOM files incorrect? #82838
Comments
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 |
Hi @greuljoSICKAG! We appreciate you submitting your first issue for our open-source project. 🌟 Even though I'm a bot, I can assure you that the whole community is genuinely grateful for your time and effort. 🤖💙 |
@greuljoSICKAG just to be sure, you did enable ``CONFIG_BUILD_OUTPUT_META`, yes? |
Thanks for the reply. |
@tgagneret-embedded can you please chime in? |
Hello @greuljoSICKAG, I wasn't able to reproduce your issue. I did a quick test with the following configuration: Could you provide me an example to reproduce it on my end ? Can you give me:
Thanks |
The $ west spdx --init -d build
$ west build -p -b MY_BOARD -d build -- -DCONFIG_BUILD_OUTPUT_META=y
$ west spdx -d build Currently the |
@greuljoSICKAG please let us know if there is anything else we can do to help, and/or please close the issue if the input provided by @pdgendt and @tgagneret-embedded helped you solve the issue. |
Hello and thanks for the reply. I got one step further. My SBOM now only lists the packages which I actually use.
However, there are problems with finding the license. All I get is NOASSERTION for the licenses of the packages. (See zephyr.spdx.json for the entire SBOM)
Could this be due to the fact that Nordic has its own fork of Zephyr, the nRFConnectSDK? And that somehow references to nRFConnectSDK cannot be found the the west-spdx-command of the original Zephyr? I find all the git-hashes of the used packages in this overview and they all point to the nRFConnectSDK. |
Yes, only the compiled files are present in the SBOM. For the license, I had a quick look at the code, it seems that it needs SPDX license at the beginning of the file (https://spdx.dev/learn/handling-license-info/). Zephyr RTOS has the correct syntax, but modules don't necessary use this syntax. An example: Line 4 in 4e201f2
|
Hi again, thanks for your replies. First:The part about the license makes sense. I guess that is up to the components to use that syntax for their license. So okay, I can look up the licenses "by hand" for now. Second:I reproduced my issue for the zephyr sample basic/blinky on board nrf52833dk_nrf52833. Go from zephyr-workspace to zephyr/samples/basic/blinky and execute:
You get output files zephyr.spdx, build.spdx, modules-deps.spdx, app.spdx Third:I tried to load those outputs from the blinky sample into BlackDuck. The scan does not find the components and I already found the following two problems why this is. Problem1:
PackageName: zephyr-sources BlackDuck indicates that the ExternalRef can't be found. So I looked into the purl link and changed pkg:github.com/zephyrproject-rtos/zephyr@v3.7.0 to pkg:github/zephyrproject-rtos/zephyr@v3.7.0 Then it finds it. Is this only a problem for my BlackDuck version or is this purl link faulty in general? Problem 2:
If I change it to this, it the component gets found by BlackDuck:
My conclusion: Thanks, |
Could you provide more details on how |
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
But it seems mbedtls is the only module that actually does this currently. This issue is potentially relevant too: #53479, I've posted in there to see if there's any plan to extend this to other modules. |
Yes, BladkDuck is a commercial tool. Sorry, I am not at all familiar with SCA extensions. Maybe with some time I can look into it and maybe provide something. But I think I can make my questions more general. The problems I pointed are (I think) independent of BlackDuck.
|
@zephyrproject-rtos/security can maybe comment, should we track that modules update the relevant information in the |
You are right. I can submit a PR to fix this if you want.
This is my analysis of the situation: I would recommand to use You can find the correct For the |
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.
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.
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
The text was updated successfully, but these errors were encountered: