For some small hobby projects, I use AWS Organization to manage the different stages of applications. An application will have a DEVELOPMENT account and a PRODUCTION account for the respective stages. Each application is in its own OU (containing both stages).
Now, I usually login via the Administrator role (IAM of root user) and then assume either DEVELOPMENT or PRODUCTION. I’m pretty sure this isn’t best practice.
In addition, I now want to give a friend of mine access to the DEVELOPMENT/PRODUCTION account of a certain project. This is where this approach is clearly not working anymore. Therefore I wanted to ask, what is the recommended way of setting up and giving access to developer accounts?
I am sure that there are other ways to do this, I believe that using AWS SSO is one way, but I haven’t used it, I started reading the documentation and it seemed like a solution for a big org as it didn’t seem like a simple way to set up access.
In the org I work for, we use a 3rd party authentication provider to allow users to log in to an account.
To do this a user will log in to this provider (that would be okta or opal.dev in our case), if they want console access they can select the role/account they want and they are then provided with access through their web session (but it will only work for an hour). CLI access is also handled fairly nicely, opal provide a cli tool for this and okta have one, but it is being phased out now (which is why we now use opal),. These basically just update your `.aws/config` or credentials file so that when you try to use awscli/terraform/whatever it finds the creds in your env
When the user logs in, they are given access to a role in the management account, this role has the ability to assume the other roles in the other accounts, and no other permissions. This means they don’t have access to the root management account, instead they can basically do nothing in the management account, until they assume another role. To make switching roles easier in the browser we use the role switcher plugin
Actually in the case of opal, it’s actually a user in the management account, but assuming roles is the same, I believe using a role instead is on the way
We use SSO and Azure AD.
Then we provision permission sets which become roles on accounts and assign users or groups to the account-permission set combo.
We have a very restricted permission set for prod. Set up so the devs can only view the “surface” of things and only read logs and a dlq-messages and such. No data-access. Only read access on the little they can see.
Thanks for all the answers. After doing some more googling, and your input, I have found that I could setup AWS Control Tower, which will automatically setup some blueprints I could use, as well as AWS IAM Identity Center (successor to AWS SSO). I would move existing users and OUs into the new Control Tower setup. Then I can setup access for the devs in AWS IAM Identity Center.
It’s reasonable, and certainly the way to go when you have tens or hundreds of devs to support.
The biggest drawback is that you have to sign-in to a login session for each AWS account. So it’s a bit of a hassle to MFA in for each account (and I typically run something like Firefox multi-account container for each account).
Having a plain IAM User in a central account and creating Roles that you can switch to in the sub-accounts means you can MFA once and use AWS Extend Switch Roles to bounce between accounts. It’s much faster for bouncing between accounts. If you want to scale that style to tens of users, a tool like Paco lets you declare what kind of Roles you can assume and who is allowed to assume each one, then it takes care of setting up those Roles for you. IAM Role trust policies have something like a 2048 char limit, so it doesn’t scale beyond around 30 users or so though …