Security is an extremely critical aspect for containerized applications. Even if you have built an image from your Dockerfile, it can still contain libraries or software packages with known security vulnerabilities. Amazon ECR integrates tightly with Amazon Inspector to provide automatic vulnerability scanning for your Docker images. This helps you detect security risks early and minimize the attack surface.
Amazon ECR offers two types of vulnerability scanning:
In this workshop, we will enable Enhanced scanning with Amazon Inspector to get the most comprehensive view of our image security.
For ECR to use Amazon Inspector for enhanced scanning, you need to ensure the Amazon Inspector service is activated in your AWS account.
In the search bar, type “Inspector” and select Amazon Inspector.
If this is your first time accessing Inspector or the service is not yet activated, you will see a welcome page. Click the Activate Inspector (or similar) button to enable the service.
Amazon Inspector is a paid service. Activating it will incur small costs based on the number of images scanned and data analyzed. Ensure you deactivate it after completing the workshop if you no longer need it.

Access the ECR service:
Configure Enhanced Scanning for the account in ECR:

Confirm image scan configuration for the Repository:
fcj-workshop-app repository.

With Enhanced scanning enabled, newly pushed images to the repository will be automatically scanned. Existing images might require some time for the initial scan, or you may need to push a new version to trigger a scan.
Once the scanning process is complete (usually takes a few minutes), you can view the results directly in the ECR console.
In the ECR dashboard, click Repositories.

Click on your fcj-workshop-app repository.
Click on the tag of the image you want to inspect in detail, select your image, and then click Details.

On the image details page, click the See extended details in Inspector tab.
CVE-2023-XXXX).
Vulnerability findings for ECR images are also aggregated and displayed in the Amazon Inspector dashboard. You can access the Inspector service and navigate to the “Findings” section to get an overview of all vulnerabilities detected across your various resources (including ECR images).
Vulnerability scanning helps you identify security risks in your images. While not all “Informational” or “Low” vulnerabilities require immediate prioritization, Critical and High vulnerabilities demand immediate attention. You should update affected software packages to fixed versions to mitigate risks.
Enabling and monitoring vulnerability scanning is a crucial step in maintaining a secure software supply chain for your containerized applications.