release/reproducible-build/image
Release builds are reproducible
Implements release/reproducible-build for the image artifact: it runs when the release publishes one (see artifacts).
| Severity | info |
| Tiers | 1 |
| Artifact | image |
| Scope | root |
| Kind | outcome |
| Source | library v0.5.0 |
| Selected by | fleetlint-recommended@v0.5.0 |
Requirement
The image build fixes its timestamps: SOURCE_DATE_EPOCH is set for the build (buildx takes it from the environment and as a build argument) in the workflow that pushes the image or in the task runner, or the build’s output sets rewrite-timestamp=true.
Why
When anyone can rebuild a release bit for bit from the tag, a tampered artifact or a compromised build machine shows up as a mismatch.
Capability applies when
release.exists || repo.artifacts.size() > 0Parameters
skip:^\s*[@+-]*\s*(\{\{[^}]*\}\}\s*|\$[({][A-Za-z_]+[)}]\s*)?(#|//|echo\b|printf\b|(sudo\s+)?(go (install|get)|cargo b?install|pipx? install|pip3 install|python3? -m pip install|uv (tool |pip )?(install|add)|(npm|pnpm|yarn|bun) (i|install|add|global add)|gem install|bundle add|brew install|dotnet tool (install|update)|composer (global )?require|apt(-get)? install|curl|wget)\b[^;&]*$)
Fix
Export SOURCE_DATE_EPOCH=$(git log -1 --format=%ct) before the build step and pass it as a build argument; with buildx add rewrite-timestamp=true to the output options.
Agent instruction: Add the stack’s reproducibility settings to the release build and derive SOURCE_DATE_EPOCH from git log -1 --format=%ct; do not change what is built.
A finding of this rule points at the file artifact.workflows.size() > 0 ? artifact.workflows[0] : ".github/workflows/release.yml" yields.
Sources
- https://reproducible-builds.org/docs/ (standard, Achieve deterministic builds)
- https://reproducible-builds.org/docs/source-date-epoch/ (spec)
- https://fleetlint.org/baseline/#releases
- https://docs.docker.com/build/ci/github-actions/reproducible-builds/ (guidance)
Generated by fleetlint docs from catalog v0.5.0.