Publish SBOM for Restate Docker images using cargo-auditable
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
- Add
cargo-auditableto the build toolchain - Build binaries with
cargo auditable buildinstead ofcargo build - 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)
Hi @tillrohrmann , I'd like to pick this up if it's still wanted.
Proposed approach, keeping it small:
- dev-tools: add
cargo-auditable(pinned) to the existingcargo installline, so it's in the toolchain image. - restate: bump to that dev-tools tag, add an opt-in
auditableflag to thejust buildrecipe (local builds unchanged), and use it indocker/Dockerfile. For the release binaries, setcargo-auditable = trueindist-workspace.toml(supported since cargo-dist 0.26). - Verify with
syft/trivyon the built image (Rust crates inrestate-servervisible 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 indocker/Dockerfiledirectly? - For the optional SBOM export (step 3 in the issue), do you prefer BuildKit's
sbom: trueattestation on the image, or a separate SPDX/CycloneDX file on the release?
+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.
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.