-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect AWS ID is used in ECS AWS auth #2979
Comments
The vault CLI just uses whatever credentials the AWS Go SDK can pick up if they aren't specified explicitly on the command line, so it looks like the SDK is picking up the host's IAM instance profile credentials rather than the credentials supplied by the ECS task. Can you also run Looking at http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-iam-roles.html it mentions that you must be using at least version 1.11.0 of the ECS agent to pass in credentials. Can you confirm what version of the agent you're running? (The version of the go SDK used should definitely support pulling the task credentials.) |
Hi @joelthompson - yes I ran I saw some other issues opened where |
Do you have the AWS_CONTAINER_CREDENTIALS_FULL_URI environment variable set? Looking at the SDK code, it looks like Go prioritizes AWS_CONTAINER_CREDENTIALS_FULL_URI variable, while the python code (which the aws cli uses) prioritizes AWS_CONTAINER_CREDENTIALS_RELATIVE_URI, which could explain why the python and go SDKs are giving different results. |
No, it appears I have |
@joelthompson is the auth CLI helper using the credsutil helper? That forms a credential chain in a specific order, so if there are creds in different places maybe it's not the order expected? |
@jefferai -- aha! Yes, that's it. It needs to have a Honestly, I think that just using AWS's The only real difference I see is Thoughts on just moving to the RemoteCredProvider? I'll be happy to put together a PR for this. |
See #2983 |
So I was just using the CLI in order to test to see if 0.7.3 issue resolved our ECS issues. I'm currently trying to do this via the API, but however I encode the request_headers, it doesn't seem Vault likes the decoded format. I've tried a number of different formats, but still seem to be having trouble. Can you post an example format of the |
@nocode99 Each header key maps to an array of values. so it'd be something like |
@nocode99 -- something like this: {
"Authorization": [
"AWS4-HMAC-SHA256 Credential=AXXXXXXXX/20170707/us-east-1/sts/aws4_request, SignedHeaders=host;x-amz-date;x-amz-security-token;x-vault-awsiam-server-id, Signature=deadbeef"
],
"X-Amz-Date": [
"20170707T162309Z"
],
"X-Amz-Security-Token": [
"XXXXXXXX"
],
"X-Vault-awsiam-Server-Id": [
"vault.example.com"
]
} If you're using python, I have a gist for how to generate the values in python2 and python3 |
@joelthompson thanks! That worked from ECS container. We are primarily a python shop so this will definitely come in handy. |
Awesome, glad I could help! |
Should be fixed by #2983 being merged! |
I encountered this error with a different cause. Documenting for future Vaultoviles. We were getting this error referring to a seemingly arbitrary role. The role turned out to be the role of the in-VPC HTTP proxy. The proxy wasn't blocking |
Vault Version: 0.7.3
In ECS, we assign TaskRoleARN's to our ECS services/tasks.
I then launch an ECS service and from there, I run:
The invalid AWS ID is of the EC2 instance host of the container and not the container itself.
Is this something that would be resolved in the
0.7.4
release?The text was updated successfully, but these errors were encountered: