How do you secure a CI/CD pipeline from supply chain attacks?
Supply chain attacks (like SolarWinds, XZ Utils) target the build pipeline itself. Defense layers:
- Pin action versions: Use commit SHA, not floating tags like
@v2.uses: actions/checkout@abc123 - SBOM generation: Generate a Software Bill of Materials at build time using Syft.
- Image signing: Sign images with Cosign (Sigstore). Verify signatures before deployment.
- Least privilege: GitHub Actions tokens should have minimal permissions. Set
permissions: read-allby default. - Dependency review: Use Dependabot or Renovate for automated dependency updates.