What Changed When I Hardened an Internal MCP Server Image
For years, “use a minimal base image” has been standard security advice that most teams nod at and don’t quite quantify. That’s changed. A growing set of hardened-image options — Google’s distroless project, Chainguard Images and Docker’s now-free-and-open-source Hardened Images — all make the same underlying claim: your standard base The post What Changed When I Hardened an Internal MCP Server…
For years, experts have advised teams to use minimal base images as a security measure, though the exact benefits have been difficult to quantify. However, the landscape has changed with the emergence of various hardened-image options, such as Google's distroless project, Chainguard Images, and Docker's now free and open-source Hardened Images.
These alternatives claim to ship fewer components than standard base images, making the surplus measurable and not just theoretical. To test these claims, I migrated a real internal tool, a custom Model Context Protocol (MCP) server, to a hardened base while comparing it to a standard one. The findings, derived from a real CI run, revealed not only a reduction in the number of Common Vulnerabilities and Exposures (CVEs) but also the removal of unnecessary components.
Specifically, the hardened base eliminated the npm CLI's internal toolchain, which includes dependency-resolution and publishing tools that default in a standard Node.js image, even though the running server never uses npm. This represents a significant reduction in potential attack surface, as the hardened base automatically removes executable code that isn't actually used.
Additionally, all hardened base options typically eliminate a shell, reducing the built-in tools available to an attacker if the container is compromised. This shift in security practices extends beyond customer-facing services like API servers and web apps, now including internal tools like MCP servers and internal agent bridges that provide AI systems access to company systems.
These internal services often carry real credentials and API access, and until recently, many teams did not scan them as rigorously as public-facing services. Hardened base images address this gap by not only shrinking the security vulnerability metrics but also reducing the attack surface if an internal service is ever compromised.
Sangharsh Agarwal, a Senior Site Reliability Engineer at Adobe, emphasizes these points in a publication in USENIX ;login: and DZone, and as a technical reviewer for "SRE with AIOps" (BPB Publications).
Rewritten by urgent.news; may contain errors — check the original.
Source: cloudnativenow.com