dep-scan icon indicating copy to clipboard operation
dep-scan copied to clipboard

Feature: 1. more complete report in json and cyclonedx-json. 2. error when get sbom from trivy or syft.

Open almaz045 opened this issue 1 year ago • 6 comments

Request Description

  1. In this moment like I know depscan can generate reports only in html and json, but this json not complete and don't have all information that exists in html, for example the priority of remediataion, or the known exploited vulnerabilities. I would be nice if we can get report in json format that contain all this information to parse it.
  2. I noticed, that some sboms from trivy and syft in their components might miss some keys like 'version' or 'purl'. And if their miss depscan will fail. It's possible to ignore that components?

Additional Information

No response

almaz045 avatar Feb 22 '24 13:02 almaz045

For 1, can you check the .vdr.json file. It must have everything that is printed under the vulnerabilities attribute. For 2, can you attach a sample so we can guide towards sending a PR?

prabhu avatar Feb 22 '24 14:02 prabhu

For 2: trivy-sbom.json - this is sbom trivy that give keyerror: 'purl' bom-source-trivy.json - this is sbom trivy that give keyerror: 'version'

depscan --bom bom-source-trivy.json

almaz045 avatar Feb 22 '24 14:02 almaz045

@almaz045 Thank you. Would you like to become a contributor? To resolve KeyError in python we have to replace bracket based lookup ["purl"] with .get("purl"). Wrap in an if condition to handle None

prabhu avatar Feb 22 '24 15:02 prabhu

Yes, of course. Should I do same thing for KeyError with 'version'? Or after fixing purl will the problem with key error 'version' also disappear?

almaz045 avatar Feb 22 '24 15:02 almaz045

@almaz045 With both, please. like .get("purl", "") and .get("version", ""). Thank you!

cerrussell avatar Feb 22 '24 17:02 cerrussell

@prabhu https://github.com/owasp-dep-scan/dep-scan/pull/261 PR :)

almaz045 avatar Feb 25 '24 19:02 almaz045