Hi All,
I'm setting up vault 0.7.0 to authenticate EC2 instances across a few AWS accounts. This is working inside the account where vault is installed. I have also confirmed using boto and ipython that the vault instance is able to get temporary credentials from STS, and use them to describe instances in the target account.
The problem I'm running into is trying to do a login operation from an instance in the target AWS account. Here is what happens:
alex@sandbox-:~
$ vault write auth/aws-ec2/login role=sandbox pkcs7=$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/pkcs7 | tr -d '\n') nonce='nonce'
Error writing data to auth/aws-ec2/login: Error making API request.
URL: PUT https://vault-1.<REDACTED>:8200/v1/auth/aws-ec2/login
Code: 400. Errors:
* failed to verify instance ID: no reservations found in instance descriptionI've tried running this operation with vault logging debug messages, but it did not generate any.
FWIW, here's how I verified cross-account access is working in general for the vault instance:
In [1]: import boto
In [2]: conn_sts = boto.connect_sts()
In [3]: s = conn_sts.assume_role('arn:aws:iam::<REDACTED>:role/Vault', 'test-role-session')
In [4]: conn_ec2 = boto.connect_ec2(aws_access_key_id=s.credentials.access_key, aws_secret_access_key=s.credentials.secret_key, security_token=s.credentials.session_token)
In [5]: len(conn_ec2.get_all_instances())
Out[5]: 458
In [6]: conn_ec2 = boto.connect_ec2()
In [7]: len(conn_ec2.get_all_instances())
Out[7]: 30