anchore / anchore/syft

Syft is dropping the "group" field from imported CycloneDX

Open
#1,202 2 comments 0 reactions 0 assignees View on GitHub
bug format:cyclonedx
Dominant language
Go
Stars
9.6k
Forks
954
Avg merge
23h 27m
Merged PRs (30d)
48

Description

This is based on research with @wurstbrot. It might be an issue with syft, or the CycloneDX library.

By taking a look at the output of the javascript cataloger, it doesn't use group (specified in . It places the group in front of the name.
I am using the following components/flow:
cyclonedx/cyclonedx-npm (uses group) -> image -> syft (doesn't support group) with https://github.com/CycloneDX/cyclonedx-go (does support groups) -> new-bom.json (without group attribute/prefix in name)

Is there a reason that syft doesn't use the specified group in a [package](https://github.com/anchore/syft/blob/main/syft/pkg/package.go#L16)? The cycloneDX specification uses
a group https://cyclonedx.org/docs/1.4/json/#components_items_group?

A workaround might be to do make the bom.json it like the javascript cataloger uses it and add the group in front of the name and remove the group attribute.

_Originally posted by @wurstbrot in https://github.com/anchore/syft/issues/1029#issuecomment-1241818307_

Contributor guide

Open the contributing guide

Research direction

Start at syft/pkg/package.go and trace the CycloneDX import flow, comparing it with the JavaScript cataloger output and cyclonedx-go's group support. Reproduce the cyclonedx-npm → image → Syft → new-bom.json flow; done means the handling of the CycloneDX group field is explained and the resulting behavior is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, javascript
Domain
cli, devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.