-
Notifications
You must be signed in to change notification settings - Fork 752
feat: add support for user to flag root package supplier and package supplier inheritance #3646
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 <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
…suport-package-supplier * 'main' of https://github.com/anchore/syft: chore(deps): bump github/codeql-action from 3.28.8 to 3.28.9 (#3648) feat: 3626 add option enable license content; disable by default (#3631)
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
| } | ||
|
|
||
| // TODO: we eventually want to update this so that we can read "supplier" from different syft metadata | ||
| func encodeSupplier(_ pkg.Package, sbomSupplier string) *cyclonedx.OrganizationalEntity { |
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.
the equivalent decoder support for this field I think is missing (getting supplier specified in a syft doc when decoding a cyclonedx one)
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.
might be worth updating the encoder-decoder cycle integration test to have a supplier specified in the source.
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.
Oh I missed this comment on my last pass. Let me get this added now.
* main: (142 commits) feat: detect when full license text has been provided and preserve as separate field (#3450) chore(deps): bump github.com/Masterminds/semver/v3 from 3.3.0 to 3.3.1 (#3843) chore(deps): update tools to latest versions (#3841) Update github.com/Masterminds/semver to v3 (#3836) Add support for PHP Pear (#2775) fix: Improve detection of erlang binary in alpine Linux (#3839) fix:Resolve ancestral symlinks correctly (#3783) chore(deps): update CPE dictionary index (#3834) chore(deps): update tools to latest versions (#3835) chore(deps): bump github.com/charmbracelet/bubbletea from 1.3.4 to 1.3.5 (#3838) fix the fluent-bit regex detection pattern (#3817) chore(deps): bump anchore/sbom-action from 0.18.0 to 0.19.0 (#3832) chore(deps): update tools to latest versions (#3830) Resolve owned file paths when searching for overlaps (#3828) chore(deps): update anchore dependencies (#3827) fix: Make the fileresolver Support Prefix Match of Files (#3820) Add support for detecting javascript assets in .NET projects using libman (#3825) chore(deps): update tools to latest versions (#3823) (feat): support skipping archive extraction with file source (#3795) Consider DLL claims for dependencies of .NET packages from deps.json (#3822) ... Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
Signed-off-by: Christopher Phillips <32073428+spiffcs@users.noreply.github.com>
|
Closed in favor of #4131 |
Description
This PR adds a new flag to syft called
--source-supplier. This flag allows syft users to associate an optionalsupplierto the root component of the final document. It makes no determination about other packages cataloged by syft.Formats updated
syft-jsonspdx-jsoncyclonedx-jsonspdxcyclonedxThe
--source-supplierwill be used to determine the supplier of the root component of the SBOMThis allows organizations generating SBOMs who want to produce NTIA compliant documents to assume the
supplierfield for software/containers they are producing.Adds
supplierto the following outputs:spdx
go run cmd/syft/main.go -o spdx alpine:latest --source-supplier optional-supplier > test.jsonspdx-json
go run cmd/syft/main.go -o spdx-json alpine:latest --supplier optional-supplier > test.json{ "name": "alpine", "SPDXID": "SPDXRef-DocumentRoot-Image-alpine", "versionInfo": "sha256:47badde288cf303fe43766ba3c0be01df313b84ad91480c1f21b7e907a7f2337", "supplier": "Organization: optional-supplier", <----------- "downloadLocation": "NOASSERTION", "filesAnalyzed": false, "checksums": [ { "algorithm": "SHA256", "checksumValue": "47badde288cf303fe43766ba3c0be01df313b84ad91480c1f21b7e907a7f2337" } ], "licenseConcluded": "NOASSERTION", "licenseDeclared": "NOASSERTION", "copyrightText": "NOASSERTION", "externalRefs": [ { "referenceCategory": "PACKAGE-MANAGER", "referenceType": "purl", "referenceLocator": "pkg:oci/alpine@sha256%3A47badde288cf303fe43766ba3c0be01df313b84ad91480c1f21b7e907a7f2337?arch=arm64&tag=latest" } ], "primaryPackagePurpose": "CONTAINER" }syft-json
go run cmd/syft/main.go -o json alpine:latest --supplier optional-supplier > test.jsoncyclonedx-json
Note: for cyclonedx-json we're putting supplier in two spots that the format supports. One is the top level BOM description. The other is for the root component identified in the bom
go run cmd/syft/main.go -o cyclonedx-json alpine:latest --supplier optional-supplier > test.jsoncyclonedx
Fixes
PackageSupplierin root of SPDX document generated by CLI #3098Type of change
Checklist: