release/reproducible-build/dotnet
Release builds are reproducible
Implements release/reproducible-build for dotnet.
| Severity | info |
| Tiers | 1 |
| Stacks | dotnet |
| Scope | root |
| Kind | outcome |
| Source | library v0.4.0 |
| Selected by | fleetlint-recommended@v0.4.0 |
Requirement
ContinuousIntegrationBuild is true for CI builds (in a project or Directory.Build.props, or -p:ContinuousIntegrationBuild=true in the release workflow), which maps source paths away; deterministic compilation is the SDK default. Or SOURCE_DATE_EPOCH is set for the release build.
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.existsFix
Add <ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild> to Directory.Build.props.
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.
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://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props (spec, ContinuousIntegrationBuild)
- https://fleetlint.org/stacks/#net
Generated by fleetlint docs from catalog v0.4.0.