Skip to content

SPDX Import Specifications#

This page explains which fields FutureVuls interprets and imports, and how, for SBOMs in the Linux Foundation SPDX (v2.x) format.

For the format-independent common specifications, such as component type determination and the import of OS and dependency library information, refer to "SBOM Import Specifications".

FutureVuls reads the following information from SPDX. The JSON in each section is an excerpt for explanation. It cannot be imported as is.

creationInfo#

  "creationInfo": {
    "creators": [
      "Organization: aquasecurity",
      "Tool: trivy-0.43.0"
    ],
    "created": "2023-08-08T08:01:33Z"
  }

The tool that generated the SBOM is determined from creators.

packages#

  "packages": [
    {
      "name": "ami-xxxxxxxxxxxxxxxxx",
      "SPDXID": "SPDXRef-Vm-888578fefc6f6735",
      "primaryPackagePurpose": "SOURCE"
    },
    {
      "name": "amazon",
      "SPDXID": "SPDXRef-OperatingSystem-541077021f563a3e",
      "versionInfo": "2023",
      "primaryPackagePurpose": "OPERATING-SYSTEM"
    },
    {
      "name": "bash",
      "SPDXID": "SPDXRef-Package-2a97fe8298d3deed",
      "versionInfo": "4.2.46-34.amzn2023",
      "externalRefs": [
        {
          "referenceCategory": "PACKAGE-MANAGER",
          "referenceType": "purl",
          "referenceLocator": "pkg:rpm/amazon/bash@4.2.46-34.amzn2023?arch=x86_64"
        }
      ],
      "primaryPackagePurpose": "LIBRARY"
    },
    {
      "name": "opt/vuls-saas/vuls",
      "SPDXID": "SPDXRef-Application-d72df2bc81701c51",
      "attributionTexts": [
        "Type: gobinary"
      ],
      "primaryPackagePurpose": "APPLICATION"
    },
    {
      "name": "github.com/vulsio/go-exploitdb",
      "SPDXID": "SPDXRef-Package-59634f967256ffb1",
      "versionInfo": "v0.4.2",
      "externalRefs": [
        {
          "referenceCategory": "PACKAGE-MANAGER",
          "referenceType": "purl",
          "referenceLocator": "pkg:golang/github.com/vulsio/go-exploitdb@v0.4.2"
        }
      ],
      "primaryPackagePurpose": "LIBRARY"
    },
    ...
  ]

SPDXID is an ID for referring to a package within the SBOM. In "relationships", the relationships between packages are expressed with this ID.

The type of each entry in packages, the list of software in SPDX, is determined from primaryPackagePurpose or the SPDXID prefix (e.g., SPDXRef-OperatingSystem-xxxx). If either one of them matches the following table, the entry is imported as that type. The determination is made in order from the top row of the table, so a package that matches both OS and application is imported as OS information.

primaryPackagePurpose SPDXID prefix Import
OPERATING-SYSTEM SPDXRef-OperatingSystem-... Imported as OS information
APPLICATION SPDXRef-Application-... Imported as application information (a unit that groups dependency libraries). However, if the application type (the language or package manager type) cannot be identified from the information each generation tool provides, such as the PURL or name, it is imported as software of the software type private. In SBOMs from Amazon Inspector, BlackDuck, and FossID, it is not treated as application information; as in the row below, the software type is determined based on the PURL and CPE information
Other than the above (LIBRARY, FRAMEWORK, DEVICE, FIRMWARE, SOURCE, ARCHIVE, INSTALL, OTHER, or not specified) SPDXRef-Package-..., etc. If it is under an OS or an application, it is imported as either an OS package or a dependency library. If it is not, the software type is determined based on the PURL and CPE information, and it is imported

The actual software type of each package (os / library / private) is determined based on the PURL (referenceType: purl) or CPE (referenceType: cpe23Type / cpe22Type) information listed in externalRefs. For the determination rules, refer to "Component Type Determination". For the conditions under which CPEs are imported, refer to "CPE Information". License information listed in licenseConcluded / licenseDeclared is also imported.

