What is a reproducible build and why do security teams care?
AdvancedScenarioSupply Chain Security
Answer
Situation read → A build is reproducible if independent builders produce bit-identical output from the same source.
What I'd do →
- Pin toolchains and base images by digest; avoid network access during build.
- Remove nondeterminism: timestamps (
SOURCE_DATE_EPOCH), file ordering, random IDs, locale. - For Go use
-trimpathand-buildvcs=false; for Docker use BuildKit with--output type=oci,rewrite-timestamp=true. - Rebuild on a second, independent builder and compare digests.
Why → Matching hashes show the binary was not tampered with in the build system, which was the SolarWinds failure mode.
Interview tip → Say "hermetic plus deterministic".
More on Supply Chain Security
What is an SBOM, and at which point in the pipeline do you generate it?BeginnerA customer asks for an SBOM for your product. What do you give them?BeginnerHow do you sign container images in GitHub Actions without managing private keys?IntermediateYou signed images in CI. How do you make sure the cluster only runs signed images?IntermediateLeadership wants "SLSA compliance". What do you propose?IntermediateWhat is typosquatting and how do you protect developers from it?Beginner