Skip to content
Updated: 6 min read

Container image security scanning: 5 Mistakes That Cost Companies the Most

Container image security scanning: the five costliest mistakes, a table of control layers, and a plan for wiring vulnerability scanning into the pipeline.

Marcin Godula Author: Marcin Godula

Container image security is the set of practices that limit the risk carried by an image’s contents: the base system, application libraries, and how layers are built. Vulnerability scanning is one element of that control — it finds known flaws in image components, but on its own it does not establish whether an image is safe to run in production.

Quick Overview

What you’ll learn:

  • Why container image scanning is often expensive yet ineffective
  • Five mistakes that most commonly invalidate a scan result
  • A table of control layers: what to check, with what, and when
  • How to wire scanning into a pipeline so that it stops real risk

Who this article is for:

  • DevOps and platform teams responsible for production images
  • Security engineers rolling out software supply chain controls
  • Architects and tech leads defining an image build standard

Reading time: 7 minutes

Container Image Security Scanning

A container image is a package of layers: the base system, system dependencies, language libraries, and finally application code. Each layer contributes its own components, and most vulnerabilities in a typical image come not from code written in-house but from what arrived with the base image and the package manager.

The NIST guide on application container security organises risk around five areas — images, registries, the orchestrator, containers at runtime, and the host system. Vulnerability scanning touches only the first. That distinction matters, because organisations often treat a green scanner result as proof that a deployment is secure, when it is evidence about one layer out of five.

A second thing worth understanding from the start: a scanner compares the image’s component inventory against databases of known vulnerabilities. It does not detect application logic flaws, misconfigured permissions, or secrets used at runtime. It detects what somebody has already described and published.

The Five Mistakes That Cost the Most

Mistake one: scanning only in production. An image built weeks earlier, tested and deployed, is often scanned for the first time in the production registry. The result arrives when the cost of change is highest and the team has the least time — so findings end up on an exception list.

Mistake two: no threshold that stops anything. A scanner reporting hundreds of findings with no agreed blocking threshold becomes a report generator. If the pipeline passes everything regardless of the result, scanning is not a control; it is documentation of risk.

Mistake three: treating all vulnerabilities alike. A critical flaw in a library that is never invoked in this image can be less urgent than a medium one in a component exposed to internet traffic. Without analysing the runtime context, a list sorted purely by CVSS score drives work in the wrong direction.

Mistake four: base images with no owner and no refresh. A year-old base image does not receive patches by itself. If nobody is accountable for periodically rebuilding images on a fresh base, vulnerability counts grow even when application code never changes.

Mistake five: skipping the build stage. Secrets baked into intermediate layers, development packages left in a production image, processes running as root — this is a class of problems a vulnerability scanner typically will not report, yet it genuinely widens the attack surface. The CIS recommendations for Docker treat this stage separately precisely because it is independent of any CVE list.

Control Layers: What, With What, and When

StageWhat we checkType of control
Image buildprocess user, unnecessary packages, secrets in layersDockerfile review, policy rules
After buildknown vulnerabilities in componentsimage scanning in CI
Registryimage signature and provenance, retentionaccess control, signing
Deploymentprivileges, admission policiesorchestrator rules
Runtimeunusual process behaviourruntime monitoring

The table shows something that surprises teams during rollouts: scanning occupies a single row. The other four are cheaper to introduce than they appear, and without them the scanner remains a point control.

Wiring Scanning So That It Works

  1. Move the control to build time — the result should arrive while the author still remembers what they changed and rolling back costs minutes.
  2. Set a blocking threshold and keep it narrow — it is better to stop the pipeline on a small, precisely defined class of findings than to announce a broad policy everyone routes around within a week.
  3. Separate the base image from the application — one curated set of base images, refreshed on a schedule, reduces vulnerability counts across the whole portfolio with no work from product teams.
  4. Describe the exception path — an exception with an expiry date and an owner is manageable; an open-ended exception is simply a disabled control.
  5. Add build-stage checks — rules about the process user, layer contents, and secrets catch a class of problems that CVE scanning cannot see.

Read Also

Build Your Skills

This topic connects to the Application Security: AppSec, DevSecOps, OWASP, SAST, DAST, SCA and Snyk: Securing Applications and Infrastructure courses. Review the programme and contact us to match the scope to your environment.

Frequently Asked Questions (FAQ)

Does image scanning replace application security testing?

No. An image scanner compares components against databases of known vulnerabilities and does not analyse application logic. Authorisation flaws, injection, or broken session handling require different tools at a different stage — image scanning will not find them.

How often should images be rebuilt if the code does not change?

Regularly, regardless of code changes, because patches land in base layers and system dependencies. A scheduled rebuild on a fresh base image removes a share of vulnerabilities with no work from the product team.

What should we do with hundreds of findings in existing images?

Narrow the scope first: start with images exposed to external traffic, and within them with components actually used at runtime. Trying to clean the whole portfolio at once, sorted purely by severity, usually ends in an exception list rather than a real reduction in risk.

Is scanning in the registry enough, without scanning in the pipeline?

The registry is a good place for continuous checks, because new vulnerabilities appear after an image is built. It does not replace a pipeline control, though — without one, a flawed image is created and published, and the reaction comes only after the fact.

Request a quote

Develop Your Competencies

Check out our training and workshop offerings.

Request Training
Call us +48 22 487 84 90