I need to be able to programmatically create users and assign those users some permissions. However, I don’t want the program that creates the users to have the ability to create users with arbitrary permissions. I only want it to be able to grant specific permissions to the users it creates.
What I want to do:
-
Create a “master” user that has an IAM access key, to be used by my program
-
Grant that master user the ability to create other users and create policies for those users
-
Restrict which permissions the master user is allowed to assign to the policies it creates
I’m having a really hard time googling this question, I just keep finding generic info about policy permissions.
Permission Boundaries (https://aws.amazon.com/blogs/security/when-and-where-to-use-iam-permissions-boundaries) can be used to fulfill your use case. The intent is to establish a guardrail on what permissions can be applied to an IAM principal.
Exactly what I was looking for, thanks!
To add a little detail to this answer, you can create a policy with a permission boundary which requires that any policies created by it also have the same permission boundary. This means that even if you create a “full admin” policy, it can never have that effect because of the enforced boundary.
Welcome to permission boundaries
Yep. It doesn’t stop policies from being applied but it stops them from working if they exceed what is allowed in the boundary policy
As others have said, you can do this with Permission Boundaries. However, few people use these in practice because it quickly becomes convoluted unless the use case is very simple. Can you parameterise your policy somehow to avoid the need for this?
Thanks for the info, I’ll look into that. I did get it working using permission boundaries, but you’re right, my permissions are significantly more complicated now