DevSecOpsNov 04, 2026·10 min

Container Image Security: Scanning, Signing, and Admission Control in the Registry Pipeline

TV
TechVRS Research & Engineering Lab

Production systems architecture, technical SEO, and cloud-native security research.

#Containers#Image Security#DevSecOps#Supply Chain
Executive Summary & Key Findings

How scanning, signing, and admission control work together to stop vulnerable or tampered container images reaching production.

Container images are where modern supply chain risk quietly accumulates. A developer pulls a base image, adds code and dependencies, pushes the result to a registry, and that image is deployed hundreds of times. Every layer can carry a known vulnerability or tampered binary, and once in the registry it tends to be trusted implicitly. The registry is not just storage; it is the last checkpoint before production, where scanning, signing, and admission control either work together or fail separately.

Many teams treat scanning as a checkbox: a scanner runs in CI, produces a long report, and nobody blocks the build. Others sign images but never verify the signature at admission, so the signature is decoration. Still others enforce admission so strictly that developers bypass it with exceptions that never expire. None of these is secure alone. Security comes from a pipeline where each stage has a clear job and a clear failure mode.

This article describes a practical pipeline: scan early and continuously, sign only what passed, and enforce admission at the cluster so unsigned or vulnerable images cannot run even if pushed directly. It covers tooling, policy design, and the trade-offs that determine whether the pipeline survives real delivery pressure.

#Quick Answer: Scan, Sign, Then Enforce at Admission

Scan every image in CI and again in the registry, fail the build on fixable critical and high vulnerabilities with a documented exception process, sign the image with a signer such as Sigstore cosign, and configure the cluster admission controller to verify the signature and scan result before any pod starts. Scanning without enforcement is reporting. Signing without verification is theatre. Admission control turns both into a guarantee, because it is the one place an attacker or hurried developer cannot skip by pushing directly to the registry.

The pipeline has three gates. The first runs in CI, where feedback is fastest. The second runs in the registry, where images are re-scanned so newly disclosed vulnerabilities are caught even for images built weeks ago. The third runs at admission, where the cluster checks the signature and verdict for the exact digest being deployed. If any gate fails, the image does not run. Exceptions are time-boxed, recorded, and visible, not silent overrides.

#How Image Scanning Actually Works

A scanner does not inspect your running container. It unpacks image layers, inventories OS packages and language dependencies, and matches them against vulnerability databases. That explains both its value and its limits: it is excellent at finding a known CVE in an installed package, but poor at judging whether that code path is reachable, whether the package is loaded at runtime, or whether a custom binary carries a flaw no database knows about.

What scanners check, and what they miss

Most scanners cover OS packages from the base distribution, such as Debian, Alpine, or Red Hat packages, plus application dependencies in common ecosystems. Tools such as Trivy and Grype follow this model, and registry scanners increasingly add secret and malware detection. What they do not reliably cover is proprietary code, artifacts downloaded at runtime, and packages installed then deleted in a later layer, which can still appear in earlier layers.

False positives are a real cost. A vulnerability in a library your application never calls still appears in the report, and a team triaging hundreds of findings per image will eventually ignore it. The remedy is prioritisation: distinguish fixable from unfixable findings, use reachability analysis where supported, and track age and severity rather than raw count.

Scanning in CI versus scanning in the registry

CI scanning gives developers feedback before the image becomes deployable. Build the image, scan it, and fail the pipeline when the policy threshold is exceeded:

yam

