r/aws•
baseballray

Am I understanding AWS Accounts correctly?

general aws

I'm coming from Google Cloud, where there is a clear concept of Organizations and Projects. Inside an Organization, you create projects and can easily jump between them.

I'm moving some infrastructure to AWS and have been reading about Organizations and Accounts.

I'd like to have one organizations, with three infrastructure OUs for each environment (dev, staging, production).

From what I've gathered, I add an Account to an Organization, specifying an email, name, and IAM role.

Once that account is created, I sign in with "root" credentials with that email, clicking Forgot Password because now AWS account exists with that email address yet.

I get the lost password email, set the email, and complete the sign up process by:

  • Provide contact information
  • Agree to the terms of the AWS Customer Agreement
  • Provide a payment method, such as a credit card
  • Complete phone verification
  • Choose a support option

At that point, I can begin administering resources under this Account within the Organization.

Is that right? Because this whole process seems fundamentally flawed. I have to be missing something here, but I cannot find anything.

Does it seem right that:

  1. I'm creating accounts with aforementioned process?
  2. I'm setting billing details for each Account, when I'm attempting to make the account that owns the Organization the Payer?
  3. I have to login to a separate account to administer anything related to that account, despite each Account belonging to the same Organization?

Posted Nov 1, 2019, 1:42 PM UTC

4239
poolpog•

I've talked with AWS technical reps a bunch about this.

They talk a lot about setting up an "account vending machine" -- you should read up on that term. I haven't actually used that pattern myself, though, by way of not needing to yet.

The "Account" in AWS is the strictest, most rigorous level of authorization. Cross-account communication is denied by default, and AWS has put a lot of work into ensuring account data, access, or authorization can't leak over to other accounts. You *can* explicitly permit cross-account communication in a number of ways, though.

This leads to some important points:

  • Only log in as the root account owner to do tasks that are only possible by that user identity.
  • Move all other actions to IAM identities
  • Ensure your root account is *strongly protected*:
    • LONG password
    • Mandatory 2FA
    • Change the password regularly
    • Ensure the password is saved in a very safe location
  • If your root account gets hacked, YOU ARE FUCKED

Anyway, I don't know anything about GCP so I can't map the AWS concepts to GCP ones. It just strikes me that you are asking about their "account vending machine" pattern.

Here's an example article that dives into this pattern: https://aws.amazon.com/blogs/awsmarketplace/automate-aws-account-provisioning-and-server-migration-using-aws-service-catalog-and-cloudendure-from-aws-marketplace/

24
brennanfee•

They talk a lot about setting up an "account vending machine" -- you should read up on that term. I haven't actually used that pattern myself, though, by way of not needing to yet.

Their new product called "Control Tower" can be used and it has an "account vending machine".

13
Mamoulian•

Wanted a Account Vending Machine. Looked into it but it required a 'Landing Zone' which included a lot of stuff we didn't need and there seemed to be no way to disable.

Ended up scripting account creation with Ansible, not brilliant but better than doing it manually.

5
brennanfee•

That is all what Control Tower is meant to provide. Control tower will install a landing zone and set up an AVM for you.

5
poolpog•

This is really what the technical reps talked about -- this concept as a pattern, but not with any specific tool. i.e. using Ansible totally satisfies the pattern.

3
Mamoulian•

It does, but it was some effort to get working, as opposed to the AVM which was created exactly for our needs and I assume does what we want without the time we spent cobbling scripts together. If only we could have just had the AVM and not all the other Landing Zone stuff!

Sadly Ansible couldn't handle all of it and we had to supplement with bash scripts. Some of it was down to Organisation module limitations and a lot to password entry/creation/storage - we pushed the limits of Ansible Vault.

Fair enough for Ansible really as this is in that 10% long-tail of low priority feature requirements... I guess all tools (Terraform?) have a similar 10% although maybe in different areas.

1
CrmsonandClover•

I’m curious, has anyone used control tower yet? It doesn’t look like it has an API. Isn’t that unusual for AWS?

2
brennanfee•

I’m curious, has anyone used control tower yet?

