Containerized applications help teams deploy portable workloads across environments, and Amazon Elastic Container Registry stores, manages, and controls access to container images. For image security, Amazon Inspector can scan container images for vulnerabilities in OS packages and application dependencies. Together, ECR and Inspector help teams detect vulnerable images and enforce image-security checks before deployment.
In this Cloud Lab, you will begin by creating a private repository in Amazon Elastic Container Registry to store your Docker image. Next, you will launch an Amazon EC2 instance and use it to build a Docker image that intentionally includes older versions of application dependencies. You will then push this image to your ECR repository. After successfully uploading the image, you will enable Amazon Inspector to perform enhanced vulnerability scanning. Once the scan is complete, you will analyze the findings, focusing specifically on common vulnerabilities and exposures (CVEs) identified in the application dependencies.
To remediate these issues, you will update the vulnerable packages to their latest secure versions. You will then rebuild and push the updated image, allowing Amazon Inspector to automatically rescan it. This enables you to verify that the previously identified vulnerabilities have been resolved, demonstrating how updating dependencies helps improve the security of containerized applications.
After completing this Cloud Lab, you’ll gain hands-on experience in securing container images using Amazon Inspector with Amazon ECR. You’ll understand how to identify, analyze, and remediate vulnerabilities in containerized applications, helping you build more secure deployment pipelines and align with modern cloud security best practices.
The following is the high-level architecture diagram of the infrastructure you’ll create in this Cloud Lab:
A manual security scan may be enough for a one-off experiment, but production workloads need stronger controls: ongoing monitoring, automated vulnerability detection, and a repeatable way to verify that an image meets deployment security requirements. Integrated tools such as Amazon Inspector support this workflow.
In a modern containerized setup, image security can be integrated into the container registry workflow. By using Amazon ECR and Inspector together, parts of image scanning and vulnerability management can be automated. ECR stores container images and manages access to them, while Inspector scans supported image contents for known vulnerabilities, including supported OS packages and application dependencies such as Flask. This pattern is useful for teams deploying container images to production because it helps detect high-risk vulnerabilities from outdated base images or unpatched third-party libraries before deployment.
This Cloud Lab walks you through the core life cycle stages you’ll reuse in every professional security environment:
Establishing a baseline with intentional risk: You start by building an image with specific, outdated versions of Flask and Requests. This reflects a common production scenario: teams often inherit legacy codebases with outdated dependencies or insecure defaults. By starting with an intentionally vulnerable baseline, you learn how a failed vulnerability scan appears in the security tooling before remediating the findings.
Infrastructure as security (ECR and EC2): You’ll set up a private registry and a build environment. You will be managing the path that code takes from a developer’s terminal to a secure cloud registry.
Deep-layer inspection (Amazon Inspector): You’ll move beyond simple scan on push toggles to scanning. This is the key leap from basic logging to intelligent security: the system doesn't just tell you something is wrong; it maps the flaw to a specific CVE ID, identifies the severity, and most importantly, it provides a fixed version.
The remediation loop (Identify → patch → verify): You will update your requirements.txt, rebuild the image, and push a new tag (v2). This end-to-end loop, identifying a flaw, applying a patch, and having a third-party service verify the fix, is the exact workflow used by top-tier DevSecOps teams.
If you’re working in cloud engineering or security, the scan and remediate design applies to:
CI/CD pipelines: Automatically block a build if Inspector finds a critical vulnerability.
Compliance auditing: Providing reports to auditors showing that all images in ECR are free of high-severity CVEs.
Vulnerability management: Prioritizing which microservices need updates based on the Inspector severity score.
Base image hardening: Deciding which version of Python or Linux to use based on the number of system-level vulnerabilities detected.
Container security is less about perfection and more about visibility. It helps you keep your attack surface small, your dependencies fresh, and your production environment defensible.
When your build is working well, it should:
Display clear CVE findings in the Amazon Inspector dashboard for your initial image.
Provide actionable remediation data, including the specific package versions needed to fix the flaws.
Show a measurable risk reduction when you compare the scan results of your new image against the original.
Distinguish between patchable risks (like Flask) and residual risks (like unpatchable system utilities), showing you understand the nuance of modern security.
Once you can manage the image build, scan, remediation, and redeployment workflow with a simple Flask application, applying the same security workflow to larger microservices and multi-environment registries is the next step in risk reduction.