Lesson 6 of 7 Deployment Strategies and Infrastructure as Code

Building Scanning and Signing into Delivery Pipelines

This lesson explains where vulnerability scanning belongs in a pipeline, how signing and verification ensure only trusted artifacts run, and how to secure the pipeline itself.

Learning outcomes

After completing this lesson, you will be able to:

  • Identify the scanning stages from source to runtime.
  • Explain how AWS Signer and image signing prove an artifact's origin.
  • Describe controls that secure the pipeline itself.

Scanning stages

A pipeline scans at several points. Source: static analysis, secret detection and infrastructure as code checks on every pull request, for example with Amazon Inspector code security integrated with the repositories. Build: dependency and image scanning, for example with the Amazon Inspector CI/CD integration and SBOM generator in CodeBuild, failing the build when findings exceed a severity threshold. Registry and runtime: ECR enhanced scanning and Inspector scanning of Lambda functions and EC2 rescan continuously, because new vulnerabilities are published after deployment.

Match the pairs

Pipeline scanning

Exam skills 5.2.2

Match each stage with the scan that belongs there.

Log in to try this activity Interactive activities are free with an account.

Signing and verification

Signing creates a verifiable link between an artifact and the pipeline that built it. AWS Signer signs Lambda deployment packages, and a Lambda code signing configuration with the enforce policy rejects code that is unsigned, signed by another profile or modified. Container images are signed with AWS Signer and the Notation client or with ECR managed signing, and admission controllers on EKS verify signatures before pods run. KMS asymmetric keys, including ML-DSA keys, can sign other artifacts.

  1. Scan source

    Pull request checks for code, dependencies, secrets and IaC.

  2. Build and scan

    Build once, generate an SBOM, scan the image and fail on critical findings.

  3. Sign

    Sign the artifact with the pipeline's signing profile or key.

  4. Promote

    Deploy the same signed digest to each environment.

  5. Verify and rescan

    Targets verify signatures; registries and runtimes rescan continuously.

Scenario questions

Trusting what is deployed

Exam skills 5.2.2

Make sure only approved images run in production.

Log in to try this activity Interactive activities are free with an account.

Securing the pipeline itself

  • Separate build and deployment roles, with deployment roles in target accounts trusted only by the pipeline.
  • Artifacts encrypted with customer managed KMS keys and stored with tag immutability.
  • No long-term credentials in the pipeline: OIDC federation or IAM roles.
  • Approvals and audit logs for production promotions.
Worked example

Stopping vulnerable images

Twice this year, container images with critical vulnerabilities reached production, and once a developer pushed an image directly to the production repository.

The pipeline now scans each image in CodeBuild with the Inspector CI/CD integration and fails on critical findings, then signs the image with ECR managed signing and pushes it with an immutable tag.

EKS admission control rejects images without the pipeline's signature, so directly pushed images no longer run, and ECR enhanced scanning alerts the owning team when a newly published CVE affects an image already in production.

Check yourself

An image passed scanning at build time. Why does it still need continuous scanning?

Show answer

New vulnerabilities are published after the image is built. Continuous scanning in ECR re-evaluates stored images against new CVEs.

Exam Tips

Remember for the exam

  • Stop vulnerable images before push: Inspector scan in CodeBuild with a severity threshold.
  • Vulnerabilities published after deployment: ECR enhanced scanning and continuous Inspector scanning.
  • Lambda must run only pipeline-built code: AWS Signer with an enforced code signing configuration.
  • Clusters must run only signed images: signature verification in an admission controller.