snyk / parlay

Enrich SBOMs with data from third party services
Apache License 2.0
123 stars 19 forks source link

No enrichment for nested components in CycloneDX #59

Closed StefanFl closed 9 months ago

StefanFl commented 9 months ago

CycloneDX SBOMs can have components embedded in a component, see https://cyclonedx.org/docs/1.5/json/#components_items_components. I have generated a SBOM with cyclonedx-npm and got this:

        {
            "type": "library",
            "bom-ref": "match-sorter@6.3.4",
            "supplier": {
                "name": "Kent C. Dodds",
                "url": [
                    "https://kentcdodds.com"
                ]
            },
            "author": "Kent C. Dodds",
            "name": "match-sorter",
            "version": "6.3.4",
            "description": "Simple, expected, and deterministic best-match sorting of an array in JavaScript",
            "licenses": [
                {
                    "expression": "MIT"
                }
            ],
            "purl": "pkg:npm/match-sorter@6.3.4",
            "components": [
                {
                    "type": "library",
                    "bom-ref": "match-sorter@6.3.4|remove-accents@0.5.0",
                    "name": "remove-accents",
                    "version": "0.5.0",
                    "purl": "pkg:npm/remove-accents@0.5.0"
                }
            ]
        },

This example contains information gathered by Parlay for the match-sorter, but nothing was found for the included remove-accents.

Would it possible for Parlay to traverse through the components?

mcombuechen commented 9 months ago

Hey @StefanFl thanks for bringing this up, it is definitely something we'd like parlay to be able to support. I'll keep this issue open to track progress on this.

mcombuechen commented 9 months ago

This likely also applies to the Snyk enricher. In addition, the root component (.metadata.component) is not being taken into account. Technically that's yet another issue but we could solve this here as well.

@StefanFl just letting you know that a fix is on the way.

StefanFl commented 9 months ago

Thank you very much for fixing it so quickly, works perfectly.