How do you harden GitHub Actions workflows overall?
IntermediateProductionSupply Chain and Pipeline Security
Answer
permissions: contents: readat top; elevate per job.- Pin third-party actions to commit SHAs; Dependabot to update them.
- Allow-list actions at org level.
- No
${{ github.event.* }}interpolation insiderun:; use env vars. - Prefer OIDC to static cloud secrets; environment-scoped secrets with reviewers.
persist-credentials: falseon checkout.- Ephemeral runners; no self-hosted runners on public repos.
- Lint with
actionlintandzizmor; CODEOWNERS on.github/workflows. - Use
harden-runnerstyle egress monitoring for sensitive workflows.
More on Supply Chain and Pipeline Security
What is a software supply chain attack, and where does the pipeline fit?BeginnerWhat is an SBOM and why do you generate one in CI?BeginnerHow do you sign container images and verify them at deploy time?IntermediateWhat is SLSA and which level should a typical team aim for?IntermediateHow do you verify provenance before deploying?AdvancedHow do you scan images and dependencies in the pipeline without drowning in noise?Intermediate