restate icon indicating copy to clipboard operation
restate copied to clipboard

Publish SBOM for Restate Docker images using cargo-auditable

Open tillrohrmann opened this issue 9 months ago • 3 comments

Summary

Add support for publishing Software Bill of Materials (SBOM) for Restate Docker images to aid deployment-time security scanning.

Motivation

An SBOM would allow users to scan Restate images for known vulnerabilities in Rust dependencies at deployment time. This is increasingly important for enterprise deployments and compliance requirements.

Proposed Implementation

Use cargo-auditable to bake dependency metadata directly into ELF binaries. This tool:

  • Embeds dependency information in a compressed format in the binary
  • Adds minimal overhead (~5KB for a typical project)
  • Is compatible with vulnerability scanners like cargo audit
  • Follows the Rust RFC for dependency metadata

Steps

  1. Add cargo-auditable to the build toolchain
  2. Build binaries with cargo auditable build instead of cargo build
  3. Optionally export SBOM in standard formats (SPDX, CycloneDX) during CI

References

  • Suggested by @pcholakov in #4330
  • cargo-auditable GitHub
  • Related: Docker image refresh workflow (#4330), cargo update workflow (#4341)

tillrohrmann avatar Feb 05 '26 18:02 tillrohrmann

Hi @tillrohrmann , I'd like to pick this up if it's still wanted.

Proposed approach, keeping it small:

  1. dev-tools: add cargo-auditable (pinned) to the existing cargo install line, so it's in the toolchain image.
  2. restate: bump to that dev-tools tag, add an opt-in auditable flag to the just build recipe (local builds unchanged), and use it in docker/Dockerfile. For the release binaries, set cargo-auditable = true in dist-workspace.toml (supported since cargo-dist 0.26).
  3. Verify with syft/trivy on the built image (Rust crates in restate-server visible before vs. after) and check sccache still hits, since the two have had issues in the past.

Two questions before I start:

  • Are you OK with the tool living in restatedev/dev-tools, or would you rather install it in docker/Dockerfile directly?
  • For the optional SBOM export (step 3 in the issue), do you prefer BuildKit's sbom: true attestation on the image, or a separate SPDX/CycloneDX file on the release?

gypsy5oul avatar Sep 24 '26 07:09 gypsy5oul

+1, would be awesome to see this sometime.

Quick note on trivy: last time we tested it, it was extremely prone to false-positives. We use Amazon Inspector in production for Restate Cloud and find it very accurate. I'd rather not run verification at all, and leave that concern to consumers, than adopt a noisy gate in the build.

pcholakov avatar Sep 24 '26 07:09 pcholakov

Thanks @pcholakov, agreed. To clarify: I'm not proposing any scan or gate in CI. I'd only use trivy/syft locally, once, to show in the PR that the Rust crates inside restate-server become visible after the change. Nothing in the build would fail on findings.

That actually fits your point: cargo-auditable (plus an optional SPDX/CycloneDX file) just gives consumers accurate data to feed into whatever scanner they already use.

gypsy5oul avatar Sep 24 '26 08:09 gypsy5oul