Build Security
Make builds reproducible, isolated and free of untrusted inputs so outputs can be trusted.
AdvancedBuild SecuritySupply ChainInfrastructure
Where it fits in the lifecycle
- Plan
- Code
- Build
- Test
- Release
- Deploy
- Operate
- Monitor
- Build Dependency scanning, image scanning, SBOM generation and signing.
Overview
A hardened build pins its toolchain, resolves dependencies from controlled mirrors, runs without privileged access and emits the same output for the same input.
Why it matters
If the build environment is mutable and network-open, the artefact cannot be reasoned about.
How it works
- 01Toolchain and base images are pinned by digest.
- 02Dependencies come from an internal proxy with retention.
- 03Builds run rootless in an ephemeral sandbox.
- 04Output digests and an SBOM are recorded per build.
Common tools
BuildKitKanikoSyftDockerKubernetesGitHub
Implementation examples
bashRootless image build
buildah bud --isolation chroot --pull=always -t app:$GIT_SHA .Best practices
- Pin everything by digest.
- Use an internal dependency proxy.
- Tag artefacts with the commit SHA.
Common mistakes
- Mounting the host Docker socket into build jobs.