A development team is using Docker containers for microservices. The security team wants to scan containers for vulnerabilities during the CI/CD pipeline. Which approach is most effective?
Early scanning prevents vulnerable images from being stored or deployed.
Why this answer
Integrating image scanning into the CI/CD pipeline before promoting images to the registry ensures vulnerabilities are detected early, preventing insecure images from being deployed. Tools like Trivy scan container layers against known vulnerability databases (e.g., CVE databases) at build time, aligning with DevSecOps principles of shifting security left. This approach is more effective than runtime-only scanning or post-deployment checks, as it stops vulnerable images from reaching production.
Exam trap
A common misconception is that runtime security scanning is sufficient for vulnerability management. However, runtime tools detect active threats but not static vulnerabilities in image layers, which must be caught earlier in the pipeline via image scanning.
How to eliminate wrong answers
Option A is wrong because runtime security tools (e.g., Falco) monitor container behavior during execution, not the image itself, and may miss vulnerabilities in unused packages or layers that are never executed. Option B is wrong because scanning only after deployment to production introduces risk by allowing vulnerable images to run in production, violating the principle of early detection in CI/CD. Option C is wrong because relying on developers to manually check for vulnerabilities is error-prone, inconsistent, and does not scale, especially in microservices environments with frequent builds.