Skip to content

Consider AWS_CONTAINER_CREDENTIALS_RELATIVE_URI #13

Description

@willglynn

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:

  1. iam-docker can warn if it detects the AWS_CONTAINER_CREDENTIALS_RELATIVE_URI variable on a new container. This seems appropriate, since this variable is set by magic and therefore iam-docker can't guarantee that the container will receive correct credentials.
  2. iam-docker can intercept requests for AWS_CONTAINER_CREDENTIALS_RELATIVE_URI and 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.
  3. iam-docker can proxy requests for AWS_CONTAINER_CREDENTIALS_RELATIVE_URI. This would allow use of iam-docker for some containers while using the official Amazon functionality for others.
  4. iam-docker can 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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions