More Info:
Enable image vulnerability scanning on Amazon ECR (scan-on-push) or a third-party provider so that container images are checked for known vulnerabilities before deployment.Risk Level
MediumAddress
SecurityCompliance Standards
- CIS EKS
Triage and Remediation
- Remediation
Remediation
Manual Steps
Manual Steps
-
Identify all image sources used by the cluster
- On any machine with
kubectlaccess, list all images currently referenced in workloads: - From this list, determine which images are pulled from Amazon ECR (
*.dkr.ecr.*.amazonaws.com) and which come from other registries (for potential third‑party scanning).
- On any machine with
-
Check ECR repositories for scan-on-push configuration (AWS CLI)
- On any machine with AWS CLI access and appropriate IAM permissions, for each AWS account/region that hosts ECR images, run:
- For each repository listed, check its scanning configuration:
- Record which repositories have
"scanOnPush": trueand which do not.
- On any machine with AWS CLI access and appropriate IAM permissions, for each AWS account/region that hosts ECR images, run:
-
Enable or correct ECR scan-on-push settings where missing
- For any ECR repository that does not have scan-on-push enabled, set it:
- For new repositories you manage via IaC (CloudFormation/Terraform), ensure the repository definition includes the equivalent of
scanOnPush=trueso future repos are compliant by default.
- For any ECR repository that does not have scan-on-push enabled, set it:
-
Run ad‑hoc scans for existing images that may predate scan-on-push
- In the AWS console, go to
https://console.aws.amazon.com/ecr/repositories, select the correct Region, then open each repository that contains images used by your EKS cluster. - On the Images tab of a repository, select important/tagged images (e.g.,
latest, release tags) and choose Scan to perform manual scans, prioritizing images currently deployed in the cluster.
- In the AWS console, go to
-
Evaluate and document third‑party scanning (if using non‑ECR registries)
- For any non‑ECR registry discovered in step 1, confirm whether a vulnerability scanning solution is in place (e.g., native registry scanning, CI pipeline scanner, or external scanning service).
- Collect evidence such as:
- Registry or scanner configuration showing automatic scans on push or on schedule.
- Sample scan reports for images actually deployed in the cluster.
- If no scanning exists for a given registry, plan and implement a scanning solution comparable in coverage to ECR’s image scanning.
-
Verify effective coverage for all deployed images
- Cross‑check: every image from step 1 should either reside in an ECR repository with
scanOnPush=trueor in a non‑ECR registry with documented, active vulnerability scanning. - Optionally, spot‑check a few images by pulling their latest scan results in ECR (via console or CLI) or your third‑party tool, to confirm scans are actually running and producing findings.
- Cross‑check: every image from step 1 should either reside in an ECR repository with
Using kubectl
Using kubectl
This control is configured in AWS ECR and/or your chosen image scanning provider, not in Kubernetes objects, so it cannot be fixed with
kubectl. Make the changes in the AWS console, AWS CLI, or your IaC definitions for ECR repositories, and then follow the guidance in the Manual Steps section.Automation
Automation
scanOnPush=DISABLEDfor anyregistry/repoused by running pods indicates that Amazon ECR image scanning on push is not enabled for that repository and should be reviewed and remediated.SKIPPEDentries (public ECR or different regions) mean the script could not automatically confirm scanning; you must verify that either ECR scanning or a third-party vulnerability scanner is in place for those images.

