Base images and OS vulnerabilities
Every container image is built on top of another one: the base image, named in the FROM line of the Dockerfile.
It usually brings a Linux distribution and dozens or hundreds of operating system packages that your application never
asked for.
FROM node:22 # base image: Debian + Node.js + hundreds of OS packagesCOPY . /app # your application and its dependenciesTwo kinds of vulnerabilities in one image
Section titled “Two kinds of vulnerabilities in one image”| Operating system | Application | |
|---|---|---|
| Comes from | The base image (openssl, glibc, zlib…) |
Your dependencies (npm, Maven, NuGet, PyPI, Go…) |
| Fixed by | Updating or changing the base image | Updating the package in the application |
| Usually owned by | Platform team | Application team |
Telling them apart matters: a report that mixes both sends every finding to the application team, which can’t fix most of them.
Why the base image matters so much
Section titled “Why the base image matters so much”- It is often the largest source of vulnerabilities in an image, sometimes by far.
- Many applications share the same base: one outdated base image puts all of them at risk, and one update fixes all of them.
- Images that are not rebuilt keep the old base forever, even after a fixed version exists.
Good practices
Section titled “Good practices”- Prefer small base images (slim, distroless or hardened images): fewer packages, fewer vulnerabilities.
- Pin the base image to a version, and update it on purpose.
- Rebuild regularly, so fixes in the base reach your images.
- Use multi-stage builds, so compilers and build tools don’t end up in the final image.
In Leavory
Section titled “In Leavory”Dockerfile finds the base image of every pipeline and scans it, and Repositories lets you filter findings by origin: application or operating system.