← All articles

Container Security Scanning: Images, Registries and Runtime

Container security scanning means checking container images, the registries that store them, and the containers actually running in production for known vulnerabilities, embedded secrets and risky configuration — at three different points in the lifecycle, because a clean image at build time doesn't guarantee a clean container at runtime. Most teams only do the first part. That's how exploitable packages ship for months without anyone noticing.

The scale of the problem is well documented. Sysdig's 2023 Cloud-Native Security and Usage Report found that 87% of container images have high or critical vulnerabilities, and an earlier academic study of 356,218 Docker Hub images found images carried 180+ known vulnerabilities on average across all versions. A more recent 2025 crawl of the highest-pull-count images on Docker Hub, published on arXiv, found 96.3% carry at least one known vulnerability and 93.4% carry a critical one. The good news from Sysdig's 2025 report is that the vulnerabilities actually reachable at runtime — the ones that matter for exploitability — have dropped to under 6% among organizations that prioritize this correctly. That gap between "vulnerabilities that exist" and "vulnerabilities that run" is the entire argument for scanning at more than one stage.

Why image, registry and runtime scanning aren't the same job

Each layer catches different problems, and skipping one leaves a blind spot the others can't cover.

LayerWhat it checksWhat it misses
Image scanning (build/CI)OS packages, language dependencies, Dockerfile misconfigurations, embedded secrets at build timeNew CVEs disclosed after the image shipped; runtime behavior
Registry scanningEvery stored image and tag, including old/unused ones; access controls on who can push and pullNothing about how the image behaves once deployed
Runtime scanningActual processes, open ports, privilege level, syscalls, and which vulnerable packages are loaded and reachableProblems in images that were never deployed (lower urgency, but still supply-chain risk)

NIST SP 800-190, the Application Container Security Guide, frames this the same way: it analyzes risk separately across images, registries, orchestrators, containers and the host OS, and recommends ongoing monitoring of registries specifically — not just one-time scans at push time — because images already stored can become vulnerable as new CVEs are disclosed against packages they contain. That single point is the one most teams get wrong: they scan on push and never rescan what's sitting in the registry.

Image scanning: what to actually catch

