Interview Prep/DevSecOps/Supply Chain Security at Scale

How do you use GitHub artifact attestations for build provenance, and how do consumers verify them?

IntermediateProductionSupply Chain Security at Scale
Answer

GitHub's actions/attest-build-provenance creates a Sigstore-signed SLSA provenance attestation for an artifact or image digest and stores it with GitHub (and optionally pushes it to the registry).

permissions:
  id-token: write
  attestations: write
  packages: write
steps:
  - uses: actions/attest-build-provenance@v2
    with:
      subject-name: ghcr.io/acme/api
      subject-digest: ${{ steps.push.outputs.digest }}
      push-to-registry: true

Verify before deploy:

gh attestation verify oci://ghcr.io/acme/api@sha256:abc... --owner acme
All DevSecOps questions Roadmap: Supply chain, secrets & identity

More on Supply Chain Security at Scale