- Goal: provably verify that code going in matches binary coming out
- Use cryptographically strong functions (e.g. SHA-256 hash)
- Calculate hash values (and store them) separately and securely
- Define the build environment specifications explicitly
- Isolate the build environment
- Log all activities in the build pipeline, and audit randomly
- In development environment:
- Create hash from pushed code and store it
- In CI part of pipeline:
- Pull copy of repo
- Hash pulled code when the build runs
- Compare hashes -- if same, continue
- Build code
- Create hash from binary/runtime and store it
- Rest of pipeline work
- In CD part of pipeline:
- Get binary, runtime files (if needed)
- Hash files
- Compare to previous hash -- if same, continue
- Deploy binary