Scan a built image in CI and fail on critical findings

  • name: Scan image
  • run: |
  • trivy image --severity HIGH,CRITICAL \
  • --exit-code 1 --ignore-unfixed \
  • my-registry.example.com/my-app:${{ github.sha }}
  • ```

The --ignore-unfixed flag is a deliberate trade-off: it reduces noise, but some known flaws ship. Document that choice, and revisit it for internet-facing workloads. Registry scanning serves a different purpose: vulnerabilities are disclosed daily, so an image clean at build time can become vulnerable a week later. Scheduled re-scans surface that drift. Decide in advance what happens then: quarantine, alert the owning team, or merely update a dashboard. Alerting with a short remediation window is often the workable middle ground, while admission control blocks new deployments that exceed the threshold.

#Reducing the Attack Surface Before Scanning

Scanning finds problems; a smaller image has fewer to find. Base image selection is the highest-leverage decision here, and it is often made once and never revisited. A full OS base image with a package manager, shell, and hundreds of utilities gives an attacker tools and a scanner hundreds of packages to flag. A minimal or distroless base image removes the shell and package manager, shrinks the inventory, and makes post-exploitation harder.

Multi-stage builds are the other essential technique. Build dependencies, compilers, and test tooling belong in a builder stage that is discarded. Only the compiled artifact and its runtime dependencies land in the final image:

dockerfil

Multi-stage build: build tools never reach the final image

FROM golang:1.23 AS builder WORKDIR /src COPY . . RUN CGO_ENABLED=0 go build -o /app/server ./cmd/server

FROM gcr.io/distroless/static-debian12 COPY --from=builder /app/server /server USER nonroot:nonroot ENTRYPOINT ["/server"] ```

Running as non-root, setting a read-only root filesystem where possible, and dropping unnecessary Linux capabilities are complementary controls. They do not replace scanning, but they shrink the blast radius of an exploit. Pin base images by digest rather than mutable tag, and keep a short approved list so teams are not each inventing their own.

#Signing Images with Cosign

Scanning answers "is this image known to be vulnerable?" Signing answers a different question: "did this exact image come from the pipeline I trust, and has it been altered since?" Without signing, anyone with registry push credentials, or anyone who compromises such a credential, can push a malicious image under a familiar tag and have it deployed. Tags are mutable pointers. Digests are content addresses. Signing binds trust to the digest.

Cosign supports two models. Key-based signing uses a private key held by CI, often in a hardware module or secrets manager, with the public key distributed to verifiers. Keyless signing uses an OpenID Connect identity, such as a GitHub Actions workflow identity, and records a transparency log entry in Rekor. Keyless removes long-lived private keys, but verifiers must check the identity and issuer, not merely the presence of a signature.

Sign by digest, not by tag, after scanning passes:

bas

Sign the image by digest after scanning passes

cosign sign --yes \ my-registry.example.com/my-app@sha256:9f2c...a1b4 ```

A signature on a tag can be confused when the tag moves; a signature on a digest covers exactly one immutable artifact. Also consider signing an attestation recording what the pipeline did, such as which scanner ran and its result, so admission policy can check provenance rather than trusting a bare signature. The signature proves origin; the attestation proves process.

Key management deserves honest attention. A signing key stored in the same CI system that builds the image is only as secure as that CI system; an attacker who can run arbitrary pipeline jobs can sign malicious images. Mitigations include a protected environment for signing, short-lived OIDC identities tied to a specific repository and workflow, and monitoring the transparency log. Signing does not make a compromised pipeline safe. It makes tampering detectable and attributable, which is the realistic goal.

#Admission Control: The Gate That Cannot Be Skipped

Admission control is where the pipeline becomes enforceable. A Kubernetes admission controller, such as Sigstore policy-controller, Kyverno, or Gatekeeper, intercepts pod creation and verifies the image before the kubelet pulls it. If verification fails, the pod is rejected; there is nothing to roll back, because the workload never started.

Policy design is where teams usually fail. Blocking everything on day one creates an emergency exception culture. A better rollout runs the controller in audit mode first, collects violations for a week or two, fixes legitimate gaps, and then switches to enforce mode namespace by namespace. For third-party images you did not build, mirror them into your own registry, scan them there, and re-sign them under your identity after they pass, making your registry the trust boundary.

A Kyverno policy can also require digests instead of tags and block unapproved registries:

yam

Kyverno sketch: require digests

apiVersion: kyverno.io/v1 kind: ClusterPolicy metadata: name: require-image-digest spec: validationFailureAction: Enforce rules: - name: require-digest match: any: - resources: kinds: [Pod] validate: message: "Images must be referenced by digest, not tag." pattern: spec: containers: - image: "@sha256:" ```

