Skip to content

Embedding SPDX into binaries #739

@tofay

Description

@tofay

Embedding package information into binaries can enable SCA tools and scanners to detect dependencies and check them for vulnerabilities, without needing a separate mechanism to transfer an SBOM.

  1. golang binaries embed dependency information in them by default, and scanners like trivy and syft can detect those dependencies.
  2. Embed CPE names into binaries ossf/wg-vulnerability-disclosures#76 seeks a solution to enable scanners to detect software in self-compiled (i.e non-distro packaged) software, as is commonly the case in container images
  3. A prototype for embedding Rust dependency information into Rust binares: https://github.com/Shnatsel/rust-audit/. This currently embeds a Rust specific, compressed JSON section into binaries. The Rust Secure Code Working Group is exploring whether an existing, language-agnostic format could be used instead.

SPDX, or SPDX Lite, documents could seemingly be embedded into a binary by a producer and detected by scanning tools. Some possible drawbacks:

  1. SPDX documents must contain the date of creation of the document. For this to co-exist with reproducible builds creators of tools to embed SPDX into binaries would need to consider options at reproducible-builds.org/de/docs/timestamps/
  2. The SPDX document couldn't meaningfully contain a checksum of the binary itself
  3. Increase in binary size. rust-audit compresses dependency info using zlib, which SPDX could also allow

Are there any reasons that would make SPDX/SPDX Lite an unsuitable format for this use case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    serializationRepresentation of data in bytes

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions