Software supply chain security
Threats
Compromised dependencies (malicious package versions, typosquatting, dependency confusion), compromised build systems (tampered CI, malicious actions/plugins), tampered artifacts in registries, leaked publishing credentials. Real-world examples: SolarWinds (build compromise), Codecov (CI script tampered), xz-utils (backdoored upstream), compromised GitHub Actions leaking secrets.
SBOMs
A Software Bill of Materials lists every component and version in an artifact — formats SPDX and CycloneDX. Generate at build time (Syft, Trivy, CycloneDX Maven/Gradle plugins, docker buildx --sbom=true), store alongside the image (as an attestation), and query when a new CVE drops ("which running images contain log4j-core 2.14?"). Tools like Dependency-Track ingest SBOMs for continuous monitoring.
Signing and provenance
- Sigstore cosign signs images and attestations. Keyless signing: CI uses its OIDC identity (e.g. GitHub Actions workflow identity) to get a short-lived certificate from Fulcio; signatures are logged in the Rekor transparency log — no long-lived signing keys to protect. Key-based signing with AWS KMS keys is the alternative.
cosign sign --yes 123456789012.dkr.ecr.ap-south-1.amazonaws.com/orders@sha256:abc...
cosign verify \
--certificate-identity-regexp 'https://github.com/acme/orders/.github/workflows/.*' \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
123456789012.dkr.ecr.ap-south-1.amazonaws.com/orders@sha256:abc...
- Provenance (SLSA): a signed statement of how an artifact was built — source repo, commit, builder, parameters. GitHub's
actions/attest-build-provenance, SLSA GitHub generators. - Verify at admission: Kyverno
verifyImages, Sigstore policy-controller, or Gatekeeper + Ratify — only images signed by your CI identity (and with provenance from your repos) may run. Reference images by digest, not mutable tags.
SLSA levels (simplified)
| Level | Requirement |
|---|---|
| Build L1 | Provenance exists |
| Build L2 | Hosted build platform, signed provenance |
| Build L3 | Hardened build platform — isolated, ephemeral builds; provenance can't be forged by the build's tenant |
Hardening the pipeline itself
- Least-privilege CI tokens, OIDC to clouds, no long-lived secrets on runners.
- Ephemeral, isolated runners; untrusted PR code never gets secrets.
- Pin actions/plugins/base images by digest/SHA; restricted allow-lists.
- Protected branches, required reviews, CODEOWNERS for pipeline and IaC files.
- Separate build and deploy identities; production deploy needs approvals.
- Audit logs of the CI system shipped centrally.