
Why supply-chain security matters
Supply chain attacks are especially damaging because they subvert trust at the source — if the build produces a compromised artifact, every deployment that consumes it is at risk. Typical vectors include:- Vulnerable base images (public images with known CVEs).
- Compromised dependencies (malicious packages injected into NPM, PyPI, Go modules, etc., during build).
- Tampered artifacts (images modified after build and before deploy).
- Unscanned images promoted straight to production without gating.
The four pipeline gates
A robust delivery pipeline enforces four gates. Each gate addresses distinct threat classes and, together, they greatly reduce supply-chain risk.
Image scanning (CI gate)
Image scanning finds known vulnerabilities in OS packages and application dependencies. Trivy is a common open-source scanner that integrates well into CI pipelines.- Goal: Fail the pipeline if unacceptable severities (e.g., CRITICAL, HIGH) are detected.
- Coverage: OS packages, language dependencies, container images, and IaC misconfigurations (depending on configuration).
Image signing (provenance and integrity)
Signing proves that an image was produced by your pipeline, and that it hasn’t been tampered with since signing. Cosign (part of Sigstore) is a modern, well-supported tool for signing container images. It supports both key-based and keyless (OIDC-based) signing. Typical Cosign flow:Keyless signing (Sigstore) simplifies key management: your CI workflow uses the OIDC identity to sign and records attestations in a public transparency log. Use key-based signing when you need stricter private-key control.
Full pipeline flow (recommended)
A secure build-and-release pipeline typically follows this sequence:- Write code and run unit/CI tests.
- Build a minimal, reproducible container image (multi-stage, pinned dependencies).
- Generate an SBOM for the image (optional but recommended).
- Scan the image with Trivy/Grype; fail on policy violations.
- If scan passes, sign the image with Cosign.
- Push signed image + attestation to the registry.
- Cluster admission enforces signature/SBOM/SLSA requirements before allowing runtime Pod creation.

Admission control (runtime enforcement)
Signing is only effective if the cluster enforces it at admission time. Kyverno or Gatekeeper (OPA) can verify Cosign signatures and attestations when Pods are created. Example Kyverno ClusterPolicy that enforces image signatures from your registry:SLSA and SBOM (supply-chain standards)
SLSA (Supply-chain Levels for Software Artifacts) and SBOMs (Software Bill of Materials) provide frameworks and artifacts to reason about and audit supply-chain integrity.
SLSA levels (high-level):
Generate SBOMs during CI so you can quickly answer “Which services are affected?” when a CVE is disclosed. Tools like Syft or Trivy can produce SPDX or CycloneDX outputs that integrate with your vulnerability management workflow.

Best practices and recommendations
- Enforce the scan gate in CI with fail-on-severity flags (e.g., CRITICAL,HIGH).
- Keep base images and dependencies pinned and minimal.
- Use multi-stage builds and Distroless or scratch images where possible.
- Produce and store SBOMs alongside artifacts and scan them for affected services when CVEs appear.
- Sign images and attestations (key-based or keyless) and enforce verification at admission time.
- Maintain a small, auditable set of signing identities/keys and rotate them periodically.
- Automate everything — human gaps enable attackers; CI/CD should be the source of truth.
Wrap-up
The secure delivery pipeline enforces the four gates: Build (minimal/pinned images), Scan (Trivy with failing exit codes for policy), Sign (Cosign key-based or keyless), and Admit (Kyverno/Gatekeeper verifying signatures and attestation). Together, these controls materially reduce risk from supply-chain compromises. Quick command reminders:Links and references
- Trivy (image & SBOM scanning): https://github.com/aquasecurity/trivy
- Cosign (Sigstore image signing): https://github.com/sigstore/cosign
- Sigstore: https://sigstore.dev
- Kyverno: https://kyverno.io
- Gatekeeper (OPA): https://github.com/open-policy-agent/gatekeeper
- SLSA: https://slsa.dev
- SPDX: https://spdx.dev
- CycloneDX: https://cyclonedx.org
- Syft (SBOM generation): https://github.com/anchore/syft