Skip to main content

More Info:

Identifies principals whose effective permissions amount to full administrative control, whether from an attached administrator policy or from a combination of broader grants. Each one is a single credential that can change or delete anything in the account, including the audit trail that would record it. Keep the count small, use short-lived elevation for work that genuinely needs it, and require MFA on every account that keeps it.

Risk Level

High

Address

Security

Compliance Standards

  • AWS Well Architected Framework
  • CIS AWS
  • HIPAA
  • HITRUST CSF
  • ISO 27001
  • NIST CSF
  • Reserve Bank of India (RBI) Cyber Security Framework
  • Reserve Bank of India (RBI) Master Direction – Information Technology Framework
  • SOC2

Triage and Remediation

Remediation

Using Console

To remediate the misconfiguration of having users with Administrator Access in AWS IAM, follow these steps using the AWS Management Console:
  1. Sign in to the AWS Management Console using your root account credentials.
  2. Open the IAM console by searching for “IAM” in the AWS services search bar and selecting “IAM - Identity and Access Management.”
  3. In the left navigation pane, click on “Users.”
  4. Review the list of users and identify the ones with Administrator Access. These users will have the policy “AdministratorAccess” attached to them.
  5. Select the user with Administrator Access that you want to remediate by clicking on their username.
  6. In the “Permissions” tab, click on the “Detach Policy” button next to the “AdministratorAccess” policy.
  7. A confirmation dialog box will appear. Click on the “Detach” button to remove the policy from the user.
  8. Repeat steps 5-7 for each user with Administrator Access until all users no longer have the “AdministratorAccess” policy attached.
  9. To prevent future misconfigurations, it is recommended to follow the principle of least privilege and assign appropriate permissions to users based on their roles and responsibilities.
  10. To do this, create custom IAM policies with specific permissions that align with each user’s requirements and attach these policies to the respective users.
  11. To create a custom IAM policy, go back to the IAM console and click on “Policies” in the left navigation pane.
  12. Click on the “Create policy” button.
  13. Choose either the “JSON” or “Visual editor” tab to define your policy. The “Visual editor” provides a guided interface to create the policy, while the “JSON” tab allows you to write the policy in JSON format.
  14. Define the permissions for the policy based on the user’s requirements. It is recommended to follow the principle of least privilege and only grant the necessary permissions.
  15. Once the policy is defined, click on the “Review policy” button.
  16. Provide a name and description for the policy, and then click on the “Create policy” button.
  17. After creating the policy, go back to the “Users” section and select the user you want to assign the policy to.
  18. In the “Permissions” tab of the user, click on the “Attach policies” button.
  19. In the search bar, type the name of the policy you created and select it from the list.
  20. Click on the “Attach policy” button to assign the policy to the user.
  21. Repeat steps 17-20 for each user, assigning the appropriate custom policies based on their roles and responsibilities.
By following these steps, you can remediate the misconfiguration of having users with Administrator Access in AWS IAM and implement the principle of least privilege by assigning custom policies based on specific user requirements.

To remediate the misconfiguration of users having Administrator Access in AWS IAM using AWS CLI, follow these steps:
  1. Identify the user(s) with Administrator Access:
    • Run the following command to list all IAM users:
    • Review the output and identify the user(s) with Administrator Access.
  2. Revoke Administrator Access from the user(s):
    • Run the following command to remove the AdministratorAccess policy from the user:
      Replace <user-name> with the actual username of the user you want to remove Administrator Access from.
  3. Optional: Assign appropriate permissions to the user(s):
    • If the user(s) still require access to specific resources or services, you can assign them appropriate permissions by attaching specific policies. For example, if a user needs access to EC2 instances, you can attach the AmazonEC2FullAccess policy. Run the following command to attach a policy to the user:
      Replace <user-name> with the actual username of the user, and <policy-arn> with the ARN of the policy you want to attach.
  4. Verify the changes:
    • To confirm that the Administrator Access has been revoked, run the following command:
      Replace <user-name> with the actual username of the user. The command should not display the AdministratorAccess policy.
    • Additionally, you can also verify the user’s permissions by attempting to perform actions that were previously restricted.
By following these steps, you will successfully remediate the misconfiguration of users having Administrator Access in AWS IAM using AWS CLI.
To remediate the misconfiguration of having users with Administrator Access in AWS IAM using Python, you can follow the steps below:Step 1: Identify the users with Administrator Access: You can use the AWS SDK for Python (Boto3) to list all the IAM users and check their assigned policies. Filter out the users who have the “AdministratorAccess” policy attached.
Step 2: Remove Administrator Access from the users: For each identified user with Administrator Access, you can detach the “AdministratorAccess” policy from their IAM user using the detach_user_policy method.
Step 3: Verify the changes: After removing the “AdministratorAccess” policy from the users, you can recheck the user policies to ensure that they no longer have Administrator Access.
By following these steps, you can remediate the misconfiguration of having users with Administrator Access in AWS IAM using Python.
This change does not force replacement of the aws_iam_user resource, but it does remove its full administrator capability once the AdministratorAccess attachment is deleted from Terraform and applied.Verification with terraform plan should show the aws_iam_user_policy_attachment that used arn:aws:iam::aws:policy/AdministratorAccess being destroyed (-), and the new least-privilege and MFA policies and their attachments being created (+).