Commit d471c70
authored
Add docker login for daily scan workflow image scanning (#1144)
*Description of changes:*
The current daily scan's image scan workflow would often fail with the
following error:
```
2025-08-12T22:35:36Z INFO [vuln] Vulnerability scanning is enabled
2025-08-12T22:35:36Z INFO [secret] Secret scanning is enabled
2025-08-12T22:35:36Z INFO [secret] If your scanning is slow, please try '--scanners vuln' to disable secret scanning
2025-08-12T22:35:36Z INFO [secret] Please see also https://trivy.dev/v0.64/docs/scanner/secret#recommendation for faster secret detection
📣 Notices:
- Version 0.65.0 of Trivy is now available, current version is 0.64.1
To suppress version checks, run Trivy scans with the --skip-version-check flag
2025-08-12T22:35:37Z FATAL Fatal error run error: image scan error: scan error: unable to initialize a scan service: unable to initialize an image scan service: unable to find the specified image "public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v2.11.1" in ["docker" "containerd" "podman" "remote"]: 4 errors occurred:
* docker error: unable to inspect the image (public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v2.11.1): Error response from daemon: No such image: public.ecr.aws/aws-observability/adot-autoinstrumentation-java:v2.11.1
* containerd error: failed to list images from containerd client: connection error: desc = "transport: Error while dialing: dial unix /run/containerd/containerd.sock: connect: permission denied"
* podman error: unable to initialize Podman client: no podman socket found: stat /run/user/1001/podman/podman.sock: no such file or directory
* remote error: GET https://public.ecr.aws/v2/aws-observability/adot-autoinstrumentation-java/manifests/sha256:7ebd362ec33ad1fa0218535540cec4db3165364fe0715b892e90afdf2374b531: TOOMANYREQUESTS: Rate exceeded
```
Turns out the issue is related to making unauthenticated GET request
calls to public ECR images.
We make these calls both in the `pr_build` (explanation can be found in
the code comment) and in `owasp.yml`. Likely, our GET requests to pull
the ADOT image are being throttled as a result.
https://github.com/aws-observability/aws-otel-java-instrumentation/blob/7ffb3d4f9200b10f7701926ff240dd5c0b36d136/.github/actions/image_scan/action.yml#L24
- Adding an intermediary step to log-in to ECR before making the GET
request calls for `owasp.yml` image scanning.
**Testing**
200 Image Scan test runs with docker login (0 failed jobs):
https://github.com/aws-observability/aws-otel-java-instrumentation/actions/runs/16922020570/job/47950156083
200 Image Scan test runs w/o docker login (1 failed job, rest didn't
run):
https://github.com/aws-observability/aws-otel-java-instrumentation/actions/runs/16922512730/job/47951639594
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.1 parent 3f34807 commit d471c70
File tree
3 files changed
+22
-0
lines changed- .github
- actions/image_scan
- workflows
3 files changed
+22
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
14 | 19 | | |
15 | 20 | | |
16 | 21 | | |
| |||
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| 30 | + | |
25 | 31 | | |
26 | 32 | | |
27 | 33 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
81 | 92 | | |
82 | 93 | | |
83 | 94 | | |
84 | 95 | | |
85 | 96 | | |
86 | 97 | | |
87 | 98 | | |
| 99 | + | |
88 | 100 | | |
89 | 101 | | |
90 | 102 | | |
| |||
93 | 105 | | |
94 | 106 | | |
95 | 107 | | |
| 108 | + | |
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
| |||
101 | 114 | | |
102 | 115 | | |
103 | 116 | | |
| 117 | + | |
104 | 118 | | |
105 | 119 | | |
106 | 120 | | |
| |||
109 | 123 | | |
110 | 124 | | |
111 | 125 | | |
| 126 | + | |
112 | 127 | | |
113 | 128 | | |
114 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
| 150 | + | |
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
| |||
0 commit comments