google-auth-library-php icon indicating copy to clipboard operation
google-auth-library-php copied to clipboard

Add workload identity federation support for ecs tasks

Open jaimemasson opened this issue 1 year ago • 6 comments

would like to be able to use workload identity federation on ecs tasks like ec2 instances.

jaimemasson avatar Nov 26 '23 20:11 jaimemasson

Hello @jaimemasson! We already have support for Workload Identity Federation! Check out the README here and let us know if you run into any problems:

https://github.com/googleapis/google-auth-library-php#external-credentials-workload-identity-federation

bshaffer avatar Nov 28 '23 20:11 bshaffer

@bshaffer this seems to only work for aws on ec2 instances but as far as i can tell ecs services(tasks) use different endpoints to assume a role and therefore this method as mentioned doesn't work. From what i can tell this should probably be handled with an update both on the downloaded credentials side and the library side but potentially handled just on the library side with some documentation. If i am mistaken and this works with ecs containers any guidance would be welcome.

jaimemasson avatar Dec 28 '23 03:12 jaimemasson

I only tested on EC2 instances.

@aeitzman do you know if WIF is supported for ECS Tasks?

bshaffer avatar Dec 28 '23 13:12 bshaffer

@bshaffer i'm pretty sure it doesn't support ecs as ec2 uses a static endpoint to retrieve cred metadata, whereas ecs tasks have a variable cred metadata endpoint set in an ENV variable

jaimemasson avatar Dec 28 '23 18:12 jaimemasson

@jaimemasson I'll get in touch with our team and see what we can do. I am also open to merging a PR if you feel like submitting support for this feature!

bshaffer avatar Jun 06 '24 17:06 bshaffer

@jaimemasson So the response here is that we don't currently support WIF for ECS Tasks natively in any of the googlea auth libraries. We did add support recently in some of the libraries for users to inject their own logic to retrieve AWS security credentials, but there's no native support in the "external account credentials file" as of yet. Its in the backlog to add eventually, but no timeline right now.

bshaffer avatar Jun 10 '24 15:06 bshaffer