2.5 KiB
2.5 KiB
Composition Recipe API for SBOM Determinism Verification
Module
Scanner
Status
IMPLEMENTED
Description
API endpoint (GET /scans/{id}/composition-recipe) that exposes the SBOM composition recipe with Merkle root and layer digest verification, enabling downstream verification that SBOMs are deterministically composed from layer fragments.
Implementation Details
- Composition Recipe Service:
src/Scanner/__Libraries/StellaOps.Scanner.Emit/Composition/CompositionRecipeService.cs- Core service computing composition recipes with Merkle rootsrc/Scanner/__Libraries/StellaOps.Scanner.Emit/Composition/SbomCompositionResult.cs- Composition result model with Merkle root and layer digests
- Layer SBOM Composition:
src/Scanner/__Libraries/StellaOps.Scanner.Emit/Composition/LayerSbomComposer.cs- Composes full SBOM from per-layer SBOM fragmentssrc/Scanner/__Libraries/StellaOps.Scanner.Emit/Composition/LayerSbomRef.cs- Layer SBOM reference with digestsrc/Scanner/__Libraries/StellaOps.Scanner.Emit/Composition/CycloneDxComposer.cs- CycloneDX-specific composition
- API Endpoints:
src/Scanner/StellaOps.Scanner.WebService/Endpoints/LayerSbomEndpoints.cs-LayerSbomEndpointsexposing composition recipe and layer SBOM datasrc/Scanner/StellaOps.Scanner.WebService/Contracts/LayerSbomContracts.cs- API contracts
- Layer SBOM Service:
src/Scanner/StellaOps.Scanner.WebService/Services/ILayerSbomService.cs-ILayerSbomServicewithLayerSummary,SbomLayerFragmentsrc/Scanner/StellaOps.Scanner.WebService/Services/LayerSbomService.cs- Implementation
- Surface Manifest:
src/Scanner/__Libraries/StellaOps.Scanner.Surface.FS/SurfaceManifestDeterminismVerifier.cs- Verifies determinism of surface manifestssrc/Scanner/__Libraries/StellaOps.Scanner.Surface.FS/FacetSealExtractor.cs- Extracts facet seals for composition verification
E2E Test Plan
- Scan an image and call
GET /api/v1/scans/{scanId}/composition-recipeto retrieve the composition recipe - Verify the response includes Merkle root and per-layer digest values
- Verify each layer fragment digest matches the actual layer SBOM content hash
- Re-compose the SBOM from layer fragments and verify the Merkle root matches the recipe
- Scan the same image twice and verify composition recipe values are deterministically identical
- Verify the composition recipe can be used to verify SBOM integrity in an offline/air-gap environment