Interview Prep/GitHub Actions/OIDC & Security Hardening

What are artifact attestations and how do you verify one?

AdvancedConceptOIDC & Security Hardening
Answer

Signed SLSA build provenance generated in the workflow via Sigstore, linking an artifact digest to the repo, workflow, commit and run that built it.

permissions:
  id-token: write
  attestations: write
  packages: write
steps:
  - uses: actions/attest-build-provenance@v2
    with:
      subject-name: ghcr.io/devopsshack/shack-api
      subject-digest: ${{ steps.push.outputs.digest }}
      push-to-registry: true
gh attestation verify oci://ghcr.io/devopsshack/shack-api@sha256:... --owner devopsshack

Admission controllers (Kyverno, Sigstore policy-controller) can then require provenance before pods run.

All GitHub Actions questions Roadmap: GitHub Actions

More on OIDC & Security Hardening