Skip to content
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

configure args is in the metadata file but not the main SBoM file #3917

Open
sxa opened this issue Aug 19, 2024 · 8 comments · May be fixed by #4082
Open

configure args is in the metadata file but not the main SBoM file #3917

sxa opened this issue Aug 19, 2024 · 8 comments · May be fixed by #4082
Assignees
Labels
Sbom issue relate to work of sbom secure-dev

Comments

@sxa
Copy link
Member

sxa commented Aug 19, 2024

I thought we had the configure args in the main SBoM now - I guess not 😢
Ideally we'd just pull the SBoM from the API but since we need the metadata file as well I guess it makes sense to have the two lines look similar.
We typically don't want to encourage people going directly to our backend location on github.

Originally posted by @sxa in adoptium/adoptium.net#2949 (comment)

We should ensure that all information required for reproducibility is in the main SBoM file so the metadata file (Primarily for use by the adoptium API) is not required for reproducibility verification.

The goal here should be to ensure that out documentating like this for Linux/x64 does not include curl -L -O https://github.com/adoptium/temurin21-binaries/releases/download/jdk-21.0.4%2B7/OpenJDK21U-sbom_x64_linux_hotspot_21.0.4_7-metadata.json because all of the information has been added to the SBoM file.

@Scanteianu
Copy link

i can do this

@sxa sxa removed this from Adoptium Backlog Nov 28, 2024
@sxa sxa added Sbom issue relate to work of sbom secure-dev labels Nov 28, 2024
@Scanteianu
Copy link

@sxa is this something i should somehow try doing in the TemurinGenSBOM.java (if so, how do i build it/pull in dependencies - I'm not sure how i can pull in the cyclonedx libs without having a maven/gradle build file)

@sxa
Copy link
Member Author

sxa commented Nov 28, 2024

https://github.com/adoptium/temurin-build/blob/master/cyclonedx-lib/README.md contains pretty much everything I know about the SBoM generation process, and specifically my experience of adding things. Hopefully the referenced parts of build.sh in there will give you an idea of how to get started. For anything more complex we may need the assistance of @andrew-m-leonard :-)

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Nov 29, 2024

@Scanteianu this would just need one line to add configure_args around here:

addSBOMComponentProperty "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "Build Config" "${built_config}"

This should work I think:

addSBOMComponentProperty "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "Configure Args" "${CONFIGURE_ARGS}"

@Scanteianu
Copy link

not quite sure what @andrew-m-leonard means - is it that BUILD_CONFIGURATION_PARAM thing which is all the sbom needs (still needs converting into a name-value pair list to match the definition in https://cyclonedx.org/docs/1.4/json/#metadata_component_properties

the thing in the pr matches the validator here https://cyclonedx.github.io/cyclonedx-web-tool/validate (with the caveat that I manually bumped minor version back down to 1.5 because they don't support 1.6 yet)

@andrew-m-leonard
Copy link
Contributor

the addSBOMComponentProperty should do all the work, we just need to add the following line to sbin/build.sh, so that CONFIGURE_ARGS:

addSBOMComponentProperty "${javaHome}" "${classpath}" "${sbomJson}" "${componentName}" "Configure Args" "${CONFIGURE_ARGS}"

note, CONFIGURE_ARGS is kept as a single String property value.

@sxa
Copy link
Member Author

sxa commented Dec 19, 2024

@Scanteianu Does Andrew's comment above sound good to you?

@Scanteianu
Copy link

sorry, missed the notification, not sure why. I will try to add that line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Sbom issue relate to work of sbom secure-dev
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

3 participants