Scanning ML Pipelines with Amazon Inspector
This lesson explains how scanning code and images in the pipeline stops known weaknesses from reaching production, with Amazon Inspector and the current status of Amazon CodeGuru named in the exam guide.
Learning outcomes
After completing this lesson, you will be able to:
- Scan images and functions with Amazon Inspector.
- Describe the current status of Amazon CodeGuru.
- Gate the pipeline on scan findings.
Amazon Inspector
Amazon Inspector is the AWS vulnerability management service. ECR enhanced scanning scans container images for operating system and programming language package vulnerabilities when they are pushed and continuously rescans them as new vulnerabilities are published. Inspector also scans Lambda functions for package vulnerabilities and, with Lambda code scanning, for code issues such as injection flaws and hard-coded secrets, and scans EC2 instances. Inspector code security scans source code repositories for vulnerabilities, secrets and infrastructure-as-code misconfigurations. Findings have severities and can be sent to EventBridge.
Amazon Inspector
Amazon CodeGuru status
The exam guide names Amazon CodeGuru. CodeGuru Reviewer used machine learning to review code for defects and security issues in pull requests, but it no longer accepts new repository associations (since November 2025). CodeGuru Security, which scanned code for vulnerabilities, has been discontinued. Know what they did, but for new pipelines use Amazon Inspector code security, Lambda code scanning and ECR scanning, plus open-source scanners in CodeBuild.
Gating the pipeline
Make scanning a gate: after CodeBuild pushes an image, a step queries Inspector findings for the image digest and fails if critical or high findings exist; EventBridge rules on new findings notify owners about images already deployed. Combine with dependency pinning, private package repositories in AWS CodeArtifact and regular rebuilds. The following table summarises the scanning options.
| What | Scanner | Status |
|---|---|---|
| Container images in ECR | Inspector enhanced scanning (on push and continuous) | Current |
| Lambda functions | Inspector Lambda standard and code scanning | Current |
| Source repositories | Inspector code security | Current |
| Pull request code review | CodeGuru Reviewer | No new repository associations |
| Code vulnerability scanning | CodeGuru Security | Discontinued |
The following diagram shows the gate and the alert for images already deployed.

A scanning gate
A scanning gate
A team wants no inference image with critical vulnerabilities to reach SageMaker AI endpoints.
- Enable Inspector enhanced scanning (continuous) on the ECR repositories.
- After the image push, a CodeBuild step waits for scan completion and calls the Inspector API for findings on the image digest; critical findings fail the stage.
- An EventBridge rule on new critical findings for deployed images opens a ticket for a rebuild.
Continuous rescanning matters because an image that was clean when deployed can become vulnerable when a new CVE is published.
Which service scans container images in ECR?
Show answer
Amazon Inspector, through ECR enhanced scanning on push and continuously.
Exam Tips
Remember for the exam
- Scan container images: Inspector ECR enhanced scanning (on push and continuous).
- Scan Lambda functions and code repositories: Inspector.
- CodeGuru Reviewer takes no new repositories; CodeGuru Security is discontinued.
- Fail pipeline stages on critical findings.
- Continuous scanning catches new CVEs in deployed images.