Yes, lots of companies. Admittedly it is very early yet and so some of the missing features do prevent some companies from using it (especially given that you currently can't migrate to it, you have to start "clean" as it were).

But, as with most AWS services it will gain features quickly and more and more companies will use it.

Previously, I had 3 accounts myself for personal use of some different things. I created a whole new account to create as my "master" and moved my workloads over to three new accounts in Control Tower just so I can get the security benefits and central "view" it provides. (I'm also checking out the other new service Security Hub.)

It doesn’t look like it has an API.

True. But Control Tower is unique in what it is and what is intended to do. So, I don't know if it will ever have an API. The AVM sort of does have an API since it is just a "product" offered in Service Catalog.

Anyway, if you have any questions I'm happy to answer them given I have first-hand experience in my own accounts.

3
MakeWay4Doodles•

100% agree except for one point:

  • Change the password regularly

IF the password is a strong password that you've never used elsewhere, changing it frequently actually adds additional risk and is no longer considered best practice.

11
poolpog•

yeah. i actually considered leaving that one off. there is a lot of industry confusion around this particular item. For example

  • PCI/DSS recommends password changes at most every 90 days
  • Most large corporate IT policies do likewise
  • However, more leading-edge security practitioners no longer recommend that frequency, and only recommend changing password after some sort of event (even if the event didn't necessarily affect you)

personally, at work, I follow whatever standard my workplace requires for some sort of compliance reason. at home, I try to use long passwords I don't know.

1
skat_in_the_hat•

changing it frequently actually adds additional risk and is no longer considered best practice.

Did you pull that out of your ass? Or are you going to cite something? Because I have not heard this, and an old ass backup that gets compromised would have your active password(unique or not). So this information seems incorrect.

-13
potassium-mango•

Why would backups contain passwords?

5
skat_in_the_hat•

if you snapshot a VM the password file and ldap shit are in there. If you dump a database with users to a website, the hashed passwords are in it. If you run a mailserver that uses virtual accounts, those users/passwords are in the backup. If you backup your mailserver, you have a pretty reasonable possibility that users have passwords in their mailbox. Passwords still need to be rotated.

EDIT: okay, fine, fine, but when your shit ends up in password dumps on darknet that get found years later, and your password is still valid, that shit is on you.

-8
MakeWay4Doodles•
3†
menge101•

Once that account is created, I sign in with "root" credentials with that email, clicking Forgot Password because now AWS account exists with that email address yet.

You don't need, and imo don't want to do this.

You want, imo, users account, where users exist with no permissions other than permission to assume roles on your dev, staging, and production accounts. And there is no way to access those accounts except by assuming roles from the users account.

This allows you to have a single identity in the hierarchy of accounts, but be able to act in any of them, assuming permissions were given.

11
TommyF-17•

Once that account is created, I sign in with "root" credentials with that email, clicking Forgot Password because now AWS account exists with that email address yet.

You don't need, and imo don't want to do this.

You do need this really. If you do not set the root pwd and set up MFA, then anyone who can get access to the e-mail address will be able to log in as root and take over the account.

We just went through setting up an AVM with AWS and this is a part of the required process for any new account that is created.

On top of this, you still need the individual IAM user accounts, or federated access, for rgular access to the account.

12
menge101•

Hm, noted. ty.

3
TommyF-17•

I was in denial for the longest time over this. I hate this manual step. But it's clear - you are depending on the security of your e-mail system in this scenario, unless you activate the MFA.

If that's acceptable, then fine I guess... :)

3
Savagemikedrop•

You don’t need this, really. Better practice, as part of an org, does not require this at all. And then with the org, Service control polices and AWS config, amongst other things, you negate any need for the root account for 99% of actions, can forcibly restrict even the root account on sub-account of an org, and can be alerted immediately of said actions.

Setting up a new account does not require root access if it is an org. At most, temporarily, you can create a user to deploy cross account roles for your orgs iam account to assume into using the default organizational role. Once done, delete the role.

2
TommyF-17•

I would love to be able to challenge this requirement, but this is the method currently being given to us by AWS Professional Services.

So tell me, how do you set up MFA on the vended accounts that are part of the org?

And if you say don't set up MFA, then tell me how you close the security loophole of people with access to the email address being able to reset the root pwd.

I'd love to be armed with information to counter this as I hate all this extra work and the glut of physical MFA tokens that is going to accumulate.

1
Savagemikedrop•

You don’t.

You have to choose your threat model you’re trying to protect against. For many, using Service Control Policies and AWS Config you can very strictly control all access levels of sub accounts including the root user, be alerted off them, and auto-remediate within reason.

Since the root account of a sub account is so very rarely needed in a sub-account, any alert that someone attempted a password reset is red flag worth investigating immediately. But, taking into account SCP, you can severely limit access how you want already.

1
vtrac•

You have this more or less right. AWS account management sucks because identity in AWS is backwards. They've tied identity to authorization, whereas Google has properly separated out authentication and authorization. In GCP, your single account is authorized access to different projects and resources. In AWS, even if you set up IAM delegation, you are in fact, "assuming" another identity that belongs to an account.

The implication is that multiple account management with AWS is cumbersome and complex.

7
TheRealKajed•

Same thing coming from Azure, where there's not an 'identity' that is intrinsic to a subscription, i guess the AWS model is just piggybacking off the amazon retail model and they never got around to fixing it

Try to keep your IAM users only in the master payer account, use Assume Role to access and set up the child accounts in the org, only use the root logins for those accounts if you get locked out

1
lorarc•
  1. You need to set up consolidate billing https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/consolidated-billing.html

  2. You can switch to a role in a different account.

4
TommyF-17•

From what I've gathered, I add an Account to an Organization, specifying an email, name, and IAM role.

Once that account is created, I sign in with "root" credentials with that email, clicking Forgot Password because now AWS account exists with that email address yet.

Not strictly speaking correct. When you created the account from the organisation, it does exist, and it is associated to that e-mail address. However, the password is random (and long). As you need to log in as root to set the MFA, you need to reset the password in order to do so.

If you do not do this step, you are then relying on the security of your e-mail implementation to secure your account. If you do not have MFA, then anyone who can somehow access your e-mail can reset the password and log in to your root account.

​

I get the lost password email, set the email, and complete the sign up process by:

Provide contact information

Agree to the terms of the AWS Customer Agreement

Provide a payment method, such as a credit card

Complete phone verification

Choose a support option

You do not need to do any of this if the account was created using the Organisations create account functionality. Unless it has changed recently.

You missed the most important step here, and that is setting up the MFA as mentioned above :)

Does it seem right that:

I'm creating accounts with aforementioned process?

Seems close

I'm setting billing details for each Account, when I'm attempting to make the account that owns the Organization the Payer?

Seems wrong, as mentioned above

I have to login to a separate account to administer anything related to that account, despite each Account belonging to the same Organization?

Yep, that's how account separation works in AWS. As others have mentioned, you can assume roles across accounts, but there are some activities that require you to be logged in as the root user for that account.

4
dudetheman87•

This might be useful to better grasp accounts and OUs: https://aws.amazon.com/solutions/aws-landing-zone/

3
foxylion•

I would also highly recommend this.

We are using Organizations with consolidated billing and SSO to sign into these accounts. When configured it is really simple to provision a new account, it will only take a minute or two.

With SSO you'll manage the accounts at a central place much like Google Cloud IAM.

3
brennanfee•

Take a look at "Control Tower". It is intended to make managing multiple accounts and an organization (as well as security guardrails) much easier.

3
Ribice•

I moved from GCP (2.5 years of working with it) to AWS about 2 months ago.

In short, what I learned, GCP is a ready-made platform to use, while AWS is a platform for making platforms.

What you're asking was the first question I asked others when I started with AWS. There is no 'environment' (project) like there is in GCP, so sometimes we just name resources differently to differentiate between environments (like DynamoDB).

At the end, we're just assuming roles for other environments and it works fine, but personally I prefer GCP's approach to IAM/Organization management.

3
powerbronx•

As someone who worked on the 'Control Tower' team. It's made exactly for this purpose. It will setup everything you need in 1 hour total. Almost everything you're asking for.

See: https://aws.amazon.com/controltower/features/

2
TechnicalExample•

Somewhat related, I wish there was a GCP to AWS translation guide.

1
nestafaria•

Curious - what’s the issue with GCP?

1
TechnicalExample•

No issues, just some basics concepts would help if you're a pro in AWS but need to work in GCP sometimes.

2
MikenIkey•

There's this documentation for the AWS -> GCP translation: https://cloud.google.com/docs/compare/aws/

1
TechnicalExample•

Aww, awesome. Thanks for this!

1
jomofo•

I have to login to a separate account to administer anything related to that account, despite each Account belonging to the same Organization?

You don't need to log in to root or other IAM user in the OU account to manage its resources. That's the purpose of the IAM Role you created/attached when you created the OU account.

You need to give an IAM user in the top account the 'sts:AssumeRole' permission for the IAM role you attached to the OU account.

Then in AWS console, you use the 'Switch Role' menu item to 'become' an admin for that account. If you're doing IaC, then your AWS token user or whatever would need that permission.

The only time I ever log in as root on the OU account is during the initial setup to harden that account, enable MFA, etc or fix anything I may not have set correctly when I created it.

1
FritzSchnitz•

AWS beyond complicated

0