My Organization & Created accounts problem

Hey guys, I have the following issue. We created an Organization in AWS, after which we created accounts for it, based on real email addresses, as outlined.

Now, the problem is when I log into my account (the one that was created via My Organization) I can create IAM users, groups and policies - but none of the other accounts that got created via My Organization can see them.

What am I missing here - is the Master account supposed to create the IAM roles and users, or how do I share them with the rest of the accounts that got created through My Organization?

Each account has it’s own IAM Users and Roles that are completely separate from each other.

Typically you will create a User in the master account, then allow that user to assume Roles in both the master account and the other accounts. (not giving a User any privileges other than assuming roles in the master account allow you to enforce MFA).

It’s pretty fiddly to do all this manually. I use Paco (and I’m a contributor to that project) to automate the creation and updating the Users and Roles across accounts.

Yeah, I do something similar with a cloudformation template that gets applied to every account, has a few parameters that define prod/non-prod access levels for roles.

Cross account security auditing (who did what where) is the biggest change to me right now.

This sheds a lot of light upon all this, thanks a ton!

By creating a User in the master account, you mean creating an IAM User under the Master account that created the Organization, correct?

If you could expand on this - “not giving a User any privileges other than assuming roles in the master account allow you to enforce MFA” - What does this mean in practice? I create a user under the Master account and assign it to a Group - the Group has specific policy permissions. I think I haven’t used “Roles” ever so far, although I’m not that experienced at all. How would MFA (which we’d also like to have) relate to all this?

An IAM User in master will have a Policy attached like this:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "sts:AssumeRole"
            ],
            "Resource": [
                "arn:aws:iam::************:role/IAM-User-Account-Delegate-Role-kevin-teague",
                "arn:aws:iam::************:role/IAM-User-Account-Delegate-Role-kevin-teague",
                "arn:aws:iam::************:role/IAM-User-Account-Delegate-Role-kevin-teague",
                "arn:aws:iam::************:role/IAM-User-Account-Delegate-Role-kevin-teague",
                "arn:aws:iam::************:role/IAM-User-Account-Delegate-Role-kevin-teague",
                "arn:aws:iam::************:role/IAM-User-Account-Delegate-Role-kevin-teague"
            ],
            "Effect": "Allow"
        },
        {
            "Action": [
                "iam:GetAccountPasswordPolicy",
                "iam:GetAccountSummary",
                "iam:ListVirtualMFADevices",
                "iam:ListUsers"
            ],
            "Resource": [
                "*"
            ],
            "Effect": "Allow",
            "Sid": "AllowViewAccountInfo"
        },
        {
            "Action": [
                "iam:ChangePassword",
                "iam:GetUser"
            ],
            "Resource": [
                "arn:aws:iam::*:user/username"
            ],
            "Effect": "Allow",
            "Sid": "AllowManageOwnPasswords"
        },
        {
            "Action": [
                "iam:CreateVirtualMFADevice",
                "iam:DeleteVirtualMFADevice"
            ],
            "Resource": [
                "arn:aws:iam::*:mfa/username"
            ],
            "Effect": "Allow",
            "Sid": "AllowManageOwnVirtualMFADevice"
        },
        {
            "Action": [
                "iam:DeactivateMFADevice",
                "iam:EnableMFADevice",
                "iam:ListMFADevices",
                "iam:ResyncMFADevice"
            ],
            "Resource": [
                "arn:aws:iam::*:user/username"
            ],
            "Effect": "Allow",
            "Sid": "AllowManageOwnUserMFA"
        },
        {
            "Condition": {
                "Bool": {
                    "aws:MultiFactorAuthPresent": "false"
                }
            },
            "Resource": [
                "*"
            ],
            "Effect": "Deny",
            "NotAction": [
                "iam:CreateVirtualMFADevice",
                "iam:EnableMFADevice",
                "iam:ChangePassword",
                "iam:GetUser",
                "iam:ListMFADevices",
                "iam:ListVirtualMFADevices",
                "iam:ResyncMFADevice",
                "sts:GetSessionToken",
                "iam:ListUsers"
            ],
            "Sid": "DenyAllExceptListedIfNoMFA"
        }
    ]
}

That allows the User to assume an explicit set of Roles. A Role simply has a Policy attached to it (typically AdministratorAccess) and a Trust Relationship that allows the User to assume that Role. Note there is a Policy condition that denies all if MFA is not present.

Then you need to follow AWS docs on switching roles.

But managing those IAM Users, Roles and Policies is super-fiddly - it’s why we wrote Paco, so that you can just write a little YAML and run a command to build all that out:

users:
  kevint:
    enabled: true
    account: paco.ref accounts.master
    username: kevint
    console_access_enabled: true
    account_whitelist: all
    permissions:
      administrator:
        type: Administrator
        accounts: all

###
$ paco provision resource.iam.users

That creates an IAM User with Roles in all accounts with AdministratorAccess, but you can configure a user to have more limited Roles in only a specific set of accounts.

Thank you so much about all this. It seems I have a lot of reading to do, as well as trying out Paco.

Yes, the multi-account IAM set-up takes a little while to wrap your brain around. The first time learned about it was in a little meeting room with a whiteboard tutorial by a Solutions Architect who explained for 45 minutes what was going on (and why the existing solution in real-world use was totally ganky and would need to be replaced). I left the room with my head spinning – it took some sitting down and going through each of the bits one by one to figure it all out.

FYI, while Paco also creates networks, environments and applications you could use it to just do multi-account Users and Roles and manage the rest however you like. It’s just creating a standard best practice Users and Role setup.

You might want to consider looking at Control Tower, which will stand up a lot of this infrastructure for you, including SSO, which will allow you to manage your users for all your accounts from a central location. It does sort of ‘dumb down’ some things, requiring you to have to click through a GUI to do various configurations, rather than using an API or something else more automated, but it can be a good fit depending on your situation.

When you configure your primary account as Master account you can through the aws organizations service create or add you other business accounts to the organization. This will automatically create a role named “awsorganizationaccess” in each account with a trust policy that will define the master account as a trusted account.

Returning to you question it is best practice that your IAM users are created and managed in the master account. You dont share users with other accounts but use switch account features to assume role and switch to other accounts.