What Is Container Image Scanning?
Container image scanning checks images for known vulnerable packages and dependencies before and after deployment. See how scanning fits into Kubernetes security.
What Is Container Image Scanning?
Container images carry more than application code. They can include a base operating system, system packages, language runtimes, open-source libraries, application dependencies, binaries, and configuration files. A vulnerable component added at any stage can move with the image into a registry and later into production.
Container image scanning examines those components for known software vulnerabilities. The scanner identifies packages and dependencies inside an image, determines their versions, and compares them with vulnerability intelligence.
Kubernetes recommends scanning images during creation and deployment, keeping production images minimal, and using immutable digests or verified signatures when referencing artifacts.
Image scanning therefore gives development, platform, and security teams a way to assess the software inside a container before Kubernetes creates a workload from it.
How container images create inherited software risk
A container image is built from layers.
The first layers often come from a base image. Later layers can install packages, copy application files, add language dependencies, and define how the container starts.
That model makes container development efficient because teams can reuse common components. It also means vulnerabilities can be inherited.
Consider an organization using the same Linux base image for 40 internal applications. If that base contains an affected package, the same finding can appear across every downstream image built from it.
The application teams may not have selected that package themselves. It arrived through the base.
Container security therefore needs visibility into both application dependencies and inherited image components.
CNCF guidance published in 2026 recommends packaging only what an application needs, using smaller images, avoiding credentials and build tools inside production artifacts, scanning regularly, and verifying image integrity.
How container image scanning works
An image scanner first identifies the software contained in the artifact.
Depending on the scanner, that can include operating system packages such as RPM, DEB, or APK packages and application dependencies managed through ecosystems such as npm, pip, Maven, or other package systems.
The scanner then compares version information with known vulnerability records.
A finding can contain the affected package, installed version, vulnerability identifier, severity information, and an available corrected version when one exists.
The scan result gives teams evidence about known software weaknesses inside the artifact.
Some products also inspect configuration files, secrets, licenses, or malware. Those capabilities should be treated separately because they are not automatically part of every image vulnerability scanner.
Scanning should begin during the build
Waiting until an image reaches production increases remediation effort.
A better point for the first assessment is the CI/CD pipeline.
After an image is built, the pipeline can inspect it before the artifact is approved for a production registry. Development teams can then replace an affected package, change the base image, rebuild the artifact, and run the assessment again.
Kubernetes' application security checklist specifically recommends scanning an image before containers are deployed into a cluster.
The Kubernetes project itself uses a similar multi-stage model for its own release images. Its 2026 image promotion pipeline introduced separate phases for provenance verification, validation, artifact promotion, signing, attestations, vulnerability assessment, and SBOM support.
The broader lesson is that image assessment works best as part of the delivery process rather than as a separate security task performed after deployment.
One scan does not remain valid forever
An image can remain unchanged while its security status changes.
A package may have no known CVE when the image is built. A vulnerability can be disclosed later. The next assessment of the same artifact can then identify a finding that did not exist in the original scan results.
Nothing changed inside the image.
The available vulnerability information changed.
Registry images therefore need periodic reassessment even if developers have not rebuilt them.
Running workloads also need to be associated with their image versions so teams can determine whether a newly reported vulnerability affects production.
A scan performed six months ago should not be treated as permanent evidence that an image remains free of known vulnerabilities.
Image digests provide precise artifact identity
Teams also need to know exactly which image was assessed.
Image tags are references that can change.
A tag such as production, v3, or latest may point to one artifact today and another artifact later.
An image digest identifies a specific image manifest.
Kubernetes recommends referencing images through SHA-256 digests or validating artifact provenance using signature verification.
Digest-based tracking makes vulnerability records more precise.
Instead of saying "version 3 passed scanning," teams can associate the assessment with the exact image artifact that Kubernetes later deployed.
That connection becomes important during incident investigation and remediation.
Base images need their own assessment cycle
Updating application code does not automatically correct the base image.
Teams should monitor which base images their development groups use and how often those images receive updated packages.
An affected base image creates a dependency chain.
The base needs to be replaced or rebuilt. Applications that inherit from it then need to be rebuilt. The resulting artifacts need another assessment before deployment.
CNCF's 2026 work around hardened images emphasizes smaller package sets, non-root execution, transparency, and reducing inherited software risk for downstream projects.
Smaller images do not guarantee safe software, but they reduce unnecessary packages that require vulnerability assessment and maintenance.
Registry scanning catches vulnerabilities disclosed later
Container registries are another useful assessment point.
Images often remain stored long after a build pipeline has completed.
Registry assessment can identify new findings in artifacts that development teams have not touched recently.
The registry can also become the connection between vulnerability information and deployment decisions.
An organization may keep 500 historical images but run only 40 of them in production.
Finding a vulnerability in all 500 matters for inventory. Identifying which affected images are currently supporting production workloads matters for remediation order.
Registry data becomes more valuable when it is connected to Kubernetes deployment data.
Running workloads provide security context
Image scanning answers what known vulnerabilities exist inside the artifact.
It does not tell the whole story about risk after deployment.
The same vulnerable image may run in two very different workloads.
One might support an isolated development job with no sensitive permissions.
Another might run an internet-accessible production application with access to sensitive data and a Kubernetes service account with broad permissions.
The software finding is identical.
The operational risk is not.
Teams should therefore associate image findings with the cluster, namespace, workload, network reachability, workload privileges, service account, and business function.
That context helps security teams decide which vulnerable images need remediation first.
Image scanning and posture assessment answer different questions
An image can contain no known vulnerable packages and still be deployed with unsafe Kubernetes settings.
The container could run as root.
The pod could run with excessive Linux capabilities.
A host filesystem could be mounted into the container.
The workload could use a service account with unnecessary RBAC permissions.
Network controls could allow communication with services the application does not need.
Kubernetes security guidance treats image assessment alongside workload privileges, RBAC, admission controls, network policies, secrets, and API security because each control addresses a different part of workload security.
Image scanning should therefore feed Kubernetes posture assessment rather than be treated as the entire container security process.
Severity alone should not decide remediation order
Large registries can produce thousands of vulnerability findings.
Sorting them only by CVSS can create a remediation queue without deployment context.
Teams also need to know whether the image is running, how many workloads use it, whether those workloads are externally reachable, whether exploitation is practical, whether a corrected package exists, and what access the workload has.
An image used by a public production application may require faster remediation than the same affected package in an unused development artifact.
Security teams should therefore combine vulnerability severity with deployment and workload context.
Image scanning has technical limits
Image assessment primarily deals with software that can be identified inside the artifact and matched with known information.
It cannot identify every container risk.
A previously unknown vulnerability may not be detected because no vulnerability record exists yet.
A malicious dependency may not have a CVE.
A vulnerable container runtime installed on the node is outside the application image.
Weak Kubernetes RBAC, unsafe network rules, insecure admission configuration, and abnormal runtime behavior also require other security controls.
Image scanning is therefore one input into container security, not a replacement for cluster, workload, identity, or runtime assessment.
Remediation should happen at the source image
Containers should generally be treated as replaceable artifacts.
If a package inside an image is vulnerable, the preferred remediation path is to update the dependency or base image, rebuild the container image, reassess the artifact, publish the corrected version, and redeploy the workload.
Changing packages manually inside a running container creates a temporary state.
Kubernetes may later replace that container from the original image, bringing the affected package back.
The correction therefore needs to exist in the source artifact used for deployment.
Verification should confirm the corrected image is running
Building a corrected image does not mean remediation is complete.
Teams should confirm that the new artifact passed assessment, the expected digest reached the registry, Kubernetes deployed the intended image, and workloads no longer run the affected artifact where remediation was required.
Rollout failures can leave some replicas running an earlier image.
Rollback mechanisms can also restore the older artifact.
Post-remediation assessment should therefore confirm the actual Kubernetes workload state rather than relying only on CI/CD success.
The role of container image scanning in Kubernetes security
Container image scanning provides software vulnerability visibility before and after an image reaches Kubernetes.
The process identifies packages, maps them to known vulnerabilities, supports earlier correction during development, and helps security teams reassess existing artifacts when new vulnerabilities are published.
The results become more useful when they are connected with workload context.
Security teams need to know not only which image contains a vulnerable component but also where that image is running, what the workload can access, and whether its Kubernetes configuration increases the effect of exploitation.
Image scanning answers an important question.
Which known software weaknesses are present in the artifact?
Kubernetes posture assessment answers the next one.
What does that weakness mean in the environment where the image is running?
Connecting those two views gives security teams a more useful basis for remediation.
