Repository navigation
Add IMDS credential refresher - #4953
Merged
Merged
Conversation
singholt
force-pushed
the
dev
branch
2 times, most recently
from
May 5, 2026 21:48
92aa4b2 to
c3a258e
Compare
singholt
marked this pull request as ready for review
May 6, 2026 16:06
singholt
enabled auto-merge (rebase)
May 6, 2026 20:19
ShelbyZ
previously approved these changes
May 6, 2026
mye956
reviewed
May 6, 2026
- ecs-agent/credentials/imds: Parse role type from credential key, add RoleType to TaskCredential. - agent/api/task: Add GetCredentialsIDForRoleType method. - agent/imdscreds: New package with periodic IMDS credential refresher. - agent/app: Wire up refresher in startAsyncRoutines, gated behind IMDSIAMRolesEnabled.
mye956
approved these changes
May 6, 2026
ShelbyZ
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add periodic IMDS credential scanning to the ECS agent, consuming the scanner from the shared library. The refresher retrieves rotated task credentials from IMDS and upserts them into the credentials manager. This feature is gated
behind the IMDSIAMRolesEnabled config (disabled by default).
Implementation details
Testing
New tests cover the changes: yes, added unit tests.
Also manually built the ECS agent and ran it on a test instance to verify that the new refresher isn't initialized yet, since the feature is disabled.
Integration tests to test the integration between the agent/app, agent/imdscreds, ecs-agent/credentials/imds/, mock task payloads, and a mock IMDS server, will be added in a followup PR.
Description for the changelog
Feature - Add IMDS credential refresher for periodic task credential rotation via IMDS (config-disabled for now).
Additional Information
Does this PR include breaking model changes? No
Does this PR include the addition of new environment variables in the README? No
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.