Schedule icon
AwsCLI icon
Return icon
If icon
Create icon
SlackIncomingWebhook icon
Log icon

AWS ECR Image Vulnerability Scan Sentinel

Inspect AWS ECR container image vulnerability scan findings, detect Critical/High CVEs, create GitHub remediation issues, and alert Slack.

Categories
CloudInfrastructure

Container image vulnerabilities can introduce exploitable attack vectors if unpatched packages reach production clusters. While Amazon ECR supports automated image scanning with Clair or Amazon Inspector, security teams often lack continuous, auditable alerting pipelines that translate scan results into tracked engineering tickets. This blueprint regularly queries Amazon ECR for container image scan findings, categorizes critical and high-severity CVEs, files a prioritized GitHub remediation issue, and alerts on-call security teams via Slack.

How it works

  1. daily_ecr_security_scan (io.kestra.plugin.core.trigger.Schedule) triggers the audit on a recurring schedule (default daily at 06:00 UTC, shipped disabled for manual verification).
  2. probe_ecr_scan_findings (io.kestra.plugin.aws.cli.AwsCLI) runs aws ecr describe-image-scan-findings, capturing image scan findings, vulnerability summaries, and severity counts.
  3. evaluate_vulnerability_counts (io.kestra.plugin.core.debug.Return) safely extracts the count of CRITICAL, HIGH, and MEDIUM vulnerabilities from the scan findings output.
  4. branch_on_vulnerabilities (io.kestra.plugin.core.flow.If) checks if any CRITICAL or HIGH vulnerabilities exist:
    • then: Automatically opens a GitHub security issue with remediation context via create_github_security_issue (io.kestra.plugin.github.issues.Create) and dispatches a rich notification via alert_secops_slack (io.kestra.plugin.slack.notifications.SlackIncomingWebhook).
    • else: Emits an informational log entry (log_clean_image) confirming compliance.
  5. log_audit_summary (io.kestra.plugin.core.log.Log) records the final scan state for continuous observability.
  6. The errors block alerts Slack if credentials expire, the repository is missing, or the ECR API call fails.

What you get

  • Automated, continuous scanning and reporting for container repositories.
  • Zero manual console inspection needed to discover critical and high CVEs.
  • Automated creation of GitHub tracking tickets for development teams to rebuild images.
  • Direct Slack notifications containing severity breakdowns and ticket hyperlinks.

Who it's for

  • DevSecOps engineers responsible for container supply chain security.
  • Platform teams managing Kubernetes and ECS container deployments.
  • Cloud security officers establishing automated vulnerability SLAs.

Why orchestrate this with Kestra

Connecting cloud provider APIs (AWS ECR), security issue trackers (GitHub), and team communication channels (Slack) requires a resilient orchestration engine. Kestra manages secrets natively, handles scheduled cron executions, isolates command environments, and provides full execution audit trails without requiring custom container daemons or fragmented serverless functions.

Prerequisites

  • An AWS account with an active ECR repository and enhanced or basic image scanning enabled.
  • An AWS IAM user or role with ecr:DescribeImageScanFindings permission.
  • A GitHub Personal Access Token with repository issue creation permissions.
  • A Slack incoming webhook URL for SecOps alerts.

Secrets

  • AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY: AWS credentials with read permissions for ECR.
  • GITHUB_TOKEN: GitHub token used to open vulnerability remediation issues.
  • SLACK_WEBHOOK: Slack Incoming Webhook URL for security alerts.

Inputs

  • aws_region (STRING, default us-east-1): Target AWS region hosting the ECR repository.
  • repository_name (STRING, default production-backend-app): Name of the ECR repository to audit.
  • image_tag (STRING, default latest): Tag of the container image to inspect for vulnerabilities.
  • github_repository (STRING, default my-org/security-remediations): GitHub repository (owner/repo) where security issues are created.

Outputs

  • outputs.probe_ecr_scan_findings.vars.imageScanFindings: The raw scan findings returned by AWS ECR.
  • outputs.evaluate_vulnerability_counts.value: Extracted vulnerability count object containing critical_count, high_count, medium_count, and has_high_or_critical.

Quick start

  1. Configure the AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, GITHUB_TOKEN, and SLACK_WEBHOOK secrets in your Kestra namespace.
  2. Import this flow and set repository_name and image_tag to point to an existing scanned image.
  3. Run the flow manually to verify vulnerability extraction and Slack notification delivery.
  4. Enable the daily_ecr_security_scan trigger to enforce continuous daily vulnerability monitoring.

How to extend

  • Add an automated notification to PagerDuty or Opsgenie if critical_count exceeds a designated SLA threshold.
  • Add an automated tag mutation or image quarantine action (aws ecr put-image-tag-mutability) to block vulnerable images from deployment.
  • Loop over multiple repository names using Kestra's io.kestra.plugin.core.flow.ForEach task.

Links

See How

New to Kestra?

Use blueprints to kickstart your first workflows.