Multi-Factor Authentication (MFA) helps to protect your AWS resources. You can enable MFA for IAM users or the AWS account root user. When you enable MFA for the root user, it affects only the root user credentials and does not affect the IAM user, IAM users contain their own credentials means each identity has its own MFA configuration. This Multi-Factor Authentication works as an extra layer of protection on top of a user name and password and we know that the root account is the most privileged user in an AWS account. This extra layer protection enabled, when a user signs in to an AWS website, they will be prompted for their user name and password as well as for an authentication code from their AWS MFA device.
Note: When virtual MFA is used for root accounts, it is recommended that the device used is NOT a personal device, but rather a dedicated mobile device(tablet or phone) that is managed to be kept charged and secured independently of any individual personal devices. (“non-personal virtual MFA”) This lessens the risks of losing access to the MFA due to device loss, device trade-in, or if the individual owning the device is no longer employed at the company.
MFA increased security, It helps to protect AWS resources, it requires the authenticating principal to possess a device that emits a time-sensitive key and has knowledge of a credential.
MFA adds an extra security layer because it requires users to provide unique authentication from an AWS-supported MFA mechanism in addition to their regu sign-in credentials when they access AWS websites or services. If Hacker finds out the password, it needs to pass through one extra layer: MFA needs a device for authentication.
By Default, MFA is not activated for any users if you want to activate MFA for the root user you need to login into the root user account.
Perform the following to determine if the root account has an MFA setup:
Using AWS CLI:
- Run the following command
aws iam get-account-summary | grep “AccountMFAEnabled”
- Ensure the AccountMFAEnabled property is set to 1
Perform the following to establish MFA for the root account:
- Sign in to the AWS Management Console and open the IAM console at https://console.aws.amazon.com/iam/
Note: to manage MFA devices for the root AWS account, you must use your root account credentials to sign in to AWS. You cannot manage MFA devices for the root account using other credentials.
- In the Identity and Access Management under security alerts click on “Enable MFA”
- Under “Your Security Credentials “ click on Activate MFA in Multi-Factor Authentication
- In the wizard “Manage MFA device” we have three options Virtual(software-based) MFA device, U2F security key (USB device-based), the last one is another hardware MFA device. From there you can choose any of the options. (Note: Here we are going with the Virtual MFA device for implementation).
Select Virtual MFA device
We see steps to set up a virtual MFA device as below
1. Install a compatible app on your mobile device or computer
2. Use your virtual MFA app and your device’s camera to scan the QR code.
Using the compatible application through a mobile device we scan the QR code or we can type the secret key
3. Open your virtual MFA application here We use Microsoft Authenticator you can use anyone from the list which hosting virtual MFA devices, If the virtual MFA application supports multiple accounts( multiple virtual MFA devices), choose to create a new account (a new virtual MFA device). 4. Determine whether the MFA app supports QR codes, and then do one of the following:
- Use the app to scan the QR code.
- In the Manage MFA Device wizard, choose the secret key for manual configuration and then type the secret configuration key into your MFA application.
5. When you finished the virtual MFA device starts generating one-time passwords.
6. In the Manage MFA Device wizard, in the Authentication Code 1 box, type the one-time password that currently appears in the virtual MFA device and then wait up to 30 seconds for the device to generate a new one-time password. Then type the second one-time password into the Authentication Code 2 box. then click on Assing MFA
- If you do not want MFA for your AWS account root user then follow implementation steps upto 3 steps and
- In MFA click on Manage
- Choose the action as Remove and click on remove tab