Commit ba4380b
authored
[CONTINT-5217][CONTINT-5218][CONTINT-5219][CONTINT-5220] Upgrade Docker SDK from
### What does this PR do?
Migrates the Docker SDK dependency from `github.com/docker/docker` v28.5.2+incompatible to `github.com/moby/moby` v29 sub-modules (`moby/moby/api` v1.54.1, `moby/moby/client` v0.4.0) to fix two security vulnerabilities:
- **CVE-2026-34040** (High, CVSS 7.8)
- **CVE-2026-33997** (Medium, CVSS 8.1)
Docker Engine v29 restructured its Go modules into separate sub-modules with a new Options/Result API pattern. This PR updates all 55 affected files across the codebase:
- All `github.com/docker/docker/*` imports replaced with `github.com/moby/moby/*` equivalents
- `DockerUtil` wrapper adapted to v29 Options/Result method signatures
- Filters migrated from `api/types/filters.Args` to `client.Filters`
- Removed types handled: `ContainerJSONBase` (flattened), `image.Summary.VirtualSize`, `image.InspectResponse.DockerVersion`/`ContainerConfig`
- Type changes adapted: `IPAddress` (`string` → `netip.Addr`), `Port` (`nat.Port` → `network.Port`), `ContainerState` (`string` → typed)
- `libnetwork/resolvconf` replaced with inline implementation (removed from moby/moby in v29)
- `ContainerExec*` → `Exec*` method renames applied in e2e framework
- DataDog/trivy fork updated to [PR #32](DataDog/trivy#32) which reduces docker/docker usage
- `replace` directive added to pin the remaining **indirect** `docker/docker` dependency (from otel-collector-contrib) to the `28.x` branch head which includes backported security fixes
### Motivation
Fix CVE-2026-34040 and CVE-2026-33997 affecting both the agent and cluster-agent binaries.
Jira: [CONTINT-5217](https://datadoghq.atlassian.net/browse/CONTINT-5217), [CONTINT-5218](https://datadoghq.atlassian.net/browse/CONTINT-5218), [CONTINT-5219](https://datadoghq.atlassian.net/browse/CONTINT-5219), [CONTINT-5220](https://datadoghq.atlassian.net/browse/CONTINT-5220), [VULN-59766](https://datadoghq.atlassian.net/browse/VULN-59766), [VULN-59767](https://datadoghq.atlassian.net/browse/VULN-59767), [VULN-59774](https://datadoghq.atlassian.net/browse/VULN-59774), [VULN-59775](https://datadoghq.atlassian.net/browse/VULN-59775)
### Describe how you validated your changes
- `dda inv agent.build --build-exclude=systemd` — PASS
- `dda inv cluster-agent.build` — PASS
- `dda inv test --targets=./pkg/util/docker/...` — ALL PASSED
- `dda inv test --targets=./pkg/collector/corechecks/containers/docker/...` — 15/15 PASSED
- `dda inv test --targets=./pkg/util/containers/metrics/docker/...` — ALL PASSED
- `dda inv test --targets=./comp/core/workloadmeta/collectors/internal/docker/...` — 13/13 PASSED
### Additional Notes
**Indirect `docker/docker` dependency:** `github.com/docker/docker` remains as an indirect dependency pulled in transitively by `opentelemetry-collector-contrib/dockerobserver` and other third-party modules. A `replace` directive pins it to the `28.x` branch head (`31a1689cb0a1`) which includes the same security fixes backported from v29.3.1 (not yet released as a tagged v28.x version). No datadog-agent code directly imports from `docker/docker` anymore.
**`docker.image.virtual_size` metric:** This metric now reports `image.Size` instead of the removed `image.VirtualSize` field. These values have been identical since Docker API v1.44 (`VirtualSize` was already deprecated).
[CONTINT-5217]: https://datadoghq.atlassian.net/browse/CONTINT-5217?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
Co-authored-by: lenaic.huard <lenaic.huard@datadoghq.com>docker/docker v28 to moby/moby v29 (#48777)1 parent fd8f08b commit ba4380b
60 files changed
Lines changed: 409 additions & 390 deletions
File tree
- comp/core
- workloadfilter/util/docker
- workloadmeta/collectors/internal/docker
- deps
- pkg
- collector/corechecks/containers/docker
- compliance
- tests
- flare
- logs/tailers/container
- sbom/collectors/docker
- security/tests
- util
- containers/metrics/docker
- docker
- fake
- ecs/metadata
- trivy
- releasenotes-dca/notes
- releasenotes/notes
- test
- e2e-framework
- testing/utils/e2e/client
- new-e2e
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
266 | 266 | | |
267 | 267 | | |
268 | 268 | | |
| 269 | + | |
269 | 270 | | |
270 | 271 | | |
271 | 272 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1009 | 1009 | | |
1010 | 1010 | | |
1011 | 1011 | | |
1012 | | - | |
1013 | | - | |
1014 | 1012 | | |
1015 | 1013 | | |
1016 | 1014 | | |
| |||
1643 | 1641 | | |
1644 | 1642 | | |
1645 | 1643 | | |
| 1644 | + | |
| 1645 | + | |
| 1646 | + | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + | |
| 1650 | + | |
| 1651 | + | |
| 1652 | + | |
| 1653 | + | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
| 1658 | + | |
| 1659 | + | |
| 1660 | + | |
| 1661 | + | |
| 1662 | + | |
| 1663 | + | |
| 1664 | + | |
| 1665 | + | |
1646 | 1666 | | |
1647 | 1667 | | |
1648 | 1668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| |||
Lines changed: 16 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
199 | 199 | | |
200 | 200 | | |
201 | 201 | | |
202 | | - | |
| 202 | + | |
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
| |||
459 | 459 | | |
460 | 460 | | |
461 | 461 | | |
462 | | - | |
| 462 | + | |
463 | 463 | | |
464 | 464 | | |
465 | | - | |
466 | | - | |
467 | | - | |
468 | | - | |
469 | | - | |
470 | | - | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
471 | 468 | | |
472 | 469 | | |
473 | 470 | | |
474 | 471 | | |
475 | 472 | | |
476 | 473 | | |
477 | | - | |
| 474 | + | |
478 | 475 | | |
479 | 476 | | |
480 | 477 | | |
481 | 478 | | |
482 | 479 | | |
483 | 480 | | |
484 | | - | |
485 | | - | |
| 481 | + | |
| 482 | + | |
486 | 483 | | |
487 | 484 | | |
488 | 485 | | |
489 | 486 | | |
490 | | - | |
| 487 | + | |
491 | 488 | | |
492 | 489 | | |
493 | 490 | | |
| |||
499 | 496 | | |
500 | 497 | | |
501 | 498 | | |
502 | | - | |
503 | | - | |
| 499 | + | |
| 500 | + | |
504 | 501 | | |
505 | 502 | | |
506 | 503 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
255 | | - | |
256 | 254 | | |
257 | 255 | | |
258 | 256 | | |
| |||
346 | 344 | | |
347 | 345 | | |
348 | 346 | | |
| 347 | + | |
| 348 | + | |
349 | 349 | | |
350 | 350 | | |
351 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
218 | 218 | | |
219 | 219 | | |
220 | 220 | | |
221 | | - | |
222 | | - | |
| 221 | + | |
| 222 | + | |
223 | 223 | | |
224 | 224 | | |
225 | 225 | | |
| |||
688 | 688 | | |
689 | 689 | | |
690 | 690 | | |
691 | | - | |
692 | 691 | | |
693 | 692 | | |
694 | 693 | | |
| |||
997 | 996 | | |
998 | 997 | | |
999 | 998 | | |
| 999 | + | |
| 1000 | + | |
1000 | 1001 | | |
1001 | 1002 | | |
1002 | 1003 | | |
| |||
1165 | 1166 | | |
1166 | 1167 | | |
1167 | 1168 | | |
1168 | | - | |
1169 | | - | |
1170 | 1169 | | |
1171 | 1170 | | |
1172 | 1171 | | |
| |||
1234 | 1233 | | |
1235 | 1234 | | |
1236 | 1235 | | |
1237 | | - | |
1238 | | - | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
| 1241 | + | |
1239 | 1242 | | |
1240 | 1243 | | |
1241 | 1244 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
171 | 172 | | |
172 | 173 | | |
173 | 174 | | |
174 | | - | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
210 | | - | |
| 211 | + | |
211 | 212 | | |
212 | 213 | | |
213 | 214 | | |
| |||
238 | 239 | | |
239 | 240 | | |
240 | 241 | | |
241 | | - | |
| 242 | + | |
242 | 243 | | |
243 | 244 | | |
244 | 245 | | |
| |||
337 | 338 | | |
338 | 339 | | |
339 | 340 | | |
340 | | - | |
341 | | - | |
| 341 | + | |
342 | 342 | | |
343 | 343 | | |
344 | 344 | | |
| |||
Lines changed: 10 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | | - | |
14 | | - | |
| 14 | + | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
138 | 139 | | |
139 | 140 | | |
140 | 141 | | |
141 | | - | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
169 | 170 | | |
170 | 171 | | |
171 | 172 | | |
172 | | - | |
| 173 | + | |
173 | 174 | | |
174 | 175 | | |
175 | 176 | | |
| |||
182 | 183 | | |
183 | 184 | | |
184 | 185 | | |
185 | | - | |
| 186 | + | |
186 | 187 | | |
187 | 188 | | |
188 | 189 | | |
| |||
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
222 | | - | |
| 223 | + | |
223 | 224 | | |
224 | 225 | | |
225 | 226 | | |
226 | 227 | | |
227 | 228 | | |
228 | 229 | | |
229 | 230 | | |
230 | | - | |
| 231 | + | |
231 | 232 | | |
232 | 233 | | |
233 | | - | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
293 | 294 | | |
294 | 295 | | |
295 | 296 | | |
296 | | - | |
| 297 | + | |
297 | 298 | | |
298 | 299 | | |
299 | 300 | | |
| |||
0 commit comments