How to secure the AWS root user account
This guide walks you through locking down the AWS account root user: registering MFA, removing root access keys, moving daily work to a separate administrative identity and alerting on any root sign-in. It is for cloud and security admins who own one AWS account or an AWS Organizations setup.
Before you start
Before you start
The root user is the identity created with the account. It has complete access to every resource, including billing, so AWS recommends using it only for the few tasks that need it.
- Access: you need the root user's email address and password, plus access to the mailbox (and phone number) tied to the account. Steps 1 and 2 must be done while signed in as root.
- A second identity: an administrative user or role for everyday work, ideally an IAM Identity Center user if you run several accounts.
- Tools: a browser, an authenticator app or a hardware security key, and the AWS CLI for the read-only check at the end.
- Organizations: if the account is a member account, check whether your organization already manages root access centrally before you set anything up by hand.
Step by step
Step by step
All steps below change the account. Do them in a quiet period and keep a second admin identity signed in while you work, so a mistake does not lock you out.
- Change: set a strong, unique root password. Sign in to the AWS Management Console as Root user, open your account name at the top right and choose Security credentials. Store the new password in a password manager that does not depend on this AWS account.
- Change: register MFA for the root user. On the same Security credentials page, under Multi-factor authentication (MFA), choose Assign MFA device. Pick a passkey or security key, a hardware TOTP token or an authenticator app. AWS allows several devices per root user, so register a second one and keep it in a different place.
- Change: delete any root access keys. Still on Security credentials, look at Access keys. If a key is listed, first find out what uses it, then move that workload to an IAM role, then choose Actions > Deactivate, wait and watch for errors, and only then Delete. Do not create new root keys.
- Change: create an administrative identity for daily work. For one account, create an IAM role or user with the permissions your admins need. For several accounts, use IAM Identity Center and assign an administrator permission set. Sign in with that identity from now on and sign out of root.
- Change: make the recovery path safe. Set the root email to a group mailbox your team manages, keep the account's phone number current, and make sure no single person controls both the mailbox and the MFA devices.
- Change: alert on root use. Create an Amazon EventBridge rule that matches root sign-in events from CloudTrail and sends them to an Amazon SNS topic that reaches your security contacts. Test it with a planned root sign-in and write down who checks the alert and how they confirm it was expected.
- Organizations only: remove root credentials from member accounts. If you use AWS Organizations, you can centralize root access from the management account (or a delegated administrator) and remove the root password, access keys, signing certificates and MFA from member accounts. Do this only after the management account's own root user is secured.
Check it worked
Check it worked
This command is read-only. Run it with a non-root identity (for example your administrative role) in the account you secured:
aws iam get-account-summary \
--query 'SummaryMap.{RootMfaEnabled: AccountMFAEnabled, RootAccessKeys: AccountAccessKeysPresent}'Expected result: RootMfaEnabled is 1 and RootAccessKeys is 0. These two fields describe the root user of the account you query.
- If
RootMfaEnabledis0, no MFA device is registered for root yet. - If
RootAccessKeysis above0, a root access key still exists. - In a member account whose root credentials were removed on purpose, the MFA value is expected to be
0.
Then confirm the alert works: after a planned root sign-in, the SNS subscribers should receive a message.
Common mistakes
Common mistakes
- Deleting a root access key before checking what uses it. Deactivate first, watch for failures, then delete.
- Keeping the only MFA device on one person's phone. Register more than one device and store them separately.
- Storing the root password in a tool that itself needs this AWS account to open. If you lose access, you also lose the password.
- Using a personal email address for root. When that person leaves, account recovery goes with them.
- Using root for daily admin because it is quicker. Every root sign-in should be rare enough to be worth an alert.
- Running the check as root and reading it for a different account. The values describe the account you are signed in to.
- Removing member-account root credentials, then treating the missing MFA as a failure. That state is intended.
How ConfigCobra helps
How ConfigCobra helps
ConfigCobra covers AWS with the CIS Amazon Web Services Foundations Benchmark v7.0.0 (70 controls), which includes checks for root MFA, hardware MFA, root access keys and root usage monitoring. It reads your accounts through a read-only assume-role and never changes anything in them, so the steps above stay with you.
- Run an ad hoc scan after you finish, or schedule daily, weekly or monthly scans so drift detection alerts you if a control regresses, with email notifications.
- Each failing control comes with copy-paste remediation steps, and remediation impact analysis shows the affected resources and identities before you apply a fix.
- The AWS resource inventory shows the resources and security properties across the accounts in scope.
Related checks
- Ensure no 'root' user account access key existsCIS 2.4
- Ensure MFA is enabled for the 'root' user accountCIS 2.5
- Ensure hardware MFA is enabled for the 'root' user accountCIS 2.6
- Eliminate use of the 'root' user for administrative and daily tasksCIS 2.7
- Ensure centralized root access in AWS OrganizationsCIS 2.1.1
Go further
- All guidesAdmin how-tos for Microsoft 365, Azure, Google Cloud and AWS
- Check libraryEvery CIS check, explained
- RemediationSee what a fix changes in your tenant before you apply it, then use the generated script
- Inventory & InsightsEvery user, app, device and resource in one inventory, with built-in risk views
See where your AWS stands
A read-only assessment against the CIS benchmarks, prioritised so you know what to fix first.