ECR 이미지 스캔 설정 검토

레지스트리의 스캔 범위와 실제 결과를 확인하세요.

설명

ECR에서 검사할 리포지토리와 검사 시점을 레지스트리의 스캔 유형·필터로 정하세요.

잠재적 영향

검사 대상에서 빠지거나 결과를 검토하지 않은 이미지는 알려진 취약점이 있는 채로 배포될 수 있습니다.

해결 방법

기존 레지스트리 규칙을 유지하면서 필요한 검사 주기와 필터를 설정하세요. 새로 푸시한 이미지의 검사 결과를 확인하고 결과에 따라 패치나 배포 여부를 결정하세요.

예시

두 번째 템플릿은 더 이상 권장되지 않는 리포지토리 ImageScanningConfiguration 대신 레지스트리에 BASIC과 SCAN_ON_PUSH를 설정합니다. test-repository에 별표가 없으면 이름에 이 문자열을 포함하는 다른 리포지토리도 일치합니다.

변경 전

yaml
Resources:
  MyRepository3:
    Type: AWS::ECR::Repository
    Properties:
      RepositoryName: "test-repository"

변경 후

yaml
Resources:
  MyRepository3:
    Type: AWS::ECR::Repository
    Properties:
      RepositoryName: "test-repository"


  RegistryScanning:
    Type: AWS::ECR::RegistryScanningConfiguration
    Properties:
      ScanType: BASIC
      Rules:
        - ScanFrequency: SCAN_ON_PUSH
          RepositoryFilters:
            - Filter: test-repository
              FilterType: WILDCARD

참조