Sub topic 9
Setting up an admin identity for daily work
This chapter assumes you have already signed up, enabled MFA on the root user, and have no root access keys. You should be comfortable with the AWS console and a terminal.
Why not use root every day
The root user cannot be limited by IAM policies, and it holds every permission in the account. If its password is phished or a session is hijacked, the attacker owns the account. A separate administrative identity gives you most of the same power for daily work. You can restrict it, audit it, and revoke it. Keep root for the small set of tasks that only root can do.
Choose an identity type
You have two main options.
| Option | Credentials | Best for |
|---|---|---|
| IAM Identity Center user | Short-lived, issued at sign-in | Recommended for people, including a single-person account |
| IAM user | Long-lived password and optional access keys | Legacy setups, or when Identity Center is not available |
IAM Identity Center gives you a sign-in portal and temporary credentials for the console and the CLI. This means there are no long-lived access keys to leak. The steps below use Identity Center. If you choose an IAM user, enable MFA on it too, and avoid creating access keys unless a tool requires them.
Create the admin user
Sign in as root one last time for this setup.
- Open the IAM Identity Center console and choose Enable. Pick your main Region carefully. Identity Center is tied to one Region, and changing it later is difficult.
- Create a user. Use your own name and a working email address that is different from the root email.
- Create a permission set. Choose the predefined AdministratorAccess set, or a narrower one such as PowerUserAccess if you do not need IAM changes.
- Assign the user and the permission set to your AWS account.
- Open the invitation email, set a password, and register an MFA device for this user.
Sign in and check who you are
Use the portal URL from the invitation. Then configure the CLI to use it:
aws configure ssoThe command asks for the portal URL, the Region, and the account and role to use. It then saves a named profile. Log in and confirm the identity:
aws sso login --profile my-admin
aws sts get-caller-identity --profile my-adminThe Arn in the output should contain assumed-role and the name of your permission set. It should not end in :root. If it does, you are using root credentials and should stop and fix that first.
Common errors
- Using the root email for the admin user. If one mailbox is compromised, both identities fall together. Keep the two separate.
- Granting AdministratorAccess to everything. Administrator is a starting point. Chapter work on least privilege comes next, and you can swap in narrower permission sets later.
- Wrong Region for Identity Center. The portal and its users live in the Region you enabled. Note it down.
- Expired sessions. Identity Center credentials expire. When the CLI reports an expired token, run
aws sso loginagain. You do not need to create new keys. - Skipping MFA on the admin user. An admin without MFA is nearly as risky as root without MFA.
After setup
Sign out of root. From now on, use the admin identity. Record where the root credentials and MFA devices are stored, so you can find them when a root-only task comes up.
Exercise
You run aws sts get-caller-identity and the Arn ends with :root. What does this tell you, and what should you do?
Show answer
The CLI is using root credentials, which is the situation this chapter is meant to prevent. Remove any root access keys, then configure a profile with aws configure sso for the admin identity and confirm that the Arn now shows an assumed role.