Commit 2e7c715
committed
Add container name to ECS ListTagsForResource request headers
Enhance CloudTrail visibility by including container name in HTTP User-Agent
header when ECS agent makes ListTagsForResource API calls on behalf of containers.
Changes:
- Add ContainerNameByV3EndpointID method to TaskEngineState interface
- Modify NewTaskResponse to accept v3EndpointID and pass container name to context
- Update GetResourceTags to accept context parameter for container identification
- Enhance ecsRoundTripper.userAgent to append container name from request context
- Update TMDS v4 handler to pass endpoint ID through call chain
- Add comprehensive unit tests for new functionality
This enables tracing HTTP requests from containers to specific ECS API calls
in CloudTrail logs, improving observability and debugging capabilities.1 parent 6e9b8f3 commit 2e7c715
File tree
22 files changed
+439
-100
lines changed- agent
- engine/dockerstate
- mocks
- handlers
- v2
- v3
- v4
- vendor/github.com/aws/amazon-ecs-agent/ecs-agent
- api/ecs
- client
- mocks
- httpclient
- ecs-agent
- api/ecs
- client
- mocks
- httpclient
22 files changed
+439
-100
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
| 86 | + | |
85 | 87 | | |
86 | 88 | | |
87 | 89 | | |
| |||
713 | 715 | | |
714 | 716 | | |
715 | 717 | | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
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 | |
|---|---|---|---|
| |||
2514 | 2514 | | |
2515 | 2515 | | |
2516 | 2516 | | |
| 2517 | + | |
2517 | 2518 | | |
2518 | 2519 | | |
2519 | 2520 | | |
| |||
2529 | 2530 | | |
2530 | 2531 | | |
2531 | 2532 | | |
2532 | | - | |
| 2533 | + | |
2533 | 2534 | | |
2534 | | - | |
| 2535 | + | |
2535 | 2536 | | |
2536 | 2537 | | |
2537 | 2538 | | |
| |||
2548 | 2549 | | |
2549 | 2550 | | |
2550 | 2551 | | |
2551 | | - | |
2552 | | - | |
| 2552 | + | |
| 2553 | + | |
2553 | 2554 | | |
2554 | 2555 | | |
2555 | 2556 | | |
| |||
2564 | 2565 | | |
2565 | 2566 | | |
2566 | 2567 | | |
2567 | | - | |
2568 | | - | |
| 2568 | + | |
| 2569 | + | |
2569 | 2570 | | |
2570 | 2571 | | |
2571 | 2572 | | |
| |||
2578 | 2579 | | |
2579 | 2580 | | |
2580 | 2581 | | |
2581 | | - | |
2582 | | - | |
| 2582 | + | |
| 2583 | + | |
2583 | 2584 | | |
2584 | 2585 | | |
2585 | 2586 | | |
| |||
2644 | 2645 | | |
2645 | 2646 | | |
2646 | 2647 | | |
2647 | | - | |
2648 | | - | |
| 2648 | + | |
| 2649 | + | |
2649 | 2650 | | |
2650 | 2651 | | |
2651 | 2652 | | |
| |||
2677 | 2678 | | |
2678 | 2679 | | |
2679 | 2680 | | |
2680 | | - | |
2681 | | - | |
| 2681 | + | |
| 2682 | + | |
2682 | 2683 | | |
2683 | 2684 | | |
2684 | 2685 | | |
| |||
2693 | 2694 | | |
2694 | 2695 | | |
2695 | 2696 | | |
2696 | | - | |
2697 | | - | |
| 2697 | + | |
| 2698 | + | |
2698 | 2699 | | |
2699 | 2700 | | |
2700 | 2701 | | |
| |||
2707 | 2708 | | |
2708 | 2709 | | |
2709 | 2710 | | |
2710 | | - | |
2711 | | - | |
| 2711 | + | |
| 2712 | + | |
2712 | 2713 | | |
2713 | 2714 | | |
2714 | 2715 | | |
| |||
2818 | 2819 | | |
2819 | 2820 | | |
2820 | 2821 | | |
2821 | | - | |
2822 | | - | |
| 2822 | + | |
| 2823 | + | |
2823 | 2824 | | |
2824 | 2825 | | |
2825 | 2826 | | |
| |||
2857 | 2858 | | |
2858 | 2859 | | |
2859 | 2860 | | |
2860 | | - | |
2861 | | - | |
| 2861 | + | |
| 2862 | + | |
2862 | 2863 | | |
2863 | 2864 | | |
2864 | 2865 | | |
| |||
2874 | 2875 | | |
2875 | 2876 | | |
2876 | 2877 | | |
2877 | | - | |
2878 | | - | |
| 2878 | + | |
| 2879 | + | |
2879 | 2880 | | |
2880 | 2881 | | |
2881 | 2882 | | |
| |||
2891 | 2892 | | |
2892 | 2893 | | |
2893 | 2894 | | |
2894 | | - | |
2895 | | - | |
| 2895 | + | |
| 2896 | + | |
2896 | 2897 | | |
2897 | 2898 | | |
2898 | 2899 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
21 | 23 | | |
| 24 | + | |
22 | 25 | | |
23 | 26 | | |
24 | 27 | | |
| |||
37 | 40 | | |
38 | 41 | | |
39 | 42 | | |
| 43 | + | |
40 | 44 | | |
41 | 45 | | |
42 | 46 | | |
| |||
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
102 | | - | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
107 | 111 | | |
108 | 112 | | |
109 | | - | |
110 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
111 | 120 | | |
| 121 | + | |
| 122 | + | |
112 | 123 | | |
113 | 124 | | |
114 | 125 | | |
| |||
118 | 129 | | |
119 | 130 | | |
120 | 131 | | |
121 | | - | |
| 132 | + | |
| 133 | + | |
122 | 134 | | |
123 | 135 | | |
124 | 136 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| |||
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
134 | | - | |
| 135 | + | |
135 | 136 | | |
136 | 137 | | |
137 | 138 | | |
| |||
147 | 148 | | |
148 | 149 | | |
149 | 150 | | |
150 | | - | |
| 151 | + | |
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
233 | | - | |
| 234 | + | |
234 | 235 | | |
235 | 236 | | |
236 | 237 | | |
| |||
455 | 456 | | |
456 | 457 | | |
457 | 458 | | |
458 | | - | |
| 459 | + | |
| 460 | + | |
459 | 461 | | |
460 | 462 | | |
461 | 463 | | |
| |||
465 | 467 | | |
466 | 468 | | |
467 | 469 | | |
468 | | - | |
| 470 | + | |
469 | 471 | | |
470 | 472 | | |
471 | 473 | | |
| |||
477 | 479 | | |
478 | 480 | | |
479 | 481 | | |
480 | | - | |
| 482 | + | |
481 | 483 | | |
482 | 484 | | |
483 | 485 | | |
| |||
711 | 713 | | |
712 | 714 | | |
713 | 715 | | |
714 | | - | |
715 | | - | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
716 | 719 | | |
717 | 720 | | |
718 | | - | |
| 721 | + | |
719 | 722 | | |
720 | 723 | | |
721 | 724 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
0 commit comments