Container vulnerability scanning checks every package inside a container image, from base OS packages to application dependencies, against published CVEs. My approach scans at three points: in the CI pipeline before push, in the registry as new CVEs appear, and against the images running in production.
At a glance
- What gets scanned: OS packages in the base image, language dependencies, binaries copied into the image
- Where to scan: CI build (gate before push), registry (continuous rescan), runtime (what is deployed now)
- Base image strategy: Minimal or distroless base, pinned digests, scheduled rebuilds
- Triage order: Fix available, internet-facing, known exploited, package in use, base image or application layer
- Example remediation targets: Emergency 48 hours, Critical 7 days, High 30 days, Medium and Low 90 days
- Unfixable vulnerabilities: Recorded as a Risk Acceptance with an owner and a review date
- Framework fit: SOC 2 CC7.1 and CC8.1, ISO/IEC 27001:2022 Annex A 8.8
What does container vulnerability scanning check?
Container vulnerability scanning reads the software inventory of an image and matches each package version against vulnerability data. A container image scan covers three kinds of content:
- Base image OS packages: the Debian, Ubuntu, Alpine or other distribution packages that come with the
FROMimage. - Language dependencies: npm, pip, Go modules, Maven and other packages the build installs.
- Copied binaries and leftovers: tools, runtimes and caches the build copies in or forgets to remove.
A container vulnerability scanner works from the image contents, so the scan needs no running container and no network access to production. The scan reports known CVEs in installed software. Misconfigurations, exposed secrets and flaws in custom code need other checks, and the guide to what a vulnerability scan is covers scan types and the gaps each scan type leaves.
Container images also go stale on their own. An image with zero findings on build day collects new CVEs every week as researchers publish them, with no code change at all. Covering that drift takes scans after build time as well.
Where should container image scanning run: CI, registry or runtime?
Container image scanning works best at three points, because each point answers a different question:
| Scan point | Question answered | Typical setup |
| CI build | Is the new image safe to push? | Scanner step after docker build, fails the pipeline on Critical or High with a fix available |
| Registry | Has a new CVE appeared in an image already pushed? | Registry-native scanning on push plus continuous rescans |
| Runtime | Which vulnerable images are deployed right now? | Inventory of running images by digest, matched to registry findings or scanned on a schedule |
Key insight
The CI scan gates new images, and the registry and runtime scans catch drift.
A pipeline gate stops a known-vulnerable image from reaching the registry. The registry and runtime scans find the vulnerabilities published after the image was built. A pipeline gate never sees those later CVEs.
Registry-native scanning differs by provider, and the details affect coverage:
- Amazon ECR basic scanning covers OS packages, triggered on push or manually. ECR enhanced scanning integrates with Amazon Inspector, covers OS and programming language packages, and rescans continuously, updating results as new vulnerabilities appear (AWS documentation).
- Google Artifact Analysis scans images on upload to Artifact Registry once scanning is turned on for the repository, then keeps the results current only for images pulled within the last 30 days (Google Cloud documentation). An image deployed once and never pulled again stops getting updated results, so a long-running workload needs a runtime check as well.
The runtime view answers the question auditors and incident responders ask first: which digests are running in production today. A registry can hold hundreds of old tags that nothing deploys. Matching findings to the running digests keeps remediation work on images that serve traffic.
How does a small team set up container scanning in CI?
A small team can set up container scanning in CI with one open-source scanner and three triggers. One SaaS company with fewer than 10 people, running containerized infrastructure and starting a SOC 2 program, had no scanning process and no dedicated security engineer. The team added an open-source container scanner to the CI/CD pipeline in the source control platform, with three triggers:
- Scheduled run (daily or weekly), to catch new CVEs in unchanged images.
- Every merge to the main branch, to scan each image before deployment.
- Manual run, for ad hoc checks when a new advisory comes out.
A failed scan sends an email to the team, and a passing scan is logged. The team planned to connect the pipeline output to the GRC platform, so the auditor sees a timeline of scan results over the audit period. After setup, the evidence stream needs no manual effort.
Key insight
A scheduled trigger turns a build-time check into continuous monitoring.
Scans on merge cover only images that change. The scheduled run covers the images that stay the same while new CVEs are published against them.
The CI/CD security automation guide covers SAST, SCA and DAST in the same pipeline, with a GitHub Actions example.
Which container vulnerability scanners are commonly used?
Container vulnerability scanners fall into open-source CLI tools, registry-native services and agent-based platforms. Examples include:
| Container vulnerability scanner | Type | What the scanner covers |
| Trivy (open source) | CLI, CI step | Container images, filesystems, repositories, Kubernetes clusters and SBOMs |
| Grype (open source, Anchore) | CLI, CI step | Container images, filesystems and SBOMs, including SBOMs from Syft |
| Amazon ECR scanning | Registry-native | Basic: OS packages. Enhanced (Amazon Inspector): OS and language packages, continuous |
| Google Artifact Analysis | Registry-native | OS and language packages in Artifact Registry images, continuous for recently pulled images |
| Agent-based platforms | Runtime | Hosts and running containers with the vendor agent installed |
Choose the container vulnerability scanner by where the images are built and stored, and by where the results need to go. A GRC platform integration and a ticketing integration save more time than small differences in CVE coverage. For agent-based options on servers and containers, see the SOC 2 vulnerability scanner comparison of Datadog, Wazuh and Nessus.
How does base image strategy reduce container vulnerabilities?
Base image strategy removes more container vulnerabilities than triage does, because every package left out of the image is a CVE nobody has to track. My approach uses four practices:
- Minimal or distroless base images. Distroless images contain only the application and the runtime dependencies, with no package manager or shell (GoogleContainerTools distroless). Slim and Alpine variants also cut package counts.
- Multi-stage builds. Compilers, build tools and package caches stay in the build stage and never reach the final image. On one small firm's server, a cloud scanner reported vulnerabilities in old copies of Node, Python and npm left on disk by past CI jobs. Scanners report any vulnerable binary present, whether or not anything loads the binary, so leftovers inflate the count.
- Pinned digests. Reference the base image as
image@sha256:...instead of a moving tag, so every build uses a known base and every change to the base image is a reviewed commit. - Scheduled rebuilds. Rebuild images on a schedule (weekly, in my approach) even without application changes, so base image patches reach production. Tools such as Dependabot or Renovate can open the digest update as a pull request.
Pinned digests and scheduled rebuilds work together. Pinning makes every base image change visible and reviewable. Scheduled rebuilds make sure the pinned base does not age for months.
How should a team triage container scan results?
A team should triage container scan results by fix availability first, then exposure, then whether the vulnerable package is in use. A container image scan often returns dozens of results, and the CVSS severity alone says little about risk in a specific environment. The risk-based vulnerability management guide explains the full method. For container images, my triage questions are:
- Is a fix available? A fixed version means the work is a dependency bump or a rebuild. No fix means the vulnerability goes to the exception process. Trivy, for example, has an
--ignore-unfixedflag that hides vulnerabilities with no fix, and keeps the CI gate focused on work the team can do. Record every hidden vulnerability in the exception register. - Is the container internet-facing? An exposed API container gets priority over an internal batch job.
- Is the CVE known to be exploited? A listing in the CISA Known Exploited Vulnerabilities catalog moves the vulnerability to the Emergency tier.
- Is the package in use? A vulnerable library the application loads carries more risk than a utility the image carries but never runs. Removing unused packages is often faster than patching them.
- Which image layer holds the package? The answer names the owner of the fix.
| Where the vulnerable package is | Owner of the fix | Usual fix |
| Base image OS package | Platform or infrastructure team | Update the base image digest and rebuild |
| Application dependency | Development team | Bump the version in the lockfile and rebuild |
| Leftover build tool or cache | Whoever owns the Dockerfile | Multi-stage build or remove the files |
What remediation SLAs and exceptions fit container images?
Container images can follow the same remediation targets as the rest of the vulnerability management program. The vulnerability management policy template sets these targets, with the clock starting at detection:
| Severity | Criteria | Remediation target |
| Emergency | Critical or High, internet-facing, and known exploited or with a public exploit | 48 hours |
| Critical | CVSS 9.0 to 10.0 | 7 calendar days |
| High | CVSS 7.0 to 8.9 | 30 calendar days |
| Medium and Low | CVSS 0.1 to 6.9 | 90 calendar days |
For containers, the clock most often starts with a registry or runtime finding, when a new CVE appears in an image already in production. The fix is a rebuild and redeploy, so the remediation target has to allow for the release process.
Exceptions need a record outside the scanner. Each ignore-file entry or suppressed finding needs a matching Risk Acceptance with:
- The CVE and the affected images
- The reason, for example no fix available or package unused
- Any compensating control
- An approver and a review date
Ignore-file entries without a review date tend to stay forever. The SOC 2 vulnerability risk acceptance guide covers the approval workflow and what auditors sample.
Key insight
Container scanning cadence should follow exposure.
One insurtech team scanned internet-facing production weekly and reviewed internal infrastructure quarterly. The same tiering works for images: scan internet-facing services on every build and continuously in the registry, and give internal tooling images a lighter schedule.
What evidence does container vulnerability scanning produce for SOC 2 and ISO 27001?
Container vulnerability scanning produces audit evidence as a byproduct of the pipeline: dated scan runs, findings, fixes and approved exceptions. An auditor looks for a timeline of scan results across the whole audit period.
| Framework | Requirement | Container scanning evidence |
| SOC 2 CC7.1 | Detection and monitoring procedures to identify configuration changes that introduce new vulnerabilities and susceptibilities to newly discovered vulnerabilities (AICPA Trust Services Criteria) | CI scan history on schedule and on merge, registry findings, sampled vulnerabilities closed within target |
| SOC 2 CC8.1 | Change management | Pull requests for base image digest updates and dependency bumps, pipeline gate results |
| ISO/IEC 27001:2022 A.8.8 | Obtain information about technical vulnerabilities, evaluate exposure and take appropriate measures (ISO/IEC 27001:2022) | Scan records, triage decisions, rebuild records, Risk Acceptances |
For container-specific threats beyond image vulnerabilities, such as registry, orchestrator and host risks, NIST SP 800-190, Application Container Security Guide, is a useful reference.
How do you start container vulnerability scanning?
A team starting container vulnerability scanning can have a working setup in a few days. My order of work:
- Add a scanner step to CI after the image build, failing on Critical and High vulnerabilities with a fix available.
- Add a scheduled run and a manual trigger, with failure notifications to a monitored channel.
- Turn on registry scanning, with continuous rescans where the registry supports them.
- Fix the base image: move to a minimal base, pin the digest, set a rebuild schedule.
- Write the triage and exception rules into the vulnerability management policy, and connect scan output to the ticketing system or GRC platform.
How does container scanning fit the vulnerability management capability?
Container vulnerability scanning is one part of the vulnerability management capability, one of the roughly 19 security capabilities in an effective security program. A security capability assessment scores where the capability stands today and sequences the fixes. GRC engineering services connect pipeline scan output to the GRC platform so evidence collects itself.
Make container scanning audit-ready
Truvo builds the effective security program behind the scanner, from triage rules to evidence the auditor samples.
Frequently asked questions
What is container vulnerability scanning?
Container vulnerability scanning checks the packages inside a container image, including base image OS packages and application dependencies, against known CVEs. Teams typically scan in the CI pipeline before an image is pushed, in the registry as new CVEs are published, and against the images running in production, then fix or formally accept each result.
What is the difference between container image scanning and runtime container scanning?
Container image scanning inspects an image file in CI or in the registry, before or after the image is pushed. Runtime container scanning looks at the images deployed now, matched by digest. Image scanning stops vulnerable builds, and runtime scanning shows which vulnerable images serve traffic today, including images built before a CVE was published.
Which tools scan Docker images for vulnerabilities?
Examples include the open-source CLI scanners Trivy and Grype, registry-native scanning such as Amazon ECR scanning (basic, or enhanced with Amazon Inspector) and Google Artifact Analysis, and agent-based platforms for running containers. Choose by where images are built and stored, and by which GRC platform and ticketing system the results feed.
How often should container images be scanned?
A practical cadence is a scan on every merge to the main branch, a scheduled scan at least weekly, continuous registry rescans where supported, and a manual trigger for new advisories. Scheduled rebuilds, weekly in many setups, move base image patches into production even when the application code is unchanged.
What should a team do with container vulnerabilities that have no fix?
A container vulnerability with no available fix is recorded as a Risk Acceptance with the reason, any compensating control, an approver and a review date. The CVE can be hidden from the CI gate, for example with an ignore file, but the register entry keeps the decision visible until a fixed version is released.
Ready to Start Your Compliance Journey?
Get a clear, actionable roadmap with our readiness assessment.
Contact Us
Sample SOC 2 Control List
Input your email to download the list.
About the Author
Former security architect for Bank of Canada and Payments Canada. 20+ years building compliance programs for critical infrastructure.