feat: introduce --show-enrichment semantic diff to highlight attestation value#24
Open
corepacket wants to merge 1 commit intoSBOMit:masterfrom
Open
feat: introduce --show-enrichment semantic diff to highlight attestation value#24corepacket wants to merge 1 commit intoSBOMit:masterfrom
feat: introduce --show-enrichment semantic diff to highlight attestation value#24corepacket wants to merge 1 commit intoSBOMit:masterfrom
Conversation
Adds a generic SBOM diff layer via pkg/diff and pipes the logic to generate commands Signed-off-by: corepacket <wbn453177@gmail.com>
Member
|
I think you can reuse internal state for the diff, we add SBOMit data to the syft generated SBOM. So the delta is the diff except for those already in the syft SBOM. This filtering again is something we already do when adding entries from attestations imo. |
Author
|
@absol27 Thanks, that makes sense. I see that the delta is already determined during the enrichment step while filtering against the Syft SBOM. I’ll refactor this to reuse that logic and track added / enriched packages directly during the merge instead of using a separate diff module. I’ll update the PR accordingly. |
Member
|
Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title:
Closes #25
feat: introduce --show-enrichment semantic diff to highlight attestation value
Description:
Problem:
Currently, when SBOMit executes its attestation-driven pipeline, it quietly merges dynamically discovered data (from witnesses) with a base cataloger's SBOM (Trivy/Syft). This lack of visibility makes it difficult for developers and security teams to quantify exactly what value SBOMit provided over running the static cataloger alone.
Solution:
This PR implements a deep semantic diffing engine (
pkg/diff) and exposes it to the CLI via a new--show-enrichmentflag. It mathematically proves SBOMit’s impact by taking the pre-fusion Base SBOM and calculating what exact packages and identifiers were added or updated by the parsed attestations.Key Additions:
pkg/diffModule: Isolated diffing logic with strict unit test coverage that compares twoprotobom/sbom.Documentstructs.PURLidentities to accurately differentiate between a completelyAddedpackage and anEnrichedpackage (e.g., when an attestation captures a network query string?url=...that shouldn't break the identity matching).Updatedpackages only when newly discovered build Hashes or PURL Qualifiers are genuinely unique compared to the base scanner.cmd/generate.go, intercepting the generation pipeline inpkg/generator/generator.goright before the final merge, outputting a clear metric summary tostderr.Example Output: