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.
More on OIDC & Security Hardening
How does GitHub OIDC work, end to end?IntermediateWhat are the `sub` claim formats, and which do you put in an AWS trust policy?AdvancedConfigure OIDC to AWS: provider, role and workflow.AdvancedConfigure OIDC to Azure.AdvancedConfigure OIDC to GCP.AdvancedWhy pin actions to a full commit SHA, and how do you keep pins updated?Intermediate