Utkarshwriting · building · reflecting
technical

Vulnerability Management – Container Vulnerability Management: From Build Pipeline to Runtime

A story-led guide to container vulnerability management: fix base images once, cut scanner noise with VEX and reachability, and gate CI on real risk.

  • vulnerability-management
  • container-security
  • cloud-security
  • devsecops
  • vex
  • cnapp
  • vmdr

This is a story about container vulnerability management at a company called Exalted Jupiter. The company is fictional; the problems are not. If you have ever opened a dashboard on a Monday morning and found hundreds of new container findings that nobody claims, this one is for you. The people are a fixed cast I will keep using in future stories, and each scene ends with a short note on what is actually going on, so you can take the practice without the plot.

I am Utkarsh, the vulnerability platform owner. These are notes from one quarter.

Scene 1: Monday Morning, One Image, Every Service

The container view had turned red overnight. Same CVE, same package, repeated across dozens of services in three clusters.

Piyush, who leads one of the application teams, was the first to call. “None of this is ours. We didn’t touch OpenSSL. We pushed a feature flag change last week.”

“Then who owns it?” I asked the group on the call.

Nobody answered. That was the real finding.

Shaurya from platform engineering pulled up the image history. “They all inherit from the same internal base image. We built it eighteen months ago and teams have been copying the tag ever since.”

One vulnerable layer, reused everywhere, had produced hundreds of findings and zero owners.

What’s happening here

Container images are built in layers. When a base layer carries a vulnerable package, every image built on it inherits the finding, and a scanner that counts per running container multiplies that one root cause by the number of replicas, clusters and environments. The dashboard looks like hundreds of problems. Operationally it is one problem in one place, and until someone owns that place, it will keep coming back. Treat this as exposure debt with a single source; the exposure debt metrics post covers why counting the source matters more than counting the instances.

Scene 2: Why Container Vulnerability Management Breaks Old Patching Habits

My first instinct was the one VM teams have had for a decade: raise a patch ticket and push the fix to the hosts.

Shaurya stopped me. “You can’t patch these the way you patch servers. If someone execs into a running container and updates the package, it’s gone the next time the pod restarts. Half of these will be replaced by the autoscaler before a change window opens anyway.”

“So we leave them vulnerable?” I asked.

“No. We fix them upstream. If you patch a running container, the image in the registry still has the old package. The next deployment ships the vulnerability again, and production no longer matches what we built. Update the base image, rebuild the application images, redeploy. The running containers get replaced, not patched.”

“So the patch moves from the server to the pipeline.”

“Exactly. And what you measure is whether the rebuild happened. That’s a different control, and an easier one to track.”

What’s happening here

Containers are meant to be immutable and short-lived. The unit of remediation is the image, not the running instance. Patching inside a container creates drift and is undone at the next restart. The durable fix is rebuild and redeploy: update the base or the dependency, produce a new image, and roll it out. This also changes what “patched” means for reporting. A finding is closed when no running workload uses a vulnerable image, not when someone ran an update command. Automating that rebuild loop is the container version of the ideas in the autonomous patch remediation post.

Scene 3: Build Time, Runtime and the Same CVE Counted Three Times

By Wednesday, Shruti from SecOps had noticed something odd. “Our container findings don’t match across tools. The registry scan says one number, the cluster says another, and the pipeline report is different again.”

She was right. We had three views of the same images:

  • The CI pipeline scanned images at build time with an open-source scanner such as Trivy or Grype.
  • The registry scanned stored images on a schedule.
  • Our cloud security platform scanned what was running in the clusters.

Each was correct about what it saw. Together, they triple-counted.

“Which one is the truth?” Shruti asked.

“All of them, for different questions,” I said. “Build-time scanning tells the developer what they’re about to ship. Registry scanning catches new CVEs in images that haven’t changed. Runtime tells us what is actually exposed right now.”

“Then the dashboard needs to know they’re the same thing.”

That became our first engineering task: deduplicate on the image digest, not the container name or the tag. One digest, one set of findings, with a list of where that digest is running.

What’s happening here

Build-time and runtime scanning answer different questions, and you need both. Build-time scanning gives fast feedback before an image ships. Registry rescans catch vulnerabilities disclosed after the build. Runtime scanning, available in platforms such as Microsoft Defender for Cloud, Wiz, Prisma Cloud, Tenable, Qualys and Rapid7, shows what is deployed and exposed. The mistake is counting each view separately. Use the immutable image digest as the key, roll findings up to the image, and attach deployment context (cluster, namespace, internet exposure) as attributes, not as extra findings.

