Container Image Security Scanning
A container image is a frozen filesystem; scanning unpacks layers to flag known CVEs before deployment. Run it in CI/CD after every build and continuously in production registries. Scanning only at build time misses new CVEs in running images.
WHY IT EXISTS: Containers package an entire userland filesystem, which means every image ships a full distribution of libraries, language runtimes, and system utilities. Most of those packages are not written by the application team, yet they inherit the same network exposure and privileges. The problem is that known vulnerabilities in these dependencies are discovered constantly, and without an automated audit, you are deploying opaque filesystems whose risk profile changes the moment a CVE is published.
THE MENTAL MODEL: Think of a container image as a shipped hard drive snapshot. You would not plug in a hard drive without checking whether its operating system has unpatched security flaws. Container scanning is that same audit, performed automatically by unpacking the image layers and inspecting the software bill of materials against a vulnerability database. It tells you whether the snapshot is safe to boot, not whether your application logic is secure.
HOW IT WORKS: A scanner pulls the image manifest, extracts the layer tarballs, and inventories the contents. It looks for package manager databases like dpkg or rpm, language-specific lockfiles, and sometimes statically linked binaries. It then correlates those artifacts against feeds such as NVD, distro security trackers, and vendor advisories. The output is a report of CVE identifiers, severity scores, and fixed versions. Modern pipelines often enforce gates that block deployment on critical findings until the base image is rebuilt or the package is upgraded.
WHEN TO USE IT: Use scanning in CI/CD immediately after an image build and before registry push, so bad artifacts never reach the deployable pool. Also use continuous or scheduled scanning against images already stored in production registries, because vulnerability disclosure is a moving target; an image that was clean at build time can become dangerous weeks later. Any team running microservices at scale, especially with public ingress or sensitive data, should treat this as mandatory infrastructure.
WHEN NOT TO USE IT: Do not treat scanning as a substitute for runtime security, least-privilege policies, or secure coding. A scanner will not catch zero-day vulnerabilities that have not yet been catalogued, nor will it detect misconfigured secrets baked into layers by accident. It also does not validate application-level logic, so SQL injection or broken authorization will sail through untouched. If your pipeline relies solely on scanning, you have a false sense of completeness.
ONE CANONICAL EXAMPLE: A team builds a Python service on top of a Debian slim base image. The initial scan in CI passes. Three months later, a critical OpenSSL CVE is announced. Because the team runs nightly scans against their production registry, the scanner flags the existing tagged image. The CI pipeline automatically rebuilds the image with apt-get upgrade, pushes a patched tag, and the cluster rolls out the new version before an exploit lands.
Get five bites like this every day.
Tezvyn delivers a daily feed of 60-second tech bites with quizzes to lock in what you learn.