Join our Newsletter — 33% off our NHI Course

How should security teams choose container base images for brownfield applications?

Start with images that match the realities of legacy dependency sprawl. Prioritise curated, well-supported distributions when the application has hidden packages, older libraries, or fragile build steps, because those environments are most likely to break under scratch-based rebuilding and most likely to carry inherited vulnerability debt.

Why This Matters for Security Teams

Base image selection is not just a packaging choice. For brownfield applications, it determines whether security teams can improve patchability without destabilising an already fragile build chain. A minimal or scratch-based image can look attractive on paper, but legacy apps often depend on implicit libraries, shell utilities, certificate stores, time zone data, or runtime behaviours that are not obvious until deployment. That turns image hardening into a change-risk problem as much as a vulnerability problem.

Security teams also need to account for inherited exposure. Older application stacks frequently bring transitive packages, end-of-life runtimes, and opaque build scripts that are difficult to modernise quickly. The NIST Cybersecurity Framework 2.0 is useful here because it frames the decision as part of broader risk management, not just image hygiene. The practical goal is to reduce attack surface without creating operational fragility that leads teams to bypass controls later.

In practice, many security teams encounter image risk only after a failed migration or an emergency rebuild has already exposed how much the application depends on undocumented legacy behaviour.

How It Works in Practice

Choosing a base image for a brownfield application starts with mapping what the application actually needs at runtime and during build. That means identifying runtime libraries, native extensions, package managers, shell requirements, trust stores, and any tooling used by scripts or startup hooks. If the application was assembled over years, the safest approach is usually to begin with a curated distribution that is actively maintained and widely documented, then reduce it gradually after dependencies are fully understood.

Security teams should treat the base image as a control surface. A well-governed image lineage helps with patch cadence, provenance, and vulnerability triage. A hardened image can still be the wrong choice if it lacks a library the application loads dynamically or if the build pipeline depends on tools removed during slimming. Best practice is evolving toward “minimum viable runtime” rather than “smallest possible image,” because size alone does not equal lower risk.

  • Inventory what the application needs before changing the image family.
  • Prefer supported upstream or curated images with predictable patching.
  • Track image provenance, digest pinning, and rebuild frequency.
  • Test for hidden dependencies such as shells, certificates, locale data, and package metadata.
  • Use scanning and admission controls so unsafe images do not enter production unnoticed.

For container governance, this aligns well with CIS Controls, especially where software inventory, secure configuration, and continuous vulnerability management need to be enforced across environments. Security teams should also validate the image against deployment realities, not just scanner output, because a “clean” image that fails at runtime creates pressure to reintroduce ad hoc workarounds. These controls tend to break down when legacy applications rely on undocumented runtime side effects because the team cannot distinguish required dependencies from accidental ones.

Common Variations and Edge Cases

Tighter image hardening often increases migration effort and runtime breakage risk, requiring organisations to balance reduced attack surface against compatibility and supportability. That tradeoff is especially visible in brownfield estates where platform teams want standardisation but application teams cannot easily refactor.

There is no universal standard for the perfect base image in these cases. Current guidance suggests using the least complex image that still supports the application’s known dependency set, then removing unnecessary components over time. Distroless or scratch-style images can be appropriate for some services, but they are poor default choices for legacy workloads with dynamic loading, troubleshooting requirements, or brittle startup logic. If regulatory or resilience expectations matter, teams should also consider whether the image source has clear maintenance ownership and whether rebuilds can be automated quickly after a vulnerability advisory.

Two edge cases deserve special attention. First, applications that require on-host debugging or interactive maintenance may need a slightly fuller runtime image, at least temporarily. Second, multi-stage builds can reduce final image size without forcing the runtime environment into an unsupported shape. Where identity or secrets handling is embedded in the workload, avoid baking credentials into the image and instead integrate with external secret delivery and workload identity controls. That becomes even more important when NIST Cybersecurity Framework 2.0 is being used to align development and production controls.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

NIST CSF 2.0 and CIS Controls set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST CSF 2.0 ID.AM Base image choice depends on knowing runtime assets and software dependencies.
CIS Controls 7 Continuous vulnerability management is central to maintaining container image hygiene.

Inventory dependencies first, then select the smallest supported image that still fits the application.