Scene 4: Ownership by Layer

The ownership meeting was the one I had been dreading. Venkat, our CISO, sat in.

“I don’t want another RACI spreadsheet,” he said. “I want to know who gets the ticket.”

I drew three boxes on the whiteboard.

“Base image layer: the OS packages and runtimes everyone inherits. That’s Shaurya’s platform team. They publish golden images and own keeping them current.”

“Platform layer: the cluster, node images, ingress, sidecars and shared services. Also Shaurya’s team, with cloud configuration owned alongside it.”

“And the application layer,” I said, turning to Piyush, “your code and the libraries you pull in. Your team owns those findings, and you own rebuilding when the base image moves.”

Piyush frowned. “So when the base image gets fixed, I still have to rebuild?”

“Yes. Unless your pipeline does it for you. That’s the ask.”

Venkat nodded. “Good. Route it by layer. If a finding can’t be routed, that’s a finding in itself.”

What’s happening here

Most container findings can be assigned automatically if you know which layer introduced the package. Scanners and SBOMs can usually tell OS packages from application dependencies, and image metadata shows which base image a build used. Route base-layer findings to the team that publishes the base image, platform findings to the platform team and application dependencies to the service owner. The handoff that usually breaks is the rebuild: a fixed base image helps nobody until downstream images are rebuilt. Make the rebuild trigger part of the ownership model.

Scene 5: Cutting the Noise Without Hiding Risk

Even with ownership sorted, the volume was high. Piyush pushed back hard.

“Half of these are in packages we never call. There’s a shell, a package manager and a pile of utilities in the image that the app doesn’t need.”

“Then take them out,” Shaurya said. “We can move the stable services to minimal or distroless bases.”

The distroless project describes its images plainly: they “contain only your application and its runtime dependencies.” No shell, no package manager. Every package removed is a finding that can’t return.

“That fixes the future,” Piyush said. “What about the findings we have today?”

“Two things,” I said. “First, reachability. Some runtime tools can tell us whether a vulnerable package is actually loaded by a running process. If it is loaded and the workload is exposed, it goes to the top. If it is never loaded, it still gets fixed, but on the normal rebuild cycle.”

“And second?”

“VEX. When we’ve analyzed a finding and it doesn’t affect us, we record that in a machine-readable statement instead of a spreadsheet note.”

Shruti raised an eyebrow. “Who signs off on ‘not affected’?”

“The owning team proposes it, security reviews it, and every statement has a justification and an expiry for review,” I said. “No justification, no suppression.”

What’s happening here

Noise reduction has three tiers. Remove packages you don’t need with minimal or distroless images, which cuts findings at the source. Prioritize by context: whether the package is loaded at runtime, whether the workload is internet-facing and whether the CVE is known to be exploited, as described in the context-aware prioritization post. Record analysis with VEX (Vulnerability Exploitability eXchange). CISA’s minimum requirements for VEX define four statuses (not affected, affected, fixed, under investigation) and standard justifications for “not affected”, such as “vulnerable_code_not_in_execute_path”. Scanners including Trivy and Grype can consume OpenVEX documents to filter findings. Treat a VEX statement as a reviewed decision, not a mute button.

Scene 6: A Gate That Blocks Risk, Not Builds

Piyush’s biggest fear was the pipeline gate. “If you fail my build every time a medium CVE shows up in a base package, my team will find a way around the gate within a week.”

“Agreed,” I said. “So the gate won’t do that.”

We wrote the policy together:

  • Block a build only for critical or high findings that are known to be exploited or have a fix available, in packages the image actually ships, unless a valid VEX statement or approved exception exists.
  • Warn on everything else, with the finding sent to the owning team’s backlog.
  • Block deployment of images that weren’t built by the approved pipeline or don’t come from the approved registry.

Shruti added one rule. “When a new CVE goes on the KEV catalog, the gate should pick it up the same day, not at the next policy review.”

“And if there’s no fix yet?” Piyush asked.

“Then the gate warns, and we track it as an exception with a mitigation. Blocking a build doesn’t make a fix exist.”

What’s happening here

A CI policy gate earns trust by being narrow. Block on what is both serious and actionable: exploitable or known-exploited issues with a fix available, in shipped packages. Everything else becomes a tracked finding, not a failed build. Pair the build gate with a deployment control, such as a Kubernetes admission policy or a signed-image requirement, so images that skipped the pipeline cannot run. Keep exception and VEX handling inside the same workflow so developers have a legitimate path that is faster than a workaround.

