Skip to content

konflux: generate real SPDX SBOM for dm-verity image - #254

Closed
dbkreling wants to merge 1 commit into
confidential-devhub:mainfrom
dbkreling:kata-5098-dm-verity-sbom
Closed

konflux: generate real SPDX SBOM for dm-verity image#254
dbkreling wants to merge 1 commit into
confidential-devhub:mainfrom
dbkreling:kata-5098-dm-verity-sbom

Conversation

@dbkreling

@dbkreling dbkreling commented Jun 30, 2026

Copy link
Copy Markdown
Collaborator

Replace the empty placeholder SBOM with a real SPDX 2.3 SBOM that lists all RPM packages installed in the QCOW2 guest and references the osc-podvm-payload container by digest.

The build now captures the RPM inventory via rpm -qa inside the guest, extracts it with virt-copy-out, and transfers it back to the Tekton pod. The sbom-generate step constructs valid SPDX JSON with package entries and PURL references for each RPM and the payload container.

The SBOM format was aligned against real SBOMs from osc-caa (syft) and osc-podvm-payload (mobster) to match field structure, PURL conventions, license fields, and checksums.

Issue: KATA-5098

@dbkreling

Copy link
Copy Markdown
Collaborator Author

/retest

Replace the empty placeholder SBOM with a real SPDX 2.3 SBOM that lists
all RPM packages installed in the QCOW2 guest and references the
osc-podvm-payload container by digest.

The build now captures the RPM inventory via rpm -qa inside the guest,
extracts it with virt-copy-out, and transfers it back to the Tekton pod.
The sbom-generate step constructs valid SPDX JSON with package entries
and PURL references for each RPM and the payload container.

The SBOM format was aligned against real SBOMs from osc-caa (syft) and
osc-podvm-payload (mobster) to match field structure, PURL conventions,
license fields, and checksums.

Ref: KATA-5098

Signed-off-by: Daniel Kreling <dkreling@redhat.com>

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dbkreling
dbkreling force-pushed the kata-5098-dm-verity-sbom branch from 293b094 to 2d12281 Compare July 1, 2026 13:09
@dbkreling
dbkreling requested review from gkurz and littlejawa July 1, 2026 19:26
@dbkreling

Copy link
Copy Markdown
Collaborator Author

We had the Enterprise Contract test failing due to a Konflux-managed data source (lists which task bundles are "acceptable" for EC validation). It's referenced from inside the quay.io/conforma/release-policy:konflux policy bundle, which is maintained by the Konflux/Conforma team — not something configured in our konflux-release-data EC policy.
The digest was garbage collected from quay.io, so every component in the entire openshift-sandboxed-containers application fails the same way. This isn't specific to this PR or even to osc-dm-verity-image.

This doesn't block our SBOM work. The per-component EC check (osc-dm-verity-image-on-pull-request) already assed with SUCCESS.

Retesting to see if there's already a fix applied.

@dbkreling

Copy link
Copy Markdown
Collaborator Author

/retest

IMAGE_PULLSPEC="${IMAGE_URL}@${IMAGE_DIGEST}"
CREATED=$(date -u +"%Y-%m-%dT%H:%M:%SZ" 2>/dev/null || echo "1970-01-01T00:00:00Z")

{

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than writing the file manually, and be responsible for changing it if the format is modified somehow, I would like to rely on mobster, and let it deal with the SBOM format.

The "buildah" task we use everywhere else is doing it:
https://github.com/konflux-ci/build-definitions/blob/39abbc73206c645eb7ee94fa9cd806b00b174ec6/task/buildah-remote-oci-ta/0.10/buildah-remote-oci-ta.yaml#L1058

Can we try to do something similar?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Julien. Yes, I agree — I've reimplemented this using syft + mobster in a new branch, following the same pattern as the buildah-remote task. The custom printf SBOM is gone... Besides, using that approach will preserve consistency and maintainability among our repos.

This is the PR I created #256 and I'll close this one in favor to #256.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants