timkay / aws

Easy command line access to Amazon EC2, S3, SQS, ELB, and SDB
http://timkay.com/aws/
424 stars 123 forks source link

IAM Role Authentication is broken since commit "Support for V4 signatures. Only S3 supports V4 signatures for now" 002baa1 #89

Closed mattheworiordan closed 9 years ago

mattheworiordan commented 9 years ago

With every version of aws from commit 002baa1 onwards, when I run commands that rely on IAM role based authentication aws now no longer works.

Here is the error state with the latest version:

$ aws describe-tags --json --region=eu-west-1 --filter resource-id=i-obfuscated --sha1

{"Errors":{"Error":{"Message":"The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.","Code":"SignatureDoesNotMatch"}},"RequestID":"6ec2d44c-3596-477e-b742-obfuscated"}

And here is the correct response when I revert to commit 7b8e99d2

$ aws describe-tags --json --region=eu-west-1 --filter resource-id=i-obfuscated

{"xmlns":"http://ec2.amazonaws.com/doc/2013-10-15/","tagSet":{"item":{"aws:autoscaling:groupName":{"resourceId":"obfuscated","resourceType":"instance","value":"obfuscated"},"Version":{"resourceType":"instance","value":"obfuscated","resourceId":"obfuscated"},"DataCenterID":{"value":"A","resourceType":"instance","resourceId":"obfuscated"},"aws:cloudformation:stack-id":{"value":"obfuscated","resourceType":"instance","resourceId":"obfuscated"},"aws:cloudformation:logical-id":{"resourceId":"obfuscated","resourceType":"instance","value":"obfuscated"},"Roles":{"resourceId":"obfuscated","value":"obfuscated","resourceType":"instance"},"aws:cloudformation:stack-name":{"value":"obfuscated","resourceType":"instance","resourceId":"obfuscated"},"Name":{"resourceId":"obfuscated","resourceType":"instance","value":"obfuscated"},"Environment":{"value":"obfuscated","resourceType":"instance","resourceId":"obfuscated"},"ConfigDecryptionKey":{"resourceId":"obfuscated","resourceType":"instance","value":"obfuscated"},"Branch":{"resourceId":"obfuscated","resourceType":"instance","value":"obfuscated"}}},"requestId":"5d495b51-3445-49cd-b529-obfuscated"}
timkay commented 9 years ago

Thanks for the thorough problem report. I found the issue and have fixed it. Please pull the latest.

timkay commented 9 years ago

Did the problem get fixed?

mattheworiordan commented 9 years ago

Sorry @timkay I never replied, your fix did work.