Use it to keep vulnerable or untrusted images out of production.
Image Vulnerability Scanning and Signing
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.
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.
build → scan → sign → push → admission verifies → run
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
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.
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).
trivy image <img>— vulnerability scandocker ps -a— containers and exit codesdocker logs <c>— container outputdocker 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
| Finding | Action |
|---|---|
| Critical/High with a fixed version | Rebuild on the fixed base or package; block release |
| No fix available | Record an exception with an expiry date; check exploitability |
| In a package the app never loads | Still remove it — smaller images have fewer findings |
Re-scan stored SBOMs regularly: new advisories appear for images that were clean when built.
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
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.