How do GitHub Actions become a supply-chain risk, and how do you mitigate it?
AdvancedConceptSupply Chain, SBOM, Signing and Image/IaC Scanning
Answer
Third-party actions run with your job's token and secrets, and tags like @v3 can be moved by a compromised maintainer.
- Pin actions to a full commit SHA, with Dependabot to update them.
- Set
permissions:to least privilege (contents: readby default). - Avoid
pull_request_targetwith checkout of untrusted code. - Never interpolate untrusted input (
${{ github.event.issue.title }}) intorun:scripts; pass via env. - Use OIDC to cloud instead of stored keys, and restrict which actions are allowed at org level.
More on Supply Chain, SBOM, Signing and Image/IaC Scanning
What is a software supply chain attack? Give examples.BeginnerExplain dependency confusion and typosquatting.IntermediateWhat is an SBOM and why do we need one?BeginnerCycloneDX vs SPDX: how do they differ?IntermediateHow do you generate and use an SBOM with Syft and Grype?BeginnerWhat is VEX?Intermediate