Image Scanning Fundamentals
What you'll learn: How vulnerability scanners inspect container image layers to identify security flaws before deployment.
What is Image Scanning?
Image scanning is the automated process of examining every layer in your container image to detect known security vulnerabilities (CVEs), exposed secrets, misconfigurations, and risky packages. Think of it like a security checkpoint at an airport—before your container travels to production, it passes through multiple checks to ensure nothing dangerous is hidden inside.
How Scanners Analyze Image Layers
Remember that images are built from layers (as you learned earlier). Scanners leverage this layered architecture by:
- Unpacking each layer - The scanner extracts files from every layer in the image manifest
- Identifying packages - It catalogs all installed software, libraries, and dependencies (OS packages, language-specific libraries like npm or pip packages)
- Cross-referencing CVE databases - Each package version is matched against known vulnerability databases (like the National Vulnerability Database)
- Severity rating - Vulnerabilities are scored (Critical, High, Medium, Low) based on their exploitability and impact
What Gets Scanned
- Base image OS packages (e.g., vulnerable OpenSSL version)
- Application dependencies (e.g., outdated Python library with known exploit)
- Configuration files (e.g., exposed credentials, weak TLS settings)
- Embedded binaries and libraries
The scanner builds a complete software bill of materials (SBOM) from your image layers and flags anything with a known security issue. Because images are immutable and content-addressed (by digest), scanning results are consistent—the same image digest will always produce the same scan results.
Key Takeaway: Image scanning uses layer analysis to build an inventory of all software in your container and matches it against vulnerability databases, catching security issues before they reach production.