Admission control also needs a boring, auditable break-glass procedure. Bypassing policy during an incident is legitimate, but it should require a second approver or short-lived token, log every use, and trigger review the next business day. A permanent annotation any developer can add is not break-glass; it is a hole. Likewise, exceptions for vulnerable images need an expiry date, an owner, and a ticket reference, and expired exceptions must fail closed.

For teams already running DevSecOps gates, image admission is the natural extension: earlier gates catch problems in code, the registry pipeline catches problems in the artifact that ships. A related guide on DevSecOps pipeline security covers the CI-side gates; the principle is the same: fail early, keep exceptions visible, enforce at the last checkpoint.

#Operating the Pipeline Day to Day

A pipeline that works in a demo and fails under delivery pressure is common, and the failure modes are predictable. Scanner databases lag, so a fresh CVE appears in the news before it appears in the scanner. Thresholds set so low that every build fails teach developers to re-run until the scanner flakes. Signing breaks when OIDC issuers change or certificates expire, and the on-call engineer disables verification to unblock a deploy at 2 a.m. Each is a process problem as much as a tooling problem.

Set thresholds deliberately. Failing on fixable criticals is a reasonable default. Failing on every high finding may be right for internet-facing services, but it requires a fast patching cadence or the pipeline becomes a bottleneck teams route around. Measure what matters: time from disclosure to patched image in production, percentage of running images signed and verified, rejections by admission control and why, and exception age. If exception age grows, the exception process is broken, not the scanner.

Keep the feedback loop short. A developer who learns about a vulnerable base image three days later, via a dashboard nobody reads, will not fix it promptly. A developer who gets a CI failure naming the package, the fixed version, and a one-line upgrade command will. Automate where possible: update bots for base images, rebuilds on scanner database releases, and automatic promotion of patched images through staging when tests pass. The secure path must also be the easy path, or it will be bypassed the first time a deadline collides with it.

#Frequently Asked Questions

Should I scan images in CI, in the registry, or both?

Both, for different reasons. CI scanning blocks bad images before publication. Registry scanning catches newly disclosed vulnerabilities in images clean when built. If you can only do one, start with CI scanning plus admission control, then add scheduled re-scans. An image sitting un-scanned for months is an unknown, not a known-good artifact.

Is signing worth it if I already scan everything?

Yes. Scanning says the image has no known criticals at scan time. Signing says this exact digest came from your trusted pipeline and has not been replaced since. Without signing, a compromised registry credential lets an attacker push a malicious image that skips scanning entirely.

What do I do about third-party images I cannot sign?

Mirror them into your own registry, scan them there, and re-sign them under your identity after they pass. This makes your registry the trust boundary. If mirroring is not feasible, allowlist specific digests for specific namespaces, with an owner and expiry, rather than allowing an entire public registry.

How do I handle vulnerabilities with no available fix?

Distinguish the risk honestly. An unfixed flaw in an unreachable package is lower priority than one in a network-facing dependency. Options include switching base image or library, applying a compensating control such as a network policy, or accepting the risk with a time-boxed exception and review date. Revisit findings when a fix appears, which is what scheduled re-scans are for.

Does a distroless base image eliminate the need for scanning?

No. Distroless images reduce package inventory and attack surface, so usually fewer findings and a harder target, but application dependencies and remaining runtime packages still need scanning. A vulnerable library in a distroless image is just as exploitable as one in a full image. Distroless complements scanning; it does not replace it.

#Sources and Further Reading

  • Sigstore cosign documentation: https://docs.sigstore.dev/cosign/
  • Trivy documentation: https://aquasecurity.github.io/trivy/
  • NIST Special Publication 800-190, Application Container Security Guide: https://csrc.nist.gov/pubs/sp/800/190/final
  • OWASP Container Security Cheat Sheet: https://cheatsheetseries.owasp.org/cheatsheets/Container_Security_Cheat_Sheet.html
  • Kubernetes documentation on admission control: https://kubernetes.io/docs/reference/access-authn-authz/admission-controllers/
  • CNCF supply chain guidance and SLSA overview: https://slsa.dev/
Engineering Advisory

Implementing this architecture in your production stack?

TechVRS engineers design, audit, and scale high-performance web applications, technical SEO pipelines, and autonomous AI systems for global businesses.