Pcornel
Browse topics
Options
Recent
Favorites
Containers · Technical reference

Image Vulnerability Scanning and Signing

Direct answer

Image vulnerability scanning finds known CVEs in OS packages and libraries (Trivy, Grype, registry scanners); signing (Sigstore cosign, Notation) proves who built an image so admission can verify it.

When to use this

Use it to keep vulnerable or untrusted images out of production.

First 30 seconds

1. trivy image <img> — critical/high CVEs with fixes?

2. Rebuild on an updated base.

3. Sign: cosign sign <img>@<digest>; verify: cosign verify.

4. Admission policy enforcing signatures?

5. Rescan regularly.

Operational verification

build → scan → sign → push → admission verifies → run

Context & applicabilityCommon mistakes · platform/version boundaries
Platform / version applicability
Docker / containerd / Podman / Kubernetes / OCI-compatible platforms
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformDocker / containerd / Podman / Kubernetes / OCI-compatible platforms
Scope / prerequisiteUse it to keep vulnerable or untrusted images out of production.
What next?2 suggested next steps
Evidence0
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

2 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 How to verify Verify boundary

Fail the pipeline on critical findings with a fix available. Verify signatures against the digest, not the tag. Keep the SBOM so new advisories can be checked without rescanning every image.

Step 2 Common failures Narrow the fault

Scanning only at build time misses vulnerabilities published later. Signing a tag instead of a digest shows nothing about content. Distroless or static images may show few findings because the scanner cannot read a package database, not because there is no risk.

Key points

Scan in CI and on a schedule — new CVEs appear for old images. Fix by updating the base image and rebuilding. Enforce signatures with an admission controller (Kyverno, Gatekeeper, Connaisseur).

Key checks
  • trivy image <img> — vulnerability scan
  • docker ps -a — containers and exit codes
  • docker logs <c> — container output
  • docker inspect <c> — config, mounts, network, state
ReferenceWhat it is1 section · depth on demand

How it works

Scanners read package databases inside layers and match versions against advisories. Signatures are stored in the registry next to the image digest. Admission controllers or policy engines can refuse unsigned images or images with critical findings.

ReferenceImportant terms & boundaries2 sections · depth on demand

In depth

Scanning answers what is inside; signing answers who built it and whether it changed. They solve different problems and are usually combined in the pipeline.

Pipeline order

1. Build the image and push it; record the digest.

2. Generate an SBOM (for example syft) and attach it to the digest.

3. Scan the image or SBOM (trivy, grype); fail on agreed severities that have a fix.

4. Sign the digest (cosign sign registry/app@sha256:…), key-based or keyless (OIDC identity + transparency log).

5. At deploy time an admission policy verifies the signature and, optionally, the SBOM or vulnerability attestation.

Worked verification

cosign verify registry.example.com/app@sha256:9f2c… \
  --certificate-identity-regexp 'https://github.com/org/app/.*' \
  --certificate-oidc-issuer https://token.actions.githubusercontent.com

A successful verify prints the signature payload with the digest that was signed. Verifying a tag only proves that the tag currently points at signed content.

Reading scan results sensibly

FindingAction
Critical/High with a fixed versionRebuild on the fixed base or package; block release
No fix availableRecord an exception with an expiry date; check exploitability
In a package the app never loadsStill remove it — smaller images have fewer findings

Re-scan stored SBOMs regularly: new advisories appear for images that were clean when built.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.

Common mistakes

  • Scanning images but not blocking critical findings.
ReferenceConfiguration & state1 section · depth on demand

Scanning and signing commands

trivy image --severity HIGH,CRITICAL registry.example.com/app:1.4.2
grype registry.example.com/app:1.4.2
syft registry.example.com/app:1.4.2 -o cyclonedx-json > sbom.json
cosign sign --key cosign.key registry.example.com/app@sha256:<digest>
cosign verify --key cosign.pub registry.example.com/app@sha256:<digest>

Documented example, not captured output. Scan in CI and continuously in the registry; enforce signatures at admission (Kyverno, Sigstore policy-controller).

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
image vulnerability scanning and signingtrivy image scancosign image signing
Confirmation

Confirm action

Continue?