-
Couldn't load subscription status.
- Fork 701
feat: swap custom cyclone-dx model for cyclone-dx library #1038
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
103e80b to
b747021
Compare
Signed-off-by: Christopher Phillips <[email protected]>
* main: chore: add GitLab Community Edition image to quality gate (#1035) Update Syft to v0.63.0 (#1037) fix: Exclude binary packages that have overlap by file ownership relationship (#1024) docs: update quality gate docs (#1032) Optionally orient results by CVE (#1020) Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
50e1574 to
efad935
Compare
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
grype/presenter/cyclonedx/test-fixtures/snapshot/TestCycloneDxPresenterDir.golden
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 and the MEGA-⚓ of the day for -5k LoC!
| results: pb.Matches, | ||
| packages: pb.Packages, | ||
| metadataProvider: pb.MetadataProvider, | ||
| srcMetadata: pb.Context.Source, | ||
| sbom: pb.SBOM, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if we're going to use a PresenterBundle should the formats just have a reference to it instead of copying all/most of the properties individually? (same comment for all presenters, which might just reduce a bit of code)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a note to refactor this in its own separate PR so it's clear that this is an optimization and not part of the general upgrade to the syft library.
|
@wagoodman do you want me to invert the new output options here?
Should we keep the |
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
Signed-off-by: Christopher Phillips <[email protected]>
* main: (56 commits) fix: always include severity in cyclonedx output (anchore#1067) Update Syft to v0.68.0 (anchore#1064) Add protobuf FPs to default ignore list (anchore#1062) chore: update Syft to v0.66.2 (anchore#1060) Update grype bootstrap tools to latest versions. (anchore#1055) feat: allow grype db diff to specify local db directories (anchore#1058) chore: claim artifacthub package ownership from developer-guy (anchore#661) chore: add github token to quality tests (anchore#1056) chore: update yardstick to diagnose intermittent failures (anchore#1054) Update grype bootstrap tools to latest versions. (anchore#1048) fix: sort vulnerability results (anchore#1052) Adding internal/file/hasher test cases (anchore#1049) fix: orient by cve merging (anchore#1046) Update Syft to v0.64.0 (anchore#1047) fix: update removing results based on ownership-by-file-overlap (anchore#1045) feat: swap custom cyclone-dx model for cyclone-dx library (anchore#1038) chore: add GitLab Community Edition image to quality gate (anchore#1035) Update Syft to v0.63.0 (anchore#1037) fix: Exclude binary packages that have overlap by file ownership relationship (anchore#1024) docs: update quality gate docs (anchore#1032) ...
Summary
Grype currently produces CYCLONE-DX SBOM that are not compliant with the cyclone-dx tooling libraries. Rather than write the logic in two places, this PR moves grype to use syft's formatting functions as a library to produce valid CYCLONE-DX SBOM components along with the discovered vulnerabilities.
For more context on why this is an issue see:
Fixes #796
Fixes #951
Testing note:
image-simplewas unused under the cyclone-dx test-fixures so was removed in favor of the snapshot presenter testing.Breaking Changes
cyclonedxandcyclonedx-xml. The options forembedded-cyclonedx-vex-jsonandembedded-cyclonedx-vex-xmlhave been removed.schema/cyclonedx/. These have been sourced from the above schema linkComparison chart:
To consider
Take a look at the two following outputs. The version of grype is
0.54.0This command uses this branch:
The above commands should both output
cyclonedx-1.4-jsondocuments:Note: in the above example we're seeing binary cataloger overlaps with package cataloger matching so that's probably a PR we want in separately before the next release so we can match on the correct package.
Notice how alpine shows
1.35.0-r29vs binary cataloger which is showing1.35.0, the latter of which is vulnerable.Highlights from the above output comparrisons
publisher, description, properties, and referencesSigned-off-by: Christopher Phillips [email protected]