Scene 7: The Cloud Around the Containers

Just as the container numbers started to settle, Shruti sent me a screenshot. “One of the services on that old base image runs with a workload identity that can read every storage bucket in the account.”

That changed the conversation. A medium-severity library bug in an isolated batch job is one thing. The same bug in an internet-facing service whose identity can read every bucket is another.

Shaurya pulled up the cloud security posture view. “And that service sits behind a public load balancer. The function that processes its uploads is serverless, so the scanner never saw it.”

We had treated image scans, cloud posture and identity as separate worlds. An attacker wouldn’t.

“We need the scanner finding and the cloud context on the same page,” I said. “Image, workload, exposure, identity, data it can reach.”

“Least privilege on that workload identity first,” Shruti said.

Shaurya nodded. “That’s a fix we can ship today.”

What’s happening here

Containers rarely run alone. They sit behind managed load balancers, call managed databases, trigger serverless functions and act through cloud identities. Cloud security posture management (CSPM) and broader cloud-native application protection platforms (CNAPP) correlate image vulnerabilities with that context: public exposure, attached identities and permissions, and sensitive data reachable from the workload. Serverless functions and managed services need their own coverage, either through function package scanning or the provider’s own security tooling, because there may be no image or host for a traditional scanner to reach. Sometimes the fastest risk reduction isn’t a patch at all; it’s removing a permission.

Scene 8: The Number Venkat Wanted

At the end of the month, Venkat called me in. “The board doesn’t want CVE counts. Give me one number that tells them whether we’re getting better.”

I gave him one headline and three supporting measures.

“The headline is the share of production workloads running images with known-exploited vulnerabilities that have a fix available. That’s the number that matters to an attacker.”

“And the supporting ones?”

  • Image age in production: how old the running images are, because old images collect new CVEs even when nothing changes.
  • Rebuild cadence: how quickly downstream images pick up a new base image after it is published.
  • Vulnerable images in production: counted by unique image digest, not by container instance.

“Can I compare it quarter to quarter?” Venkat asked.

“Yes, as long as we keep the definition stable. If we change the definition, we report both for a quarter.”

What’s happening here

Container metrics should describe the system, not the noise. Counting per container instance rewards scaling down and punishes scaling up. Counting per unique image and tracking image age and rebuild cadence shows whether the rebuild loop is actually working. The board-level number works best when it combines exploitability, fix availability and production exposure, because that is the slice leadership can act on and attackers care about.

Adopting Container Vulnerability Management: An Idealized Path

Here is what we wrote down for the next two quarters. In an ideal world, a rollout might follow these steps in roughly this order. It is an example, not a prescription. Every enterprise should tune the sequence, depth and pace to its own risk appetite, tolerance and engineering capacity.

  1. Inventory images and owners. Map running workloads to image digests, base images and owning teams.
  2. Publish golden base images. Give the platform team ownership of a small set of maintained, preferably minimal, base images.
  3. Deduplicate. Roll build, registry and runtime findings up to the image digest.
  4. Route by layer. Send base, platform and application findings to the right owner automatically.
  5. Automate rebuilds. Trigger downstream rebuilds when a base image changes.
  6. Add a narrow CI gate. Start in warn-only mode, review what it would have blocked, then enforce for exploitable, fixable, critical findings.
  7. Add context. Bring CSPM or CNAPP exposure and identity data alongside scanner findings, and include serverless and managed services.
  8. Introduce VEX. Record reviewed “not affected” decisions with justifications and review dates.
  9. Report stable metrics. Image age, rebuild cadence, vulnerable images in production and the headline exploitability number.

No step depends on a single product. Trivy and Grype, Wiz, Prisma Cloud, Microsoft Defender for Cloud, Tenable, Rapid7 and Qualys can each cover parts of this path; what matters is how they fit together.

Closing Takeaway

The lesson from Exalted Jupiter’s quarter is simple. In container vulnerability management, you don’t fix running things. You fix the things they are built from, and you make the rebuild automatic. Ownership by layer, deduplication by digest and a narrow pipeline gate turn a wall of red into a short list of decisions.

A question for you: in your environment, who owns the base image, and how long does it take for a fix in that image to reach every service in production?

Next Time

On the last Friday of the quarter, Pradeep from the red team turned his laptop toward me: “Nice work on the images. Want to see how I’d still get from that public load balancer to your customer data?”

That’s the next story.

About the author

Vulnerability Management @ Philips. Writing on cybersecurity, security automation, and the inner life — from Bengaluru, building in public since 2014.

Connect on LinkedIn →

Related posts