Scan your Docker images for vulnerabilities with ECR
Michael Wittig – 28 Jan 2020 (updated 21 Feb 2023)
Amazon ECR image scanning helps in identifying software vulnerabilities in your Docker images.
To forward findings to other systems (e.g., Slack, Microsoft Teams), you have to:
- Enable Scan on push for your ECR repository.
- Create a EventBridge (previously CloudWatch Events) Rule to subscribe to the findings.
Enable Scan on push
To enable Scan on push, flip the switch when creating or updating an ECR repository.
Create an EventBridge Rule
Monitoring Assistant
Are you in a hurry? Ask marbot to do it for you!It couldn't be easier!
- Add marbot to Slack or Microsoft Teams.
- Invite marbot to a channel.
- Follow the setup wizard.
- Visit the EventBridge Console.
- Navigate to Events -> Rules.
- Create a new rule.
- Select Event pattern
Select Custom pattern and enter the following pattern:
{
"source": [
"aws.ecr"
],
"detail-type": [
"ECR Image Scan"
],
"detail": {
"scan-status": ["COMPLETE"],
"finding-severity-counts": {
"$or": [
{"CRITICAL": [{"numeric": [">", 0]}]},
{"HIGH": [{"numeric": [">", 0]}]},
{"MEDIUM": [{"numeric": [">", 0]}]},
{"UNDEFINED": [{"numeric": [">", 0]}]}
]
}
}
}Last but not least, configure the target (e.g., SNS topic). From the SNS topic, you can then distribute to other systems.
Take your AWS monitoring to a new level! Chatbot for AWS Monitoring: Configure monitoring, escalate alerts, solve incidents.