
Why supply-chain attacks are high-impact
Supply chain attacks are particularly damaging because they break trust at the source. Common supply-chain risks include:- Vulnerable base images — pulling a public image that contains many known CVEs.
- Compromised dependencies — malicious packages injected into npm, PyPI, or Go modules during the build.
- Tampered artifacts — images or binaries modified between build and deploy.
- Unscanned images — artifacts reaching production without any vulnerability checks.

Four pipeline gates to enforce
A practical, enforceable delivery pipeline includes four gates. Each gate addresses a different threat class and should be automated in CI:
Image scanning with Trivy
Use image scanning as a hard gate in CI—not just informational output. Trivy is a widely used open-source scanner that finds vulnerabilities in OS packages, application dependencies, and common misconfigurations. Key CI behavior:- Fail the pipeline when unacceptable severities are found.
- Treat scanner errors as failures (don’t allow unknown scanner state to be an implicit pass).
- 0: no vulnerabilities found at the specified severities (pipeline can continue)
- 1: matching vulnerabilities found (pipeline should fail)
- 2: scanner error or unexpected problem (treat as a failure and investigate)
Treat a scanner error (exit code 2) as a pipeline failure. Silent failures or degraded scanners can let vulnerable images slip through.
Image signing with Cosign (Sigstore)
Signing artifacts proves provenance and integrity. Sigstore’s Cosign is a broadly adopted tool for signing container images and storing signatures in a registry. Why sign?- Provenance: shows the artifact originated from your pipeline.
- Integrity: proves the artifact hasn’t been altered since signing.
- Trust: restricts which identities/keys can create valid signatures.
- Cosign also supports keyless signing using Sigstore Fulcio and Rekor with CI OIDC tokens, removing the need to manage long-lived private keys. Keyless is typically recommended for CI automation where secret key management is harder to secure.
Complete automated flow
A typical automated flow in CI/CD:- Build the image with minimal base layers and reproducibility in mind.
- Scan the image with Trivy; if disallowed severities are found, fail the pipeline.
- Upon a clean scan, sign the image with Cosign (keyed or keyless).
- Push the signed image and stored signatures/attestations to your registry.
- Deploy—admission controls in the cluster verify signatures/attestations before allowing workloads.

Admission control: verifying signatures with Kyverno
Enforce policy at runtime by validating image signatures and attestations. The Kyverno ClusterPolicy below rejects Pod creation for images from your registry unless they verify against the embedded public key.Use a secure key management strategy (or keyless signing) and automate signing only after a successful scan to prevent accidental acceptance of unverified images.
SLSA and SBOM — what they are and why they matter
-
SLSA (Supply-chain Levels for Software Artifacts) provides a maturity model for build integrity:
- Level 1: documented builds and basic evidence
- Level 4: hermetic, reproducible builds with tamper-proof review and enforced provenance SLSA helps you reason about how much assurance your pipeline provides.
-
SBOM (Software Bill of Materials) lists components used in your software. When a CVE is disclosed, SBOMs help you quickly identify impacted services. Common SBOM formats include
SPDXandCycloneDX. Tools such asSyftandTrivycan generate SBOMs for images and artifacts.

Quick reference and recommended commands
- Block images with unacceptable vulnerabilities:
- Sign images with Cosign (key-based example):
- Enforce signed images with Kyverno by verifying signatures at admission.
Further reading and references
- Trivy: https://github.com/aquasecurity/trivy
- Cosign / Sigstore: https://sigstore.dev/
- Kyverno: https://kyverno.io/
- SLSA: https://slsa.dev/
- SBOM formats: https://spdx.dev/, https://cyclonedx.org/
- Syft (SBOM generation): https://github.com/anchore/syft