-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Export SBOM contained in native-image #40630
Comments
@fniephaus Would it be possible to expose the embedded SBOM via a standard Java mechanism, e.g. a readable resource on the classpath or some custom URL scheme? Then we wouldn't need to add the dependency on the GraalVM SDK and it would work right now with Boot 3.3.0-RC1. |
@mhalbritter I think that's technically feasible. Can you give an example or two how SBOMs are otherwise accessible via classpath/modulepath or a custom URL scheme? |
Sure. Take a look at this documentation here. If the SBOM would be on the classpath, you could just use |
Native images now expose their SBOM under |
The new SBOM on classpath feature is available in EA build 19 of Oracle GraalVM: sdk install java 23.ea.19-graal If you add |
Until Spring Boot adds built-in support, here are the steps to get that working with the current Spring Boot version:
graalvmNative {
binaries {
main {
buildArgs.add("--enable-sbom=classpath")
}
}
}
management.endpoint.sbom.additional.native-image.location=optional:classpath:META-INF/native-image/sbom.json Then a |
GraalVM 23 has been released and it contains the SBOM feature. |
With this implemented, all you need to do is graalvmNative {
binaries {
main {
buildArgs.add("--enable-sbom=classpath")
}
}
} and Spring Boot will expose the SBOM with the |
I wonder if we should configure this by default as a reaction to the native image plugin being applied. WDYT, @mhalbritter? |
We have to see if we can find out the GraalVM version used, as |
GraalVM's
native-image
has a feature where it can create a SBOM on native image build time and embed it. You can then use thenative-image-inspect
to extract the SBOM from the native image.The GraalVM team would be open to expose an API in the
graal-sdk
to get the SBOM directly without the need of thenative-image-inspect
. We could add support for that in our actuator SBOM endpoint.The text was updated successfully, but these errors were encountered: