cyclonedx: do not include root file (e.g., conan.lock) as component (…#4309
Open
kdt523 wants to merge 1 commit intoanchore:mainfrom
Open
cyclonedx: do not include root file (e.g., conan.lock) as component (…#4309kdt523 wants to merge 1 commit intoanchore:mainfrom
kdt523 wants to merge 1 commit intoanchore:mainfrom
Conversation
…nchore#4242)\n\n- Skip adding the input source file itself to CycloneDX components list\n- Ensures Linux and Windows produce consistent SBOMs without conan.lock as a component Signed-off-by: kdt523 <krushna.datir231@vit.edu>
2fa3c7b to
09ad8b0
Compare
Contributor
|
Hey @kdt523 -- I haven't yet reviewed this, but I wanted to note that there is a fix for Windows that will probably make this behavior consistent, where both will include the file, at least fixing the inconcistency. |
Contributor
|
Hey @kdt523 are you able to retest with the latest Syft? I believe the issue where Windows was not including the root file component should be resolved |
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.
Ensure CycloneDX SBOM consistency across OSes by skipping root input file as a component
Description
Ensure CycloneDX SBOMs generated from a single file source (e.g.,
conan.lock) are consistent across OSes by not listing the root input file itself as a component.Problem
On Linux, the CycloneDX SBOM could include the input lockfile (e.g.,
conan.lock) in the components list, while on Windows it wouldn’t.The input document shouldn’t be treated as a “component.”
Fix
When the source under analysis is a single file (
source.FileMetadata), skip emitting that exact file as aComponentTypeFilein the CycloneDX components array.Scope
Only affects CycloneDX component emission — package discovery and relationships remain unchanged.
Key Change
to_format_model.goBehavioral Summary
conan.lockconan.lockFixes
#4242
Type of Change
Checklist