22
33# aws-ecr-client
44
5- AWS ECR client for automated push to ECR and handling of vulnerability scanning results
5+ AWS ECR client for automated push to ECR and handling of vulnerability scanning results.
6+
7+ Supports ** AWS native basic scanning** (the default since Feb 2, 2026, replacing the deprecated Clair-based scanning).
68
79Features:
810* Automatically gets authorization token for ECR repo
@@ -11,6 +13,8 @@ Features:
1113* Can ignore all CVE's of certain severity level (not recommended but useful when you have to deal with docker image over which you have no control)
1214* Can ignore individual CVE's (not recommended but useful when you might really really need to unblock that pipeline)
1315* Can output CVE scan report in Junit format so you can feed to to Jenkins or some other system for visibility
16+ * Handles scan initiation delays with AWS native scanning (automatic retries)
17+ * Paginates through all scan findings for complete results
1418
1519See examples below for more details
1620
@@ -19,7 +23,7 @@ See examples below for more details
1923```
2024NAME:
2125 aws-ecr-client-golang - AWS ECR client to automated push to ECR and handling of vulnerability.
22- Version v0.6 .0
26+ Version v0.7 .0
2327
2428USAGE:
2529 aws-ecr-client-golang [global options] command [command options] [arguments...]
@@ -49,19 +53,19 @@ Download official builds from [here](https://releases.fivexl.io/aws-ecr-client-g
4953### Push of the real tag is stopped because of CVE
5054
5155```
52- $ aws-ecr-client-golang --images XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine:3.12.12
53- aws-ecr-client, version v0.6 .0
56+ $ aws-ecr-client-golang --images XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/myimage:latest
57+ aws-ecr-client, version v0.7 .0
5458Note: Stage repo is not specified - will use the the repo of the first given image as a scanning silo
55- Push image to the scanning repo as XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine :ecs-client-scan-1662393883
56- Checking scan result for the image XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine :ecs-client-scan-1662393883
59+ Push image to the scanning repo as XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/myimage :ecs-client-scan-1770898008
60+ Checking scan result for the image XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/myimage :ecs-client-scan-1770898008
5761
5862Image scan status: COMPLETE
5963
6064Found the following CVEs
6165+----------------+-----------+----------+-------------+---------------------------------------------------------------+
6266| CVE | SEVERITY | IGNORED? | DESCRIPTION | URI |
6367+----------------+-----------+----------+-------------+---------------------------------------------------------------+
64- | CVE-2022-37434 | UNDEFINED | No | | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-37434 |
68+ | CVE-2024-58015 | HIGH | No | | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-58015 |
6569+----------------+-----------+----------+-------------+---------------------------------------------------------------+
6670
6771Ignored CVE severity levels:
@@ -74,27 +78,26 @@ Error: there are CVEs found! Please, fix them first. Will not proceed with pushi
7478### Push of the real tag with ignored CVE
7579
7680```
77- $ AWS_ECR_CLIENT_IGNORE_CVE=CVE-2022-37434 aws-ecr-client-golang --images XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine:3.12.12
78- aws-ecr-client, version v0.6 .0
81+ $ AWS_ECR_CLIENT_IGNORE_CVE=CVE-2024-58015 aws-ecr-client-golang --images XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/myimage:latest
82+ aws-ecr-client, version v0.7 .0
7983Note: Stage repo is not specified - will use the the repo of the first given image as a scanning silo
80- Push image to the scanning repo as XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine :ecs-client-scan-1662393948
81- Checking scan result for the image XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine :ecs-client-scan-1662393948
84+ Push image to the scanning repo as XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/myimage :ecs-client-scan-1770898062
85+ Checking scan result for the image XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/myimage :ecs-client-scan-1770898062
8286
8387Image scan status: COMPLETE
8488
8589Found the following CVEs
8690+----------------+-----------+------------------------------+-------------+---------------------------------------------------------------+
8791| CVE | SEVERITY | IGNORED? | DESCRIPTION | URI |
8892+----------------+-----------+------------------------------+-------------+---------------------------------------------------------------+
89- | CVE-2022-37434 | UNDEFINED | Yes (Ignored individual CVE) | | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-37434 |
93+ | CVE-2024-58015 | HIGH | Yes (Ignored individual CVE) | | https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2024-58015 |
9094+----------------+-----------+------------------------------+-------------+---------------------------------------------------------------+
9195
9296Ignored CVE severity levels:
93- Ignored CVE's: CVE-2022-37434
97+ Ignored CVE's: CVE-2024-58015
9498
9599Final scan result: Passed
96- Pushing: XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine:3.12.12
97- Done
100+ Pushing: XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/myimage:latest
98101```
99102
100103### GitLab Workflow Example
108111 APP: dts_all_batch
109112 PATH_DOCKERFILE: /
110113 DOCKER_TLS_CERTDIR: ""
111- ECR_CLIENT_VERSION: 0.6 .0
112- AWS_ECR_CLIENT_IGNORE_CVE: CVE-2022-37434
114+ ECR_CLIENT_VERSION: 0.7 .0
115+ AWS_ECR_CLIENT_IGNORE_CVE: CVE-2024-58015
113116 AWS_ECR_CLIENT_IGNORE_CVE_LEVEL: LOW INFORMATIONAL UNDEFINED
114117 services:
115118 - docker:dind
138141<testsuites>
139142 <testsuite tests="6" failures="1" time="6.000" name="Container Image CVE scan">
140143 <properties>
141- <property name="go.version" value="go1.14.4 "></property>
144+ <property name="go.version" value="go1.24.0 "></property>
142145 <property name="coverage.statements.pct" value="100"></property>
143146 </properties>
144147 <testcase classname="Container Image CVE scan" name="CRITICAL" time="1.000"></testcase>
@@ -159,20 +162,18 @@ The client handles unsupported images error (for example scratch) as another fin
159162ignoring ` ECR_ERROR_UNSUPPORTED_IMAGE `
160163
161164```
162- aws-ecr-client, version v0.6 .0
165+ aws-ecr-client, version v0.7 .0
163166Note: Stage repo is not specified - will use the the repo of the first given image as a scanning silo
164- Push image to the scanning repo as XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine:ecs-client-scan-1662392380
165- Checking scan result for the image XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine:ecs-client-scan-1662392380
167+ Push image to the scanning repo as XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine:ecs-client-scan-1770897999
168+ Checking scan result for the image XXXXXXXXXXXX.dkr.ecr.us-east-1.amazonaws.com/alpine:ecs-client-scan-1770897999
166169
167170Found the following CVEs
168- +-----------------------------+---------------+------------------------------+--------------------------------+-----+
169- | CVE | SEVERITY | IGNORED? | DESCRIPTION | URI |
170- +-----------------------------+---------------+------------------------------+--------------------------------+-----+
171- | ECR_ERROR_UNSUPPORTED_IMAGE | INFORMATIONAL | Yes (Ignored individual CVE) | UnsupportedImageError: The | |
172- | | | | operating system and/or | |
173- | | | | package manager are not | |
174- | | | | supported. | |
175- +-----------------------------+---------------+------------------------------+--------------------------------+-----+
171+ +-----------------------------+---------------+------------------------------+-----------------------------------------------------------+-----+
172+ | CVE | SEVERITY | IGNORED? | DESCRIPTION | URI |
173+ +-----------------------------+---------------+------------------------------+-----------------------------------------------------------+-----+
174+ | ECR_ERROR_UNSUPPORTED_IMAGE | INFORMATIONAL | Yes (Ignored individual CVE) | UnsupportedImageError: The operating system and/or | |
175+ | | | | package manager are not supported. | |
176+ +-----------------------------+---------------+------------------------------+-----------------------------------------------------------+-----+
176177
177178Ignored CVE severity levels:
178179Ignored CVE's: ECR_ERROR_UNSUPPORTED_IMAGE
0 commit comments