Skip to content

Files

Latest commit

 

History

History
37 lines (26 loc) · 709 Bytes

AWS023.md

File metadata and controls

37 lines (26 loc) · 709 Bytes

Pattern: ECR repository has image scans disabled

Issue: -

Description

Repository image scans should be enabled to ensure vulnerable software can be discovered and remediated as soon as possible.

Resolution: Enable ECR image scanning.

Examples

Example of incorrect code:

resource "aws_ecr_repository" "bad_example" {
  name                 = "bar"
  image_tag_mutability = "MUTABLE"

  image_scanning_configuration {
    scan_on_push = false
  }
}

Example of correct code:

resource "aws_ecr_repository" "good_example" {
  name                 = "bar"
  image_tag_mutability = "MUTABLE"

  image_scanning_configuration {
    scan_on_push = true
  }
}