-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Improve support for the Component.Evidence.Identity
field in CycloneDX 1.6
#192
Comments
We also run into that issue, trivy inherits this issue :/ |
Hi everyone! I'll try to finish it today or next week. |
Created #204 |
Just my thoughts as a user of the library, regarding @DmitriyLewen's approach:
@nscuro Perhaps it could make sense to consider introducing different
One of our use cases (probably a typical one) is decoding an external JSON/XML file, which might be of any version, and use it via a specific version of the structure (which may or may not be the latest). To support this, there could be a helper function which decodes the file to the correct structure, matching the file version (e.g. extracted with Note that a similar approach has been taken for SPDX files: https://github.com/spdx/tools-golang |
I agree with your thoughts @darioandre. But this problem exists now. We have a problem - users can't scan the CycloneDX file (aquasecurity/trivy#6902 (comment)), so we want to fix this problem as soon as possible. |
see also: #207 |
In CycloneDX 1.5, the
Component.Evidence.Identity
field was specified as a singleIdentity
object. In CycloneDX 1.6 this has been deprecated in favor of an array ofIdentity
objects.The specifications can be compared here:
1.5: https://cyclonedx.org/docs/1.5/json/#components_items_evidence_identity
1.6: https://cyclonedx.org/docs/1.6/json/#components_items_evidence_identity
cyclonedx-go still defines
Identity
as*EvidenceIdentity
so it fails to unmarshal SBOMs which have an array of identities in place of a single one; the error is:cannot unmarshal array into Go struct field Evidence.components.evidence.identity of type cyclonedx.EvidenceIdentity
.This currently happens with some SBOMs generated by cdxgen (https://github.com/CycloneDX/cdxgen) when using the
--spec-version 1.6
argument. This is an SBOM affected by the issue. It was generated from a skeleton Poetry project, with just pytest added, using this command:The text was updated successfully, but these errors were encountered: