How to Create `SuperAdmin` user
The SuperAdmin
user is necessary for performing administrative functions that IAM roles cannot, ensuring secure and controlled access to the root account while minimizing risks. These are the step-by-step instructions for creating a SuperAdmin
user in AWS, including setting permissions, enabling MFA, and securely storing credentials in 1Password.
REFARCH-73 - Provision SuperAdmin User for Root Level IAM Management
Prerequisites
Basic Instructions
Login to the AWS root
account using the root credentials.
In the IAM console, select "Users" on the sidebar.
- Click "Add users" button.
- Enter "SuperAdmin" for "User name". Leave "AWS Management Console access unchecked." Click "Next".
- Under "Set permissions", select "Attach existing policies directly". A list should appear, from which you should check "AdministratorAccess". Click "Next".
- Review and click "Create user".
- The "Success" page should show you the "Access key ID" and hidden Secret access key" which can be revealed by clicking "Show". Copy these to your secure credentials storage as you will need them shortly.
- Click "Close" to return to the IAM console. Select "Users" on the sidebar if it is not already selected. You should see a list of users. Click the user name "SuperAdmin" (which should be a hyperlink) to take you to the Users -> SuperAdmin "Summary" page.
- Click on the "Security credentials" tab. In the 'Multi-Factor Authentication (MFA)' section, click "Assign a virtual MFA device".
- Enter a name that corresponds to how you will store the MFA token (e.g. '1password')
- Select 'Authenticator App' as the MFA device type and click 'Next'.
- Follow the instructions to set up the MFA device. Store the TOTP key in your secure credentials storage.
- You should be taken back to the "Security Credentials" tab, but now the "Assigned MFA device" field should have an
ARN like
arn:aws:iam::<account-number>:mfa/SuperAdmin
. Copy the ARN and keep it with the Access Key. - Now we need to create an Access Key for CLI access. Click on the "Create Access Key" under "Access Keys".
- Select "Command Line Interface" and click the "I understand..." checkbox then click 'Next'.
- Enter a description if you like, such as 'SuperAdmin CLI Access' and click 'Create'.
Storing SuperAdmin credentials in 1Password
The SuperAdmin
credentials should be properly stored in 1Password. Relative to other potential 1Password item types,
the most appropriate 1Password item type for these credentials is login
. Since these are programmatic credentials and
not an actual login with an endpoint from which the website favicon can be retrieved, the icon for this item should be
manually set to the AWS logo. Additionally, the
password field should be kept empty. For convenience in retrieving the TOTP code when using Leapp, save com.leapp.app
as a website URL.
Set the username to SuperAdmin
, create fields for the AWS_ACCESS_KEY_ID
, AWS_SECRET_ACCESS_KEY
, and the TOTP
(known as One Time Password field type in 1password) via the AWS virtual MFA device's secret.
Finally, leave a note for this item in the following format:
This account's Access Key should be made inactive when not needed.
CURRENT STATUS: ACTIVE
Use this account for API/command line access to administrative functions that IAM roles cannot do, such as provision IAM roles.
This account should not be allowed to log in to the AWS console, and therefore does not have a password.
Root account ID: [AWS ACCOUNT ID]
User ARN arn:aws:iam::[AWS ACCOUNT ID]:user/SuperAdmin
MFA Device ARN arn:aws:iam::[AWS ACCOUNT ID]:mfa/SuperAdmin
The resulting entry in 1password should appear as follows:
Hit save once you are done. Once the SuperAdmin credentials need to be disabled, do not forget to update the notes in this item.
Detailed Instructions
These are just some more detailed step-by-step instructions. These are redundant with the basic instructions and might be out of date as the AWS web console interface changes.
-
Login to the AWS
root
account using the root credentials from 1Password -
Navigate to the IAM console page
-
In the IAM console, select
Users
on the sidebar -
ClickAdd users
button -
Enter "SuperAdmin" for
User name
and checkProgrammatic access
and leaveAWS Management Console access
unchecked. ClickNext: Permissions
at the bottom right corner of the page
- Under
Set permissions
, selectAttach existing policies directly
. A list should appear, from which you should checkAdministratorAccess
. ClickNext: Tags
at the bottom right corner of the page
-
Skip the tags, Click
Next: Review
at the bottom right corner of the page -
Review and click
Create user
at the bottom right corner of the page -
The Success page should show you the
Access key ID
and hiddenSecret access key
which can be revealed by clickingShow
, copy these to your secure credentials storage as you will need them shortly
-
Click
Close
at the bottom right corner to return to the IAM console and selectUsers
on the sidebar if it is not already selected -
You should a list of users. Click the user name
SuperAdmin
(which should be a hyperlink)
-
On the
Users -> SuperAdmin
"Summary" page, click on theSecurity credentials
tab -
In the
Sign-in credentials
section, find:Assigned MFA device: Not assigned | Manage
and clickManage
- Choose
Virtual MFA device
and clickContinue
- Press the
Show secret key
button
- Copy the key into 1Password as a AWS Credential using the “MFA” field
- Use the MFA codes from 1Password to complete the MFA setup process (you will input 2 consecutive codes)
- You should be taken back to the
Security Credentials
tab, but now theAssigned MFA device
field should have an ARN likearn:aws:iam::<account-number>:mfa/SuperAdmin
-
Copy the ARN and keep it with the Access Key in 1Password
-
Configure AWS profile with the SuperAdmin user credentials:
-
If it does not already exist on your host computer, create the file
$HOME/.aws/config
-
Add the following lines to the end of the
$HOME/.aws/config
file:
````ini`
[profile SuperAdmin]
region = us-west-2
default_region = us-west-2
mfa_serial = arn:aws:iam::<account-number>:mfa/SuperAdmin
replacing `us-west-2` with the primary region where you will be hosting your company's infrastructure,
and `arn:aws:iam::<account-number>:mfa/SuperAdmin` with the "Assigned MFA device" ARN from the previous step.
21.
:::tip
Done!
:::
### Related articles
:::note
The content by label feature displays related articles automatically, based on labels you choose. To edit options for this feature, select the placeholder below and tap the pencil icon.
:::
| Related issues | |
| -------------- | --- |