# Ensure All IAM Users Belong to IAM Groups

- Source: https://support.icompaas.com/support/solutions/articles/62000218784-ensure-all-iam-users-belong-to-iam-groups
- Section: [Solutions](https://support.icompaas.com/support/solutions) › [Security Controls](https://support.icompaas.com/support/solutions/62000065178) › [AWS Services](https://support.icompaas.com/support/solutions/folders/62000097507)
- Last updated: 2026-05-29
- Publisher: iCompaas, Inc. (https://www.icompaas.com)

## **Description:**

You know a **user group** is a collection of users. You can use user groups to specify permissions for a collection of users, which can make those permissions easier to manage for those users.

An IAM role is very similar to a user, in that it is an identity with permission policies that determine what the identity can and cannot do in AWS. However, a role does not have any credentials associated with it.

IAM policies mean to give privileges to users, groups, or roles. It is recommended that IAM policies be applied directly to groups and roles but not to users. Policies let you specify who has access to AWS resources, and what actions they can perform on those resources. In other words, we can say you can use policies to control what the person making the principal is allowed to do.

  

## **Rationale:**

When we give the privilege at the group level we try to reduce the complexity of access management as the number of users grows. Here You can create groups, attach the necessary policies for each group, then add IAM users to these groups as needed. For improved efficiency and security, use managed policies whenever possible, attaching them to groups but not to users.

  

### Impact:

Adding individual users to groups makes it easier to manage the users and their permissions. Instead of attaching policies to each user, you can just attach that policy to the group.

  

### Default value:

By default, users will not be added to any group.

  

#### Pre-requisites:

-   Sign in as an admin or IAM user with the required permissions
    
-   Need at least one IAM Group 
    

  

### Remediation:

  

### Test plan:

-   Sign in to the AWS management console 
    
-   Go to the IAM service at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/ "https://console.aws.amazon.com/iam/")
    
-   Click on the **users** in the left navigation pane![](https://support.icompaas.com/assets/kb/c81c355ebd1ca679.png)
    
-   Click on the user name you want to examine and select the Groups tab![](https://support.icompaas.com/assets/kb/2ab609af76215c9a.png)
    
-   If any group shows up it means a particular user is in that group, if not follow the implementation steps to add a user to the group.![](https://support.icompaas.com/assets/kb/df3e1f0873d09692.png)
    

  

**Using AWS CLI:**

 **List the names of Amazon IAM users available within your current AWS account:** 

aws iam list-groups-for-user --user-name <value>

  

#### Implementation steps:

-   Sign in to the AWS management console 
    
-   Go to the IAM service at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/ "https://console.aws.amazon.com/iam/")
    
-   Click on the **users** in the left navigation pane  
    ![](https://support.icompaas.com/assets/kb/4dca0f2ab00066e0.png)
    
-   Click on the user name you want to add to the group and select the Groups tab.![](https://support.icompaas.com/assets/kb/d18a1de20a3105fc.png)  
    
-   Click on **Add user to Groups** button.![](https://support.icompaas.com/assets/kb/6700af498821c5ab.png)  
    
-   Select the group you want to add the user(can select multiple groups at a time) to and click on Add to Groups button at the bottom![](https://support.icompaas.com/assets/kb/67374c1fdebf62f2.png)
    
-   Click on  **"Add user to groups".![](https://support.icompaas.com/assets/kb/efceb5aa83386337.png)**

-   Now the IAM user to the selected group will inherit the permissions assigned to the selected IAM group
    

**OR**

-   Click on the User Groups in the left navigation pane.
    

  

![](https://support.icompaas.com/assets/kb/21a3f2108b8447d0.png)

-   Click  on the group name.
    
-   ![](https://support.icompaas.com/assets/kb/96cd08a10953a160.png)
    
-   Click on the Add Users.![](https://support.icompaas.com/assets/kb/86e9db65f4aed0cc.png)
-   Click on the User name.![](https://support.icompaas.com/assets/kb/79886f1a283c0faf.png)
-   Click on **Add User.![](https://support.icompaas.com/assets/kb/0d44cf1af4310306.png)**
    

#### Using AWS CLI:

aws iam add-user-to-group --user-name Bob --group-name Admins

  

#### Backout plan:

-   Sign in to the AWS management console 
    
-   Go to the IAM service at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/ "https://console.aws.amazon.com/iam/")
    
-   Click on the **user groups** in the left navigation pane
    
-   Click on the group name, go to the user's tab and select the user and click on Remove user  
    ![](https://support.icompaas.com/assets/kb/4e24ad5ad39023ef.png)
    

  

  

#### Using AWS CLI:

aws iam remove-user-from-group --user-name Bob --group-name Admins

  

### Reference:

[https://aws.amazon.com/iam/](https://aws.amazon.com/iam/ "https://aws.amazon.com/iam/")

## Related compliance guidance

- [SOC 2 compliance: a practical implementation guide for cloud-native SaaS teams](https://support.icompaas.com/compliance/soc-2-trust-services-criteria): Configuration checks like this one are the technical half of a SOC 2 / ISO 27001 programme — the guide shows where they fit, what else an auditor expects, and how to evidence them.
- [ISO/IEC 27001:2022 compliance: a practical implementation guide](https://support.icompaas.com/compliance/iso-27001-2022): ISO 27001 Annex A.8 (technological controls) is where cloud hardening evidence lands; the guide shows how to run the ISMS around it.
