Ensure that all cyclonedx components have bom-refs#914
Merged
wagoodman merged 4 commits intoanchore:mainfrom Apr 1, 2022
Merged
Ensure that all cyclonedx components have bom-refs#914wagoodman merged 4 commits intoanchore:mainfrom
wagoodman merged 4 commits intoanchore:mainfrom
Conversation
kzantow reviewed Mar 23, 2022
Contributor Author
| Notes -
|
Contributor
| @samj1912 what if we always include the |
Signed-off-by: Sambhav Kothari <skothari44@bloomberg.net>
kzantow reviewed Mar 31, 2022
| }, | ||
| "components": [ | ||
| { | ||
| "bom-ref": "b85dbb4e6ece5082", |
Contributor
There was a problem hiding this comment.
An odd thing: none of these golden examples actually include a PURL-based bom-ref; maybe something is wrong about the logic or none of them have populated PURLs?
Contributor Author
There was a problem hiding this comment.
None of them have populated purls. if you run make validate-schema, you can see some actual examples.
Contributor
There was a problem hiding this comment.
I see, since the examples in the test suite aren't valid pURLs.
wagoodman reviewed Apr 1, 2022
| // TODO: In the future we may want to dedupe by PURL and combine components with | ||
| // the same PURL while preserving their unique metadata. | ||
| if parsedPURL, err := packageurl.FromString(p.PURL); err == nil { | ||
| parsedPURL.Qualifiers = append(parsedPURL.Qualifiers, packageurl.Qualifier{Key: "syft-id", Value: string(p.ID())}) |
Contributor
There was a problem hiding this comment.
nice touch making this a pURL qualifier
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
Contributor Author
| Thanks! |
spiffcs added a commit that referenced this pull request May 2, 2022
* main: (31 commits) reduce noise of log output (#976) add version info and remove double config call (#977) Rename syft-id to package-id (#970) update to cyclonedx-go 0.5.2 (#971) refactor command package to remove globals and add dependency injection fix: #953 Derive language from pURL - https://github.com/anchore/syft… (#957) Fix typo in CPE-parsing error (#966) Preserve syft IDs on SBOM decode (#963) Update GitHub format package_url and correlator (#961) Ensure SPDXIDs are valid (#955) Auto-PR needs to run go mod tidy (#958) Add workflow for automatic PR for new stereoscope updates (#954) Minor readme update to correct format information (#948) Update spdx22json to only take uppercase checksum algorithm (#946) add additional vendors for springframework (#945) Add digest property to parent and nested java package metadata (#941) Update write permissions and log into ghcr.io for release (#942) Retry auth URL lookup without docker credentialhelper workaround (#939) Ensure that all cyclonedx components have bom-refs (#914) Additionally publish docker images to GHCR (#934) ... Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
GijsCalis pushed a commit to GijsCalis/syft that referenced this pull request Feb 19, 2024
Co-authored-by: Alex Goodman <alex.goodman@anchore.com>
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.
Signed-off-by: Sambhav Kothari skothari44@bloomberg.net
BOM-Refs are important for VEX to refer to components uniquely. This allows us to create an independent vex document and refer to components within the SBOM through a BOM Link (see https://cyclonedx.org/capabilities/bomlink/)
The current logic for setting the bom ref is -
cc: @stevespringett @coderpatros
This is needed for independent VEX documents in grype.