Add a feature for embedding SBOMs#962
Conversation
With the new option '--enable-sbom=embed:path-classpath-resource', one can embed the specified SBOM in the produced native image. The resource is looked up an the Quarkus's Features classpath.
|
Since the implementation is a feature, more so a Quarkus specific feature, I believe it would be better implemented in Quarkus instead. Drawbacks:
Advantages:
WDYT? |
|
I tend to agree. Those cyclic dependencies are pretty nasty. The feature also needs to add native image generator specific bits to the embedded sbom eventually. It's not clear to me to how we should approach that chicken/egg problem: SBOM is generated by quarkus, embedded in jars. On native compilation the exact native image generator version needs to get embedded as well. We only have the native image version available in the NativeImageBuildStep that depends on the jar generation step. If you have some cycles to move this forward, I'd appreciate a hand. Otherwise, I'd likely throw some AI tool at this gizmo transformation problem. |
Sure, I will prepare a Quarkus patch and assign you as a reviewer. |
Makes sense. It needs to go in together with quarkusio/quarkus#53861 |
|
Closing for now. |
|
Generate a GraalVM Feature (`io.quarkus.runner.SbomEmbedFeature`) using Gizmo2 that embeds the application SBOM into the native image, following the GraalVM SBOM spec. Internal GraalVM APIs (CGlobalDataFactory, CGlobalDataFeature, Word) are referenced via ClassMethodDesc to avoid compile-time dependencies on internal packages that may change across GraalVM versions. The Feature is only generated when EmbeddedSbomMetadataBuildItem is present (i.e. when CycloneDX SBOM embedding is enabled). See: graalvm/mandrel#962 and #53552 Assisted-by: Claude Opus 4.6 <[email protected]>
With the new option
--enable-sbom=embed:path-classpath-resource, one can embed the specified SBOM in the produced native image. The resource is looked up on the Quarkus Feature's classpath.The SBOM is generated by Quarkus (see quarkusio/quarkus#53552). All this patch does is to embed it into the native image following the specs in https://www.graalvm.org/jdk25/security-guide/native-image/sbom/#native-image-utils-tool with respect to
sbomandsbom_lengthsymbols.Thoughts?