Course contentsShow
← Security
Lesson 1636 of 3,05233. Container SecurityFree lesson

Registry-Integrated Scanning

Configuring automatic scanning in Docker Hub, ECR, GCR, and Harbor on image push and periodic rescans.

Registry-Integrated Scanning

What You'll Learn

You'll learn how to enable automatic security scanning directly within container registries, so every image is checked for vulnerabilities the moment it's pushed—and continuously thereafter.

The Core Idea

Registry-integrated scanning embeds vulnerability detection directly into your container registry workflow. Instead of running scanners manually or as separate pipeline steps, your registry (Docker Hub, AWS ECR, Google GCR, or Harbor) automatically scans images when pushed and rescans them periodically as new vulnerabilities are discovered.

Think of it like airport security: instead of screening luggage after passengers board (too late!), you scan at check-in and continuously monitor for new threats on watchlists.

How It Works

When you push an image, the registry:

  1. Immediately triggers a vulnerability scan using integrated scanning engines (Trivy, Clair, or proprietary scanners)
  2. Tags results with severity levels and CVE identifiers
  3. Blocks deployments if configured with policies (e.g., "no critical vulnerabilities")
  4. Periodically rescans stored images as new CVE databases update—yesterday's clean image might be vulnerable today

Registry-Specific Configuration

  • Docker Hub: Enable scanning in repository settings; free tier scans once per push
  • AWS ECR: Set scan-on-push via registry configuration; supports both basic and enhanced scanning
  • Google GCR/Artifact Registry: Automatically scans with Container Analysis API; provides continuous monitoring
  • Harbor: Configure scanners (Trivy default) in project settings; define scan policies and webhooks

The beauty is zero code changes—scanning happens transparently without modifying build pipelines. Images receive vulnerability metadata, and admission controllers can enforce policies before Kubernetes deployments.

Key Takeaway:
Registry-integrated scanning automatically detects vulnerabilities on image push and through continuous rescans, shifting security left without additional pipeline steps or manual intervention.