Skip to content

Add VDR as CycloneDX export variant - #2277

Merged
nscuro merged 2 commits into
DependencyTrack:masterfrom
nscuro:issue-1800
Dec 16, 2022
Merged

nscuro merged 2 commits into
DependencyTrack:masterfrom
nscuro:issue-1800

Conversation

@nscuro

@nscuro nscuro commented Dec 13, 2022 •

Copy link
Copy Markdown
Member

Description

This PR adds Vulnerability Disclosure Report (VDR) as additional CycloneDX export variant.

VDRs are a superset of the existing "Inventory with Vulnerabilities" variant.
The only addition being that VDRs also include analysis data, which was previously only included in VEX exports.

Addressed Issue

Closes #1800

Additional Details

Frontend PR: DependencyTrack/frontend#363

Checklist

  • I have read and understand the contributing guidelines
  • This PR fixes a defect, and I have provided tests to verify that the fix is effective
  • This PR implements an enhancement, and I have provided tests to verify that it works as intended
  • This PR introduces changes to the database model, and I have added corresponding update logic
  • This PR introduces new or alters existing behavior, and I have updated the documentation accordingly

@stevespringett

Copy link
Copy Markdown
Member

@nscuro Can you attach a sample VDR output that was generated from the code in this PR?

@nscuro

nscuro commented Dec 14, 2022 •

Copy link
Copy Markdown
Member Author

@stevespringett Most certainly:

{
  "bomFormat" : "CycloneDX",
  "specVersion" : "1.4",
  "serialNumber" : "urn:uuid:403a0230-46eb-4ef7-9722-6f7afb3a0519",
  "version" : 1,
  "metadata" : {
    "timestamp" : "2022-12-14T21:25:08Z",
    "tools" : [
      {
        "vendor" : "OWASP",
        "name" : "Dependency-Track",
        "version" : "4.7.0-SNAPSHOT"
      }
    ],
    "component" : {
      "name" : "Foo",
      "version" : "123",
      "type" : "application",
      "bom-ref" : "8f5b6d52-1a8c-4362-bf92-e064a7ed9f99"
    }
  },
  "components" : [
    {
      "group" : "com.fasterxml.jackson.core",
      "name" : "jackson-databind",
      "version" : "2.13.4",
      "description" : "General data-binding functionality for Jackson: works on core streaming API",
      "licenses" : [
        {
          "license" : {
            "id" : "Apache-2.0"
          }
        }
      ],
      "purl" : "pkg:maven/com.fasterxml.jackson.core/[email protected]?type=jar",
      "type" : "library",
      "bom-ref" : "107e0a5b-3224-4c31-a9de-ef0f5188b7cd"
    },
    {
      "group" : "io.pebbletemplates",
      "name" : "pebble",
      "version" : "3.1.6",
      "description" : "Templating engine for Java.",
      "licenses" : [
        {
          "license" : {
            "id" : "BSD-3-Clause"
          }
        }
      ],
      "purl" : "pkg:maven/io.pebbletemplates/[email protected]?type=jar",
      "type" : "library",
      "bom-ref" : "0481e08b-63a1-4616-b5bd-5e5332f76a96"
    }
  ],
  "vulnerabilities" : [
    {
      "bom-ref" : "7505c074-b837-4167-b8c0-7bfd7c88fc07",
      "id" : "CVE-2022-42003",
      "source" : {
        "name" : "NVD",
        "url" : "https://nvd.nist.gov/"
      },
      "ratings" : [
        {
          "source" : {
            "name" : "NVD",
            "url" : "https://nvd.nist.gov/"
          },
          "score" : 7.5,
          "severity" : "high",
          "method" : "CVSSv3",
          "vector" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "cwes" : [
        502
      ],
      "description" : "In FasterXML jackson-databind before 2.14.0-rc1, resource exhaustion can occur because of a lack of a check in primitive value deserializers to avoid deep wrapper array nesting, when the UNWRAP_SINGLE_VALUE_ARRAYS feature is enabled. Additional fix version in 2.13.4.1 and 2.12.17.1",
      "published" : "2022-10-02T05:15:00Z",
      "updated" : "2022-12-02T15:14:00Z",
      "affects" : [
        {
          "ref" : "107e0a5b-3224-4c31-a9de-ef0f5188b7cd"
        }
      ]
    },
    {
      "bom-ref" : "014baa66-9b99-49f6-905c-b5f213a357c1",
      "id" : "CVE-2022-37767",
      "source" : {
        "name" : "NVD",
        "url" : "https://nvd.nist.gov/"
      },
      "ratings" : [
        {
          "source" : {
            "name" : "NVD",
            "url" : "https://nvd.nist.gov/"
          },
          "score" : 9.8,
          "severity" : "critical",
          "method" : "CVSSv3",
          "vector" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "cwes" : [
        863
      ],
      "description" : "** DISPUTED ** Pebble Templates 3.1.5 allows attackers to bypass a protection mechanism and implement arbitrary code execution with springbok. NOTE: the vendor disputes this because input to the Pebble templating engine is intended to include arbitrary Java code, and thus either the input should not arrive from an untrusted source, or else the application using the engine should apply restrictions to the input. The engine is not responsible for validating the input.",
      "published" : "2022-09-12T14:15:00Z",
      "updated" : "2022-10-19T19:15:00Z",
      "analysis" : {
        "state" : "not_affected",
        "justification" : "requires_dependency",
        "response" : [
          "will_not_fix"
        ],
        "detail" : "Requires pebble to be used in context of a Spring Framework or Spring Boot application."
      },
      "affects" : [
        {
          "ref" : "0481e08b-63a1-4616-b5bd-5e5332f76a96"
        }
      ]
    }
  ]
}

Stripped the hashes and externalReferences nodes from the above to make it less overwhelming.

@stevespringett

Copy link
Copy Markdown
Member

LGTM @nscuro - Nice work.

@nscuro
nscuro merged commit baf4f0b into DependencyTrack:master Dec 16, 2022
@nscuro
nscuro deleted the issue-1800 branch December 16, 2022 00:11
mulder999 pushed a commit to mulder999/dependency-track that referenced this pull request Dec 23, 2022
* Add VDR as CycloneDX export variant

Signed-off-by: nscuro <[email protected]>

* Add tests for CycloneDX exports

Signed-off-by: nscuro <[email protected]>

Signed-off-by: nscuro <[email protected]>
Signed-off-by: mulder999 <[email protected]>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Added CycloneDX export of Vulnerability Disclosure Report (VDR)

2 participants