Separating out from #3179
There's a use case that came up on the mailing list that would be solved by supporting binding to IAM groups in the AWS auth backend.
Here's my current thinking and open questions about what the "right" behavior would be:
When binding a role to an IAM group:
iam:GetGroup to look up the unique ID of the group and store the group unique IDWhen logging in:
iam:ListGroupsForUser (and paginate through the results) to see if the authenticated user is a member of the bound groupiam:ListGroupsForUser contains the group ID for each group the user is a member ofarn:aws:iam:::123456789012:* and the authenticating user is arn:aws:iam::987654321098:user/Joe then there could never be a match to a group (since AWS doesn't allow cross-account group membership)arn:aws:iam::<authenticated principal's account ID>:group and contains a wildcard at the end? Would need to spend more time thinking this through.When renewing tokens:
The biggest thing stopping me from implementing this today is testability because this now introduces even more interactions with AWS APIs, and in more complicated places. I just don't think this (IAM group support) can be done in a maintainable way without having some real mocking of AWS APIs (something I'd guess the AWS secret backend could also benefit from). I recall that the Terraform AWS provider had some basic mocking that might prove useful here; has there been any discussion about sharing that out into a more common HashiCorp library? If not, I'll probably work on this first; a couple links for future reference.
There hasn't been any discussion from our end, but I do encourage you to reach out to the TF devs about it if it would be useful. (I can make introductions if that would help.)
Cool, I'd definitely love to chat with the TF folks! Maybe HashiConf?
Sure, depends on what your timeline is -- if you want to get a shared framework in for 0.8.2 should probably chat ahead of then, but otherwise that would be fine.
I don't have any timelines, and thinking a little more broadly, I also wonder if there'd be interest from the Packer and/or Nomad teams as well in something like this, and/or if they also have code that could be pulled into a shared library. Feels like HashiConf would be the perfect time to have a quick chat about this. If you could make introductions, that'd be awesome!
Sure! Hit me up then and I'll find people for us to talk to.
Hi there! Just stumbled upon this ticket while looking into using this functionality. I was wondering if there was any progress on this or any roadmap for it? Thanks!
@joelthompson @jefferai This would actually make it a lot nicer from a user management perspective. We have a bunch of users that exist at the root users/ level, alongside a bunch of user-instance credentials that we don't want to allow similar access to assume roles.
Supporting Groups would allow us to not move/migrate all users over to a separate users/devs/* path to differentiate them.
This would be magnificent
That would be really nice if its implemented and would definitely help
Most helpful comment
@joelthompson @jefferai This would actually make it a lot nicer from a user management perspective. We have a bunch of users that exist at the root
users/level, alongside a bunch of user-instance credentials that we don't want to allow similar access to assume roles.Supporting
Groupswould allow us to not move/migrate all users over to a separateusers/devs/*path to differentiate them.