Skip to content

package-profiler / vuln-scan.sh: populate CycloneDX vulnerabilities array in merged output #58

@toderash

Description

@toderash

When vuln-scan.sh merges Grype results into a CycloneDX SBOM, it places vulnerability data under a custom vulnerability_scan key. CycloneDX 1.4+ defines a standard top-level vulnerabilities array that spec-compliant consumers (SCA platforms, dependency dashboards, etc.) expect.

The recommended fix is to map Grype matches into the CycloneDX vulnerabilities schema (id, source, ratings, description, affects) and conditionally add the array when .bomFormat == "CycloneDX". The custom vulnerability_scan key can remain for Forge tooling.

This issue was deferred from a Copilot comment on PR #57. Field mapping between Grype JSON and CycloneDX vulnerabilities schema is (surprisingly) non-trivial, so warrants its own PR with testing against Grype output. In the meantime, having it there in a non-standard format is arguably better than missing some of it from untested remapping.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions