Skip to content

SPDX Structure #58

@augelu-tng

Description

@augelu-tng

The SPDX standard provides namespaces each with its own classes and profiles that define rules for how to use these classes.
For now we focus on the Core and Software namespaces and profiles. However, the Core and Software profiles do not really specify strict rules which classes to use. To get a starting point the Lite profile is a useful reference but we won't adhere strictly to it.

The Getting Started Example used the Elements as follows:

graph TD
    
    Agent["Agent"]
    CreationInfo["CreationInfo"]
    Package["Software/Package"]
    File1["Software/File"<br>arch/x86/boot/bzImage]
    File2["Software/File"<br>arch/x86/boot/vmlinux.bin]
    Sbom1["Software/Sbom"]
    Document["SpdxDocument"]

    %% Relationships
    Document -->|rootElement| Sbom1
    Sbom1 -->|rootElement| Package
    Sbom1 -->|element| Package
    Sbom1 -->|element| File1
    Sbom1 -->|element| File2
    Package -->|contains| File1
    File2 -->|generates| File1
Loading

The overall element structure should be as described in the diagram above.

  • SpdxDocument single main entry point of the document
  • Software/Sbom one Sbom element having the Package as rootElement
  • Software/Package one Package
  • Software/File one File element for each node in the cmd graph

Relationships:

  • Package contains Files The package contains all source and output files
  • Files generates File An output file is generated from input files through a build step.

Open Questions:

  1. What spdxId schema should be used?
    For reference the schema used in the Getting Started Example is https://spdx.ord/spdxdocs/{entity-type}-{uuid}
  2. SpdxDocument/ElementCollection has element and rootElement. Should we set both to our single Software/Sbom Element? or should element include deeper elements as a flat list?
    A: rootElement should be the direct child. element should be a flat list of all transitive childs.
  3. Software/Package
    • copyrightText
    • name
    • packageVersion
      A: Use kernel build number provided as command line argument.
    • downloadLocation / packageUrl (git link to the repo?)
    • Relationship hasConcludedLicense (what to set here?)
    • Relationship hasDeclaredLicense (here we probably list all licenses that we found in the license headers of each source file in the package)
  4. Core/Agent
    • name (what should be used here?)
  5. Whats the role of the Build/Build class?
    A: Each node in the cmd graph is modeled as a Software/File element. The transition from one file to another is modeled as a Build/Build element. Each build element has a hasInput and hasOutput relationship which connects the build with the input and output File. This approach would get too big.
    There will be only one single Build/Build element that has all sources as input and the roots of the cmd graph as outputs.

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions