INF-20Required
Lock the root account away
Protect every cloud root or owner account with a hardware key or passkey, give it no access keys, and alert on every sign-in.
How to do it
The root account can do anything, including closing the account. Use it only for the few tasks that need it. Register at least two hardware keys and store them apart. Point its email address at a shared group mailbox, not one person. In AWS Organizations, turn on central root access and delete the root credentials of member accounts. Alert the team on any root sign-in. For emergencies, use tested break-glass accounts instead of root.
Examples
Shell example
# Expect: mfa=true key1=false key2=false
aws iam get-credential-report --query Content --output text | base64 -d \
| awk -F, '$1=="<root_account>" {print "mfa="$8, "key1="$9, "key2="$14}'
JSON example
{
"source": ["aws.signin"],
"detail-type": ["AWS Console Sign In via CloudTrail"],
"detail": { "userIdentity": { "type": ["Root"] } }
}
How to check
In the credential report, the root user of the management account has MFA on and no active access keys. Member accounts show no root password. A test root sign-in in a sandbox account triggers the alert within 15 minutes.
Sources
Related rules
- INF-21 Keep tested break-glass accounts in Infrastructure and environments
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/infrastructure/identity-and-access/lock-root-account">Agent Wranglers infrastructure and environments playbook</a>. In code you write, add a comment next to it with the same link.