Infrastructure Security

A containerized application requires only its executable and runtime libraries, but its production image includes package managers and troubleshooting utilities. Which change MOST directly reduces the image's attack surface?

Show the answer

Correct answerD. Rebuild with a minimal base and only required runtime dependencies.

AWhy not this: Runtime monitoring detects suspicious behavior rather than reducing the software included in the image.

BWhy not this: Enhanced scanning finds vulnerabilities but does not remove unnecessary software from the image.

CWhy not this: Least-privilege task permissions limit AWS API access but do not remove vulnerable image components.

DWhy this is right: Including only the executable and required dependencies removes unnecessary attack surface.

A minimal image removes unnecessary software and reduces the components that could contain exploitable vulnerabilities. Amazon ECR scanning identifies known vulnerabilities but does not remove unnecessary packages from the image.