A container image scan should flag four categories of problems:

  • Known CVEs in OS packages and language dependencies — the base image's apt/apk/yum packages, plus anything pulled via pip, npm, go.mod, Gemfile, etc. This is the bulk of findings and the easiest to automate.
  • Embedded secrets — API keys, private keys, and tokens baked into layers during COPY or RUN steps, often left behind even after a later layer deletes the file (it's still in history). NIST SP 800-190 specifically calls out embedded malware and clear-text secrets as image-layer risks distinct from vulnerable packages.
  • Dockerfile/build misconfigurations — running as root, overly broad COPY . . statements that pull in .git or .env files, missing HEALTHCHECK, and unpinned base image tags like latest that silently change what you ship.
  • Stale or unmaintained base images — an image that hasn't been rebuilt in months accumulates every CVE disclosed against its base OS and packages since the last build, even if your application code hasn't changed at all.

A minimal, read-only way to inspect what's actually inside an image before you commit to a specific scanner:

# List installed OS packages in a built image (Debian/Ubuntu base)
docker run --rm <image>:<tag> dpkg -l

# Inspect image layer history for suspicious COPY/RUN steps
docker history --no-trunc <image>:<tag>

# Check for a non-root USER directive
docker inspect --format '{{.Config.User}}' <image>:<tag>

An empty result from the last command means the container defaults to root — worth fixing regardless of what a scanner flags, since it directly affects blast radius if the container is compromised.

Registry scanning: the part teams skip

Registries accumulate images faster than teams clean them up: every CI build pushes a tag, old releases stay around for rollback, and nobody owns deleting them. That turns a registry into an archive of images frozen at whatever vulnerability state existed on their push date. NIST SP 800-190 recommends registries enforce cryptographic image signing, restrict which registries are trusted at all, log every write and sensitive read, and — critically — maintain ongoing monitoring so images are rescanned as new CVEs are published against their contents, not just scanned once on upload.

Practical registry hygiene that most scanners won't enforce for you:

  1. Scope who can push. A registry with open write access is one leaked CI token away from a poisoned base image reaching every service that pulls FROM it.
  2. Delete or quarantine unused tags. An image nobody's pulled in six months is still a live attack surface if it's reachable and someone (or some stale pipeline) deploys it.
  3. Rescan on a schedule, not just on push. A package that was clean on push day can have a critical CVE disclosed the next week — the image doesn't change, but its risk does.
  4. Track provenance. Know which base image and build pipeline produced each image, so a compromised upstream base (a real supply-chain path) can be traced to every downstream image that inherited it.

Log4Shell (CVE-2021-44228) is the clearest illustration of why registry rescanning matters: years after disclosure, vulnerable Log4j instances still turn up in production, largely in container images that were built before the CVE existed and simply never rebuilt or rescanned since. The base image didn't change; the risk category it fell into did, the day the CVE went public.

Runtime scanning and configuration

Build-time scanning tells you what could run. Runtime scanning tells you what actually is — and attackers only care about the second one. This is also where CIS Benchmarks for Docker and Kubernetes do most of their work: the CIS Docker Benchmark's runtime section checks whether containers are running privileged, with writable root filesystems, with host namespaces shared, or with the Docker socket mounted inside — any one of which turns a contained compromise into a host compromise. The docker-bench-security open-source script automates these checks against a running host and tags each one PASS/WARN, which is a reasonable first pass before buying a dedicated runtime tool.

Runtime scanning should cover:

  • Privilege level — is the container running as root, privileged, or with capabilities it doesn't need (--cap-add, NET_ADMIN, SYS_ADMIN)?
  • Filesystem mounts — is the root filesystem read-only where it can be, and are sensitive host paths or the Docker socket ever mounted in?
  • In-use vulnerable packages — of all the CVEs an image carries, which ones are in packages actually loaded into a running process? This is the prioritization signal Sysdig's 2025 report credits for the drop in exploitable-at-runtime vulnerabilities among mature security teams.
  • Container escape primitives — runtime CVEs like CVE-2024-21626 ("Leaky Vessels"), a file-descriptor leak in runc that let a malicious image or exec call escape to the host filesystem, are exactly the class of flaw image scanning alone cannot catch, because the vulnerability is in the container runtime, not the image contents.

Where this fits with infrastructure-as-code and cloud scanning

Container risk rarely stays contained to the container. A misconfigured Kubernetes manifest or Terraform module can grant a pod the same host access that a runtime CVE would otherwise require exploiting — which is why infrastructure-as-code scanning belongs in the same pipeline as image and registry scans, catching privileged pod specs, missing resource limits, and open security groups before deployment. The same logic extends to the cloud layer hosting the containers: a cloud vulnerability scanner should flag the public buckets, open security groups and IAM over-permissions a compromised container could pivot into. None of this replaces manual review — automated scanning should run continuously in CI/CD, with a human pentest periodically validating that what the scanners call "critical" is actually exploitable in your environment.

How SecurityInfinity fits in

SecurityInfinity's image security scanner checks container images for known vulnerabilities, exposed secrets and risky build patterns, and the infrastructure-as-code audit checks the Terraform, Kubernetes and CloudFormation that define how those images get deployed and what privileges they're handed. Both run as part of the same autonomous agent that handles recon, web, network and secrets checks against domains you've verified ownership of — every finding ships with evidence and a specific remediation step, ranked by severity, not a raw CVE dump you have to triage yourself. If you need a signed report for a customer security questionnaire rather than an ongoing scan, a startup pentest covers application and infrastructure testing with a report and attestation letter in three business days. For teams building out a broader attack surface management practice, container registries and image repositories are an asset class worth including from day one, not bolted on after the first incident.

Run a scan against your own verified domains and registries at /scan, or compare plans on /pricing if you want continuous re-scans instead of a one-time check.

Frequently asked questions

What is container security scanning?

Container security scanning is the automated process of checking container images, the registries storing them, and running containers for known vulnerabilities (CVEs), exposed secrets, and risky configurations. It typically runs at three points: in CI when an image is built, continuously against images stored in a registry, and against containers actually running in production.

How often should container images be scanned?

Images should be scanned on every build and push, and registries should be rescanned on a recurring schedule — not just once — because new CVEs are disclosed against existing packages constantly. NIST SP 800-190 specifically recommends ongoing monitoring of stored images rather than a single scan at upload time.

What's the difference between image scanning and runtime scanning?

Image scanning inspects a container image's contents — OS packages, dependencies, secrets, Dockerfile patterns — before it ever runs. Runtime scanning checks the actual running container: privilege level, mounted filesystems, open capabilities, and which of the image's known vulnerabilities are in packages actually loaded into memory. A package can be "vulnerable" in the image but never reachable at runtime, which is why mature teams prioritize runtime-reachable findings first.

Do container vulnerability scanners catch container escape vulnerabilities?

Standard image scanners generally don't, because container escapes like CVE-2024-21626 in runc are flaws in the container runtime itself, not in the image's packages. Catching these requires keeping the container runtime (runc, containerd, Docker Engine) patched and, ideally, runtime behavioral monitoring or a CIS Benchmark audit of the host and daemon configuration.

Can a container image be secure and still get exploited?

Yes. An image can pass every scan clean and still be compromised through a vulnerability disclosed after the scan, a misconfigured runtime flag (privileged mode, mounted Docker socket), or an application-layer flaw like Log4Shell that scanning tools miss if they don't inspect nested JARs or shaded dependencies closely. This is why image scanning, registry rescanning and runtime checks are treated as separate, ongoing controls rather than a single pass/fail gate.

Find what attackers can see, before they do.

AI pentesting agents test your web app, API and cloud, and every finding comes with evidence and a fix. First report in about 10 minutes.

Stay ahead of attackers.

New vulnerabilities, breach write-ups and practical fixes. A few emails a month.