More Info:

This rule identifies IAM roles that do not require multi-factor authentication (MFA) or external ID for assumed roles. Roles without MFA or external ID can pose security risks, as they may allow unauthorized access or increase the attack surface for potential breaches. Enforcing MFA and external ID requirements adds an additional layer of security to IAM roles and helps prevent unauthorized access.

Risk Level

High

Address

Security

Compliance Standards

CBP

Triage and Remediation

Remediation

To remediate the misconfiguration in AWS IAM where the root account should have MFA and External ID set, follow these steps using the AWS Management Console:

  1. Enable Multi-Factor Authentication (MFA) for the Root Account:

    • Log in to the AWS Management Console using the root account credentials.
    • Navigate to the IAM service.
    • In the navigation pane, click on “Users”.
    • Click on the root account username.
    • In the “Security credentials” tab, locate the “Assigned MFA device” section and click on “Manage”.
    • Follow the prompts to set up MFA for the root account. You can choose to use a virtual MFA device or a hardware MFA device.
    • Once MFA is enabled, make sure to complete the MFA setup process.
  2. Set an External ID for the Root Account:

    • While still in the IAM Management Console, click on the root account username.
    • In the “Permissions” tab, click on the “Add inline policy” button.
    • Select the JSON tab to provide a custom policy.
    • Enter a policy document similar to the following, replacing YOUR_EXTERNAL_ID with your desired external ID:
    {
        "Version": "2012-10-17",
        "Statement": [
            {
                "Effect": "Allow",
                "Action": "*",
                "Resource": "*",
                "Condition": {
                    "StringEquals": {
                        "sts:ExternalId": "YOUR_EXTERNAL_ID"
                    }
                }
            }
        ]
    }
    
    • Click on Review policy, provide a name for the policy, and click on “Create policy”.
  3. Test the External ID:

    • To test the External ID, you can try to assume a role that requires the External ID. If the External ID is set correctly, the assumption of the role should succeed.

By following these steps, you will have successfully remediated the misconfiguration in AWS IAM where the root account should have MFA and an External ID set.