Add metadata properties to CycloneDX #717
Closed
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.
Depends on #710
This commit adds arbitrary properties from the syft metadata to
CycloneDX. This builds on top of the previous work on enriching
the cyclonedx output. Creating a separate PR for this work as this
might be a point of contention whether we want to add these properties
or not or the way the properties are currently extracted using struct
tags.
NOTE: Diff to look at sambhav/syft-1@enrich-cdx...enrich-cdx-props
This allows us to use struct tags to add cyclonedx property values. It works in the follow way -
If it detects an explicit
cyclonedxstruct tag and it will use the value of that tag as the name for the property.It stringifies the value of the struct field to get the prop value since cyclonedx props are strings only.
If the cyclonedx struct tag is not added or if the stringified value is empty, the prop is not added.