Skip to content

decouple SBOM generation from image build process #139

@tianon

Description

@tianon

Currently, we generate SBOMs as part of the image build process, but the only benefit we gain from doing so is marginal (rabbitmq uses ARG BUILDKIT_SBOM_SCAN_STAGE=true to scan non-final stages of the image, but the benefits gained from doing so are very unclear if existent at all).

If we decouple that and treat SBOMs as another separate "build" artifact that we can only generate once we have a build, and generate an sbomId from something like buildId + built image digest + SBOM scanning image digest, then we'd get some interesting benefits; notably:

  • SBOM scanner would no longer need to run on every architecture we want SBOMs for (they'd all run on a linux/amd64 instance regardless of image architecture)
  • SBOMs could be regenerated when the SBOM scanner image is updated (no longer requiring a rebuild of the image we're scanning to fix SBOM-specific issues)

Prior related art:

One way we could embed this is by adding an "sbom" key in builds.json next to "build" and "source" (whose order in that file I've been considering swapping, which would make it natural to have "source", "build", and then "sbom", listed in the order they have to be processed/exist).

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