amazon-ecr-credential-helper icon indicating copy to clipboard operation
amazon-ecr-credential-helper copied to clipboard

Not working with IMDSv2

Open waiyanmin95 opened this issue 2 years ago • 4 comments

OS: Ubuntu 20.04

I'm facing the issue ( can't use amazon-ecr-credential-helper ) with EC2 IMDSv2. I used the EC2 Instance profile and attached it to the EC2 instance.

waiyanmin95 avatar Jun 07 '22 20:06 waiyanmin95

It would be really great if the debug logging around IMDS was improved while this is being 'fixed'. It look us far too long to figure out this was the issue...

danwashusen avatar Jun 24 '22 05:06 danwashusen

I hit this problem too. I changed IMDSv2 session tokens to "required" and then amazon-ecr-credential-helper version 0.6.0 stopped returning credentials. When I set the IMDS session tokens back to "optional" then the credential helper started returning credentials again.

I looked back in the issues and found #215 which indicates that amazon-ecr-credential-helper should work with IMDSv2 since version 0.5.0. I'm not sure if this is a regression or if this functionality didn't work even in 0.5.0.

ptrdlbrg avatar Sep 16 '22 22:09 ptrdlbrg

same for me,

trying using imds v2 but still got result :

$ echo "xxxxxxxxxxxx.dkr.ecr.us-west-2.amazonaws.com" | docker-credential-ecr-login get

credentials not found in native keychain

any workaround to fix this issue?

kholisrag avatar Sep 30 '22 05:09 kholisrag

I had this issue as well, but I noticed that my version of docker-credential-ecr-login was old:

$ docker-credential-ecr-login -v
amazon-ecr-credential-helper
Version:    0.3.1
Git commit: b4a1707

I updated the binary in-place, after installing:

$ sudo curl https://amazon-ecr-credential-helper-releases.s3.us-east-2.amazonaws.com/0.6.0/linux-amd64/docker-credential-ecr-login -o `which docker-credential-ecr-login`
$ sudo chmod +x `which docker-credential-ecr-login`

And now it is working as expected on a machine that only supports IMDSv2!

adkafka avatar Oct 06 '22 00:10 adkafka