I've been PoC'ing AWS auth and I noticed in the docs there was reference to a way of getting the IAM auth method working without using a AWS access key/secret key – given this would remove a set of keys to be managed, and by extension removes the requirement to manage IAM policies across accounts as well I wanted to investigate – see https://www.vaultproject.io/api/auth/aws/index.html#access_key – “If using the iam auth method without inferencing, then no credentials are necessary.”
Not using inferencing obviously restricts the granularity of the controls you can put in place around the call into Vault, but given my initial use case is for all EC2 instances in an AWS account to have access to a particular secret it may be permissible for this use case. The API reference states you can set the bound_Iam_principle_arn binding without inferencing and it can be wildcarded so e.g. arn:aws:iam::1234567890:instance-profile/* (of course you have to set one binding so this binding is the only option here when inferencing is not enabled correct?)
I set up the role as follows, according to the docs I don’t believe I need to set any other values since the arn is wildcarded. I’ve used various bound_Iam_principle_arn arns including just ‘*’ to be as permissible as possible.
{"allow_instance_migration":false,"auth_type":"iam","bound_account_id":"","bound_ami_id":"","bound_iam_instance_profile_arn":"","bound_iam_principal_arn":"arn:aws:iam::1234567890:instance-profile/*","bound_iam_principal_id":"","bound_iam_role_arn":"","bound_region":"","bound_subnet_id":"","bound_vpc_id":"","disallow_reauthentication":false,"inferred_aws_region":"","inferred_entity_type":"","max_ttl":1800000,"period":0,"policies":["instancebuild-policy","instancelogging-policy"],"resolve_aws_unique_ids":false,"role_tag":"","ttl":0},"wrap_info":null,"warnings":null,"auth":null}However I always receive the following error (which looks like an AWS error message wrapped in a Hashicorp error):
{"errors":["error looking up full ARN of entity \u0026{aws 1234567890 assumed-role Vault_AWS_Auth_PoC_Instance_Role i-0b49593534abecb31}: error creating IAM client: unable to fetch current caller: InvalidClientTokenId: The security token included in the request is invalid.\n\tstatus code: 403, request id: ce3228e2-58ec-11e8-8787-b30282991493"]}I know the method I am using to generate the signed API request and send it to Vault is valid since it works fine when using an alternative IAM method config with an access key and other bindings.
--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
GitHub Issues: https://github.com/hashicorp/vault/issues
IRC: #vault-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Vault" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/9d50e516-be3c-4484-9ee2-6c56f75eb11c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to vault-tool+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/915c27ed-c88b-4f4a-90f6-586a2890705b%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vault-tool/e64d54a1-357a-447f-b616-75bf9b319467%40googlegroups.com.