Prerequisites
- Target system, dependencies and environment configured.
Usage
Purpose
Between building an image and running it in production, a lot can go wrong: a malicious image pushed to your registry under a trusted name, a tampered image, or simply an unvetted image from an untrusted source deployed by mistake. Container image supply-chain security ensures only trusted, unmodified images run — through signing and verification. This skill covers signing images and enforcing that only signed, trusted images deploy, closing the build-to-deploy gap. It's the container-specific application of the software supply-chain domain.
When to use it
Hardening the path from image build to production deployment, especially where images come from multiple sources or the registry is a trust boundary. It pairs with admission control (which enforces the verification) and image scanning (which vets contents).
Procedure
- Understand the trust gap. An image tag (
myapp:latest) is just a pointer; without verification, you're trusting that whatever's behind that tag is what you think — but a compromised registry, a typosquatted image, or a supply-chain attack can put a malicious image there. Signing and verification close this gap by proving an image's origin and integrity.
- Sign your images. Use Sigstore/cosign to cryptographically sign images at build time, so their origin and integrity can be verified. Signing produces a signature tied to your identity/key that verification checks against:
cosign sign <registry>/myapp@sha256:<digest>
Sign the immutable digest, not a mutable tag.
- Verify signatures before deployment — the enforcement. Configure admission control (Kyverno/OPA, the admission-control skill) to reject any image that isn't signed by a trusted key. Now only images you signed (or that come from trusted, signed sources) can run; an unsigned or tampered image is blocked at deploy:
cosign verify <image> # verify manually
# + admission policy requiring valid signatures cluster-wide
- Pin images by digest, not tag. Tags are mutable —
latest (or even a version tag) can be repointed to a different image. Deploying by immutable digest (@sha256:...) ensures you run exactly the image you vetted and signed. Mutable-tag deployment undermines the whole chain.
- Restrict registries. Allow images only from approved registries (enforced via admission control), so an image from an untrusted or public registry can't be deployed. Combine with signing — trusted source and valid signature.
- Generate and check provenance/SBOM. Attach build provenance (how and where the image was built — SLSA) and an SBOM (what's inside — the supply-chain domain) so you can verify the build's integrity and inventory its contents, and check both at admission where possible.
- Automate the whole chain in CI/CD. Build → scan → sign → push → (at deploy) verify. Each step automated and enforced so a human can't skip it. This is the container application of the DevSecOps pipeline discipline.
Cheatsheet
build-to-deploy trust gap: a TAG is just a pointer -> compromised registry / typosquat /
supply-chain attack can put a malicious image behind a trusted name.
signing + verification close it (prove ORIGIN + INTEGRITY).
1. SIGN images (Sigstore/cosign) at build — sign the immutable DIGEST not a tag
cosign sign registry/app@sha256:<digest>
2. VERIFY before deploy (enforcement): admission control (Kyverno/OPA) rejects unsigned
-> only images signed by a trusted key can run
3. PIN by DIGEST not tag (tags mutable — `latest`/version can be repointed)
-> run exactly the image you vetted+signed
4. RESTRICT registries (approved only, via admission) — trusted source AND valid signature
5. PROVENANCE (SLSA) + SBOM: how/where built + what's inside -> verify integrity + inventory
6. AUTOMATE in CI/CD: build -> scan -> sign -> push -> (deploy) verify. enforced, unskippable.
Reading the chain
- Deploying images with no signature verification = you're trusting the tag blindly; a compromised registry or a malicious image pushed under a trusted name runs unchecked. Signing plus admission-enforced verification closes this — a high-value control.
- An admission policy requiring signed images from approved registries = only trusted, verified images can run; an unsigned, tampered, or untrusted-source image is blocked at deploy. The enforcement that makes signing meaningful.
- Deploying by mutable tag (
latest or a version tag) = the tag can be repointed to a different image after you vetted it; you may run something other than what you signed. Pin by digest.
- Signing without verification enforcement = signatures nobody checks protect nothing; the value is in admission rejecting unsigned images. Signing and verification must go together.
- Provenance and SBOM attached and checked = you can verify how the image was built and what's inside, catching build tampering and known-vulnerable contents.
- A fully automated build→scan→sign→push→verify pipeline = the strong state; only trusted, signed, vetted images reach production, and no step can be skipped.
The fix / best practice
- Sign images at build with Sigstore/cosign, signing the immutable digest.
- Enforce signature verification at admission — reject unsigned images cluster-wide (admission-control skill), so signing actually gates deployment.
- Deploy by digest, not tag, to run exactly what you vetted and signed.
- Restrict to approved registries and require both trusted source and valid signature.
- Attach and check provenance (SLSA) and SBOM for build integrity and content inventory.
- Automate the whole chain in CI/CD so build, scan, sign, and verify are enforced and unskippable.
Pitfalls
- No verification at deploy. Signing without admission-enforced verification is pointless — signatures nobody checks protect nothing. Enforce verification.
- Trusting tags. Mutable tags can be repointed to malicious images after vetting; deploy by immutable digest.
- Verifying source but not signature (or vice versa). A trusted registry can still be compromised; require both an approved source and a valid signature.
- Manual, skippable steps. If signing/verification isn't automated and enforced in the pipeline, someone skips it. Bake it into CI/CD as a hard gate.
- Ignoring provenance/SBOM. Signing proves origin but not that the build wasn't tampered or that contents are safe; add provenance and SBOM checks.
References
- Sigstore / cosign documentation and the SLSA framework
- The software-supply-chain-security domain (sbom-generation, artifact-signing) — the general case
- The admission-control and container-image-scanning skills
- Kyverno/OPA image verification policies; NIST SP 800-190
Inputs
- Relevant source code, logs, network traces, or system specifications.
Outputs
- Analysis findings, security audit report, or generated code artifacts.
1---2name: supply-chain-for-images3description: Use when securing the container image supply chain — signing and verifying images so only trusted, unmodified images run, closing the gap between building and deploying.4---5678## Prerequisites9- Target system, dependencies and environment configured.1011## Usage12### Purpose1314Between building an image and running it in production, a lot can go wrong: a malicious image pushed to your registry under a trusted name, a tampered image, or simply an unvetted image from an untrusted source deployed by mistake. Container image supply-chain security ensures only trusted, unmodified images run — through signing and verification. This skill covers signing images and enforcing that only signed, trusted images deploy, closing the build-to-deploy gap. It's the container-specific application of the software supply-chain domain.1516### When to use it1718Hardening the path from image build to production deployment, especially where images come from multiple sources or the registry is a trust boundary. It pairs with admission control (which enforces the verification) and image scanning (which vets contents).1920### Procedure21221. **Understand the trust gap.** An image tag (`myapp:latest`) is just a pointer; without verification, you're trusting that whatever's behind that tag is what you think — but a compromised registry, a typosquatted image, or a supply-chain attack can put a malicious image there. Signing and verification close this gap by proving an image's origin and integrity.232. **Sign your images.** Use Sigstore/cosign to cryptographically sign images at build time, so their origin and integrity can be verified. Signing produces a signature tied to your identity/key that verification checks against:24 ```25 cosign sign <registry>/myapp@sha256:<digest>26 ```27 Sign the immutable digest, not a mutable tag.283. **Verify signatures before deployment — the enforcement.** Configure admission control (Kyverno/OPA, the admission-control skill) to reject any image that isn't signed by a trusted key. Now only images you signed (or that come from trusted, signed sources) can run; an unsigned or tampered image is blocked at deploy:29 ```30 cosign verify <image> # verify manually31 # + admission policy requiring valid signatures cluster-wide32 ```334. **Pin images by digest, not tag.** Tags are mutable — `latest` (or even a version tag) can be repointed to a different image. Deploying by immutable digest (`@sha256:...`) ensures you run exactly the image you vetted and signed. Mutable-tag deployment undermines the whole chain.345. **Restrict registries.** Allow images only from approved registries (enforced via admission control), so an image from an untrusted or public registry can't be deployed. Combine with signing — trusted source *and* valid signature.356. **Generate and check provenance/SBOM.** Attach build provenance (how and where the image was built — SLSA) and an SBOM (what's inside — the supply-chain domain) so you can verify the build's integrity and inventory its contents, and check both at admission where possible.367. **Automate the whole chain in CI/CD.** Build → scan → sign → push → (at deploy) verify. Each step automated and enforced so a human can't skip it. This is the container application of the DevSecOps pipeline discipline.3738### Cheatsheet3940```41build-to-deploy trust gap: a TAG is just a pointer -> compromised registry / typosquat /42 supply-chain attack can put a malicious image behind a trusted name.43 signing + verification close it (prove ORIGIN + INTEGRITY).44451. SIGN images (Sigstore/cosign) at build — sign the immutable DIGEST not a tag46 cosign sign registry/app@sha256:<digest>472. VERIFY before deploy (enforcement): admission control (Kyverno/OPA) rejects unsigned48 -> only images signed by a trusted key can run493. PIN by DIGEST not tag (tags mutable — `latest`/version can be repointed)50 -> run exactly the image you vetted+signed514. RESTRICT registries (approved only, via admission) — trusted source AND valid signature525. PROVENANCE (SLSA) + SBOM: how/where built + what's inside -> verify integrity + inventory536. AUTOMATE in CI/CD: build -> scan -> sign -> push -> (deploy) verify. enforced, unskippable.54```5556### Reading the chain5758- **Deploying images with no signature verification** = you're trusting the tag blindly; a compromised registry or a malicious image pushed under a trusted name runs unchecked. Signing plus admission-enforced verification closes this — a high-value control.59- **An admission policy requiring signed images from approved registries** = only trusted, verified images can run; an unsigned, tampered, or untrusted-source image is blocked at deploy. The enforcement that makes signing meaningful.60- **Deploying by mutable tag** (`latest` or a version tag) = the tag can be repointed to a different image after you vetted it; you may run something other than what you signed. Pin by digest.61- **Signing without verification enforcement** = signatures nobody checks protect nothing; the value is in admission rejecting unsigned images. Signing and verification must go together.62- **Provenance and SBOM attached and checked** = you can verify how the image was built and what's inside, catching build tampering and known-vulnerable contents.63- **A fully automated build→scan→sign→push→verify pipeline** = the strong state; only trusted, signed, vetted images reach production, and no step can be skipped.6465### The fix / best practice6667- **Sign images at build** with Sigstore/cosign, signing the immutable digest.68- **Enforce signature verification at admission** — reject unsigned images cluster-wide (admission-control skill), so signing actually gates deployment.69- **Deploy by digest, not tag**, to run exactly what you vetted and signed.70- **Restrict to approved registries** and require both trusted source and valid signature.71- **Attach and check provenance (SLSA) and SBOM** for build integrity and content inventory.72- **Automate the whole chain in CI/CD** so build, scan, sign, and verify are enforced and unskippable.7374### Pitfalls7576- **No verification at deploy.** Signing without admission-enforced verification is pointless — signatures nobody checks protect nothing. Enforce verification.77- **Trusting tags.** Mutable tags can be repointed to malicious images after vetting; deploy by immutable digest.78- **Verifying source but not signature (or vice versa).** A trusted registry can still be compromised; require both an approved source and a valid signature.79- **Manual, skippable steps.** If signing/verification isn't automated and enforced in the pipeline, someone skips it. Bake it into CI/CD as a hard gate.80- **Ignoring provenance/SBOM.** Signing proves origin but not that the build wasn't tampered or that contents are safe; add provenance and SBOM checks.8182### References8384- Sigstore / cosign documentation and the SLSA framework85- The software-supply-chain-security domain (sbom-generation, artifact-signing) — the general case86- The admission-control and container-image-scanning skills87- Kyverno/OPA image verification policies; NIST SP 800-1908889## Inputs90- Relevant source code, logs, network traces, or system specifications.9192## Outputs93- Analysis findings, security audit report, or generated code artifacts.