aws / containers-roadmap

This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
https://aws.amazon.com/about-aws/whats-new/containers/
Other
5.22k stars 321 forks source link

[ECS] [request]: Session tags for task roles #2426

Open okhaliavka opened 2 months ago

okhaliavka commented 2 months ago

Community Note

Tell us about your request Make it possible to provide session tags to use when assuming the task IAM role.

Which service(s) is this request for?

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? We're trying to build a multi-tenant system that involves running ECS tasks on behalf of tenants. Those tasks should only have access to S3 data of their tenant. Creating an IAM role per tenant is not feasible as it quickly runs into IAM quotas, so we'd like to use ABAC to control S3 access. However, it is not currently possible in ECS, because we can't provide session tags for ECS to use when assuming the task role.

Are you currently working around this issue? Our "scheduler" assumes the task role before running an ECS task and passes the resulting credentials through environment variables. As a result, we also struggle with 1 hour hard limit on duration of chained sessions.

It would be much easier if there was a way to specify session tags on task definitions and/or in RunTask request, or at least a way to forward session tags from the principal that runs the task. Similarly, it would be nice if IRSA in EKS supported specifying session tags through service account and/or pod annotations, for all the same reasons.

Finally, I believe it would also be useful in Lambda, although IIUC it's the wrong place to raise feature requests for Lambda.

Additional context Looks like this is possible in Sagemaker.