ladderlore
Request a guide
  • Type a service name, like S3 or IAM.

Concept · Builds on AIF-C01

Scanning code and images in CI/CD

Scan code, dependencies and container images in the pipeline, and stop the release when findings are too severe.

You know from AI Practitioner

  • Amazon Inspector scans EC2 instances, container images in Amazon ECR and Lambda functions for known flaws.
  • It ranks each finding by severity so you fix the worst first.
  • Inspector scans software. Macie scans data.
Read the AI Practitioner lesson
Commit
CodeBuild
Image in ECR
Inspector scan
Severity gate
Deploy
CodeArtifact
packageson pushpasses
Packages, build, scan, then a severity gate before deploy.

Packages, build, scan, then a severity gate before deploy.

  • Container images in ECR

    Inspector
  • Lambda code and packages

    Inspector
  • Repository code

    Inspector code security
  • Package sources

    CodeArtifact
  • Data with personal information

    Macie
Pick the scanner by what you scan.

What it is

A secure ML pipeline checks three things before a model or image ships. Code: your training and serving code. Dependencies: the Python packages and base images it pulls in. Images: the container that runs on SageMaker AI or another compute service. Inspector covers images and Lambda functions. For images in Amazon ECR, it can scan when you push an image and keep scanning as new vulnerabilities are published. For Lambda, it scans dependencies and can also scan your function code. Findings carry a severity, and Inspector sends them to Amazon EventBridge.

What it is

To block a deploy on severity, put a gate in the pipeline. An AWS CodeBuild step or a Lambda function in AWS CodePipeline reads the scan result and fails the stage when findings of Critical or High severity exist, so the next stage never runs. A manual approval can sit after the gate for the rest.

AWS CodeArtifact is a private package repository. It can pull from public registries such as PyPI and npm through an upstream link, and your builds then install only from CodeArtifact. That gives you one place to control and audit which package versions get in, and it helps against dependency confusion.

What it is

Status: Amazon CodeGuru Reviewer has accepted no new repository associations since November 7, 2025, and Amazon CodeGuru Security ended on November 20, 2025. It scanned code for defects, security flaws and secrets. AWS points to Amazon Inspector code security for scanning repositories.

Remember

  • Inspector: ECR images (on push and continuous), Lambda, EC2.
  • Findings have a severity. Send them to EventBridge.
  • Block a deploy: a pipeline step fails on Critical or High findings.
  • CodeArtifact: private package repository with upstream links to PyPI or npm.
  • CodeGuru Reviewer: no new associations since November 7, 2025.

Remember

  • CodeGuru Security: ended November 20, 2025.

On the exam

  • “Scan container images for known vulnerabilities when pushed to ECR” points to Amazon Inspector.
  • “Do not deploy if Critical findings exist” points to a pipeline gate that fails on severity.
  • “Control which Python packages builds may install” points to AWS CodeArtifact.
  • “Find sensitive data in a training bucket” points to Macie, not Inspector.