-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Amazon ECS addresses the container credentialing problem in a different way. See IAM Roles for Tasks for details. In this Amazon ECS model, containers are launched with the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI environment variable.
Every client application is supposed to look for this environment variable. If it's set, the client is to request credentials from http://169.254.170.2${AWS_CONTAINER_CREDENTIALS_RELATIVE_URI} instead of the usual /latest/meta-data/iam/security-credentials.
This change is recent, having landed in the various SDKs' default credentialing chains about a month ago. It will be some time before support for this environment variable is universal.
So: what, if anything, should iam-docker do differently?
Some ideas on possible things to do:
iam-dockercan warn if it detects theAWS_CONTAINER_CREDENTIALS_RELATIVE_URIvariable on a new container. This seems appropriate, since this variable is set by magic and thereforeiam-dockercan't guarantee that the container will receive correct credentials.iam-dockercan intercept requests forAWS_CONTAINER_CREDENTIALS_RELATIVE_URIand serve them identically to/latest/meta-data/iam/security-credentials. This ensures that it handles all credentialing requests from a container, regardless of the container credentials relative URI.iam-dockercan proxy requests forAWS_CONTAINER_CREDENTIALS_RELATIVE_URI. This would allow use ofiam-dockerfor some containers while using the official Amazon functionality for others.iam-dockercan provide per-container statistics, like{ credentials_requested: 4, container_credentials_uri_set: true, container_credentials_requested: 0 }. This would assist administrators in determining which containers are aware of this variable and which are not.