The image was clean yesterday: patching a critical runtime CVE with zero downtime
A critical security advisory landed for the language runtime inside production containers. I patched the affected images, proved them in pre-prod and rolled them out with zero downtime, then planned the controls that make the next one routine.
- Reading time
- 6 min
Results at a glance
- Production downtime during the patch
- 0
- Images in prod without a pre-prod pass
- 0
- Prevention controls (planned)
- 6
TL;DR
- The problem: a critical security advisory landed for the language runtime our services were built on. Nothing in our code had changed. The images running in production were clean the day before and vulnerable the day after.
- What I did: found every image carrying the affected version, rebuilt them on the fixed runtime, tested them in pre-prod, then rolled them out to production with the rollback ready before the first pod changed.
- The result: zero production downtime, and no image reached production without passing pre-prod first. Then I planned six controls so the next advisory is routine, not a scramble.
The lesson in one line: a container freezes its runtime the day it’s built. Security doesn’t stand still with it.
Why this catches teams out
Every container image carries a snapshot of its runtime: the language, its extensions, the operating system packages underneath. That snapshot is taken at build time and never changes on its own.
So when a runtime publishes a critical security fix, every image built before that day is vulnerable, and nothing in your pipeline knows. No code changed. No deployment ran. The containers keep serving traffic exactly as they did yesterday, with a published flaw inside them.
Three things make it worse:
- Scanners lag the news. A vulnerability database has to ingest the advisory before your scanner can flag it. The advisory itself is the earliest warning you get.
- Floating tags don’t help running pods. A base image tag like
runtime:8may already point at the fixed version upstream, but your running containers were built from the old one. Nothing changes until you rebuild and redeploy. - “Critical” creates pressure to skip steps. That pressure is how a security fix turns into an outage.
This is a weakness almost every team running containers has. It isn’t carelessness. It’s how images work.
Constraints
- No downtime. These were live services. Patching could not mean a maintenance window.
- A runtime bump is a real change. A new runtime version can change behaviour or break an extension, even when it’s a security release. It had to be tested like any other release.
- Speed still mattered. A published critical flaw is a clock. The process had to be fast without skipping a step.
How I ran it: human-governed, AI-assisted
An AI agent did the reading and checking at machine speed. I made every decision and every change.
| Step | What the agent did | What I did |
|---|---|---|
| Advisory | Read the advisory and release notes, listed the affected versions and the fixed ones | Decided this was a patch-now, not a next-sprint |
| Triage | Matched the affected versions against what each running image actually carried | Confirmed the list and the order to patch |
| Rebuild | Checked each rebuilt image reported the fixed runtime version | Rebuilt the images and pinned the version |
| Test | Drafted the pre-prod test checklist | Ran the tests and signed off each service |
| Roll out | Nothing | Ran the rollout, with the rollback ready |
The agent never touched production. Its job was to make sure nothing was missed and nothing was assumed.
The decisions, and what I rejected
1. Act on the advisory, not the scanner
We picked this up from the advisory and security news, not from a scanner alert. Waiting for the scanner would have meant waiting for a database update to tell us something already public.
2. Rebuild the image, never patch a running container
The tempting shortcut is to shell into each running container and upgrade the package in place. I rejected it:
- It doesn’t last. The next restart brings back the original, vulnerable image.
- It creates drift. What’s running no longer matches any image you can rebuild or audit.
- It’s untested by definition. You’re changing production by hand.
The fix belongs in the image. Rebuild on the fixed runtime, pin the version, and let the normal release path carry it.
3. Pre-prod first, even under pressure
“It’s critical, push it straight to prod” is the most dangerous sentence in a security response. Every rebuilt image ran in pre-prod first and had to pass before it went near production. A security patch that breaks checkout is still an incident.
4. Know the way back before you start
The rollout was a standard Kubernetes rolling update: new pods come up and take traffic as they become healthy, old pods drain. Before the first pod changed, the rollback was ready: the previous release, one command away.
# Simplified. The rollback is checked before the rollout starts, not after it fails.
kubectl rollout history deployment/api # confirm the previous revision exists
kubectl rollout status deployment/api --timeout=10m
kubectl rollout undo deployment/api # the way back, if health checks fail
Results
| Measure | Result | How it was checked |
|---|---|---|
| Production downtime during the patch | 0 | Rolling update; services stayed up throughout |
| Images that reached production without a pre-prod pass | 0 | Every rebuilt image was tested in pre-prod first |
| Rebuilt images on the fixed runtime | All affected images | Runtime version checked in each rebuilt image |
The prevention plan
Patching was the easy part. The real question is how fast you can answer “are we affected?” next time, and how much of the fix happens without anyone waking up.
This is the plan, not a finished project. These are the six controls I’m putting in place, in order of value:
- Know what’s running. An inventory of every running image by digest, with a software bill of materials (SBOM) for each. “Which containers carry version X?” becomes a query, not an investigation.
- Watch the advisories, and re-scan continuously. Subscribe to security advisories for the runtimes and base images you use, and re-scan images already in the registry as vulnerability databases update, not only at build time.
- Gate the pipeline on what’s fixable. Fail the build on critical and high vulnerabilities that have a fix available. Anything accepted gets a written, time-boxed exception. Blocking on every finding, fixable or not, just teaches people to ignore the gate.
- Rebuild on a schedule. Automated pull requests for base-image updates (Renovate or Dependabot), with versions pinned by digest, deployed to pre-prod and smoke-tested automatically. Routine patches then flow in every week, so a critical one is just a faster run of the same path.
- Build once, promote the same image. The exact image digest tested in pre-prod is the one that goes to production. No rebuild between environments.
- Only trusted images run. An admission policy (Azure Policy for AKS, Kyverno or Gatekeeper) that admits only images from your own registry that passed scanning. Image signing is the next step after that.
One trade-off worth naming: smaller base images (slim or distroless) carry far fewer packages, so far fewer vulnerabilities. They also remove the debugging tools engineers reach for during an incident. I’d move to them service by service, with a documented way to debug, not in one sweep.
What I’d do differently
I’d have controls 1 and 2 in place before the advisory, not after it. The patch itself is a well-practised release. The slow, nervous part of any critical advisory is the first hour: working out exactly what’s affected. An inventory and an SBOM turn that hour into a query.
I’d also write the response as a one-page runbook, so the next person can run it at 2 a.m. without me: triage, rebuild, pre-prod, rollout, rollback.
Do you have this too?
Almost certainly. If your services run in containers, some of your images are older than the last security release of their runtime. The question is whether you can find them in minutes, and patch them without an outage.
This is work I do: a fixed-price, read-only review of your images, pipeline and cluster that tells you what’s exposed today, followed by the controls above, built and tested with your team.
Tech stack
Docker · Kubernetes · AKS · Helm