relationships#

  "relationships": [
    {
      "spdxElementId": "SPDXRef-DOCUMENT",
      "relatedSpdxElement": "SPDXRef-Vm-888578fefc6f6735",
      "relationshipType": "DESCRIBES"
    },
    {
      "spdxElementId": "SPDXRef-Vm-888578fefc6f6735",
      "relatedSpdxElement": "SPDXRef-OperatingSystem-541077021f563a3e",
      "relationshipType": "CONTAINS"
    },
    {
      "spdxElementId": "SPDXRef-OperatingSystem-541077021f563a3e",
      "relatedSpdxElement": "SPDXRef-Package-2a97fe8298d3deed",
      "relationshipType": "CONTAINS"
    },
    {
      "spdxElementId": "SPDXRef-Vm-888578fefc6f6735",
      "relatedSpdxElement": "SPDXRef-Application-d72df2bc81701c51",
      "relationshipType": "CONTAINS"
    },
    {
      "spdxElementId": "SPDXRef-Application-d72df2bc81701c51",
      "relatedSpdxElement": "SPDXRef-Package-59634f967256ffb1",
      "relationshipType": "CONTAINS"
    },
    ...
  ]

relationships represents the relationships between elements. spdxElementId is the starting point of a relationship and relatedSpdxElement is the other end of it, and in both you write an SPDXID from packages (SPDXRef-DOCUMENT represents the SBOM document itself).

First, the relationshipType determines whether a relationship is treated as a dependency.

Category Examples of relationshipType Handling
Dependency / containment / linking DEPENDS_ON / CONTAINS / STATIC_LINK / DYNAMIC_LINK, the reverse-direction CONTAINED_BY / DEPENDENCY_OF, and the various *_DEPENDENCY_OF types (RUNTIME_DEPENDENCY_OF, etc.) Imported as a dependency
Metadata / provenance / lineage DESCRIBES / GENERATES / ANCESTOR_OF, etc. Not imported

Relationships imported as dependencies are interpreted after being aligned in the direction from the parent to the elements under it. For CONTAINS and DEPENDS_ON, spdxElementId is the parent and relatedSpdxElement is under it. For reverse-direction relationships such as CONTAINED_BY and DEPENDENCY_OF, relatedSpdxElement is the parent and spdxElementId is under it.

The relationships in the example above are as follows.

In the SPDX example, the relationships connected by CONTAINS from the scan target to the OS and the application, from the OS to bash, and from the application to go-exploitdb. DESCRIBES from DOCUMENT is not treated as a dependency

Starting point (spdxElementId) relationshipType Other end (relatedSpdxElement) Import in FutureVuls
SPDXRef-DOCUMENT DESCRIBES SPDXRef-Vm-888578fefc6f6735 (ami-xxxxxxxxxxxxxxxxx) Not treated as a dependency
SPDXRef-Vm-888578fefc6f6735 CONTAINS SPDXRef-OperatingSystem-541077021f563a3e (OS) The OS is identified
SPDXRef-OperatingSystem-541077021f563a3e CONTAINS SPDXRef-Package-2a97fe8298d3deed (bash) Imported as an OS package
SPDXRef-Vm-888578fefc6f6735 CONTAINS SPDXRef-Application-d72df2bc81701c51 (application) The application is identified
SPDXRef-Application-d72df2bc81701c51 CONTAINS SPDXRef-Package-59634f967256ffb1 (go-exploitdb) Imported as a dependency library
  • If the parent is an OS, the packages under it are imported as OS packages.
  • If the parent is an application, the packages under it are imported as dependency libraries.
  • Nested dependencies are imported recursively.
  • SPDXIDs that do not appear in any relationships are classified and imported according to "Component Type Determination". However, if one or more OS packages are imported from under the OS, OS packages that do not appear in any relationships are not imported. Packages whose primaryPackagePurpose is CONTAINER, FILE, or similar, and packages without a name (name), are not imported.