ECR image scan on push is disabled
ID |
ecr_image_scan_disabled |
Severity |
critical |
Vendor |
AWS |
Resource |
ECR |
Tags |
reachable |
Description
Amazon ECR is a fully managed container registry used to store, manage and deploy container images.
Amazon ECR enhanced scanning is an integration with Amazon Inspector which provides vulnerability scanning for your container images. Your container images are scanned for both operating systems and programing language package vulnerabilities, before getting pushed to production. ECR APIs notify if vulnerabilities were found when a scan completes.
For more details, read ECR Image Scanning.
This detector reports ECR repositories (aws_ecr_repository
) without scan_on_push
set to true.
Examples
CloudFormation
{
"Resources": {
"ImageScanFalse": { (1)
"Type": "AWS::ECR::Repository",
"Properties": {
"RepositoryName": "test"
}
},
}
}
1 | No ImageScanningConfiguration block with ScanOnPush set to true. |
Resources:
ImageScanFalse: (1)
Type: AWS::ECR::Repository
Properties:
RepositoryName: "test"
1 | No ImageScanningConfiguration block with ScanOnPush set to true. |
Mitigation / Fix
Buildtime
CloudFormation
{
"Resources": {
"ImageScanFalse": { (1)
"Type": "AWS::ECR::Repository",
"Properties": {
"RepositoryName": "test",
"ImageScanningConfiguration": {
"ScanOnPush": true
}
}
}
}
}
1 | Add ScanOnPush: true to enable scan on push. |
Resources:
ImageScanFalse: (1)
Type: AWS::ECR::Repository
Properties:
RepositoryName: "test"
ImageScanningConfiguration:
ScanOnPush: true
1 | Add ScanOnPush: true to enable scan on push. |