# Ensure IAM Users Receive Permissions Only Through Groups

- Source: https://support.icompaas.com/support/solutions/articles/62000228294-ensure-iam-users-receive-permissions-only-through-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:**

AWS Identity and Access Management (IAM) is a web service that helps you securely control access to AWS resources. You use IAM to control who is authenticated (signed in) and authorized (has permissions) to use resources.

## **Rationale:**

Assigning IAM policy only through groups unifies permissions management to a single, flexible layer consistent with organizational functional roles. By unifying permissions management, the likelihood of excessive permissions is reduced.

## **Impact:**

 IAM policy only through groups unifies permissions management.

## **Default Value:** 

N/A

## **Pre-Requisite:**

Have IAM user and group

## **Remediation:**

### **Test Plan:**

-   **AWS Console Process**
    

1.  Sign in to the AWS Management Console and open the IAM console at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/ "https://console.aws.amazon.com/iam/"). 
    
2.  In the left navigation pane select users. ![](https://support.icompaas.com/assets/kb/d27b34c5834a357d.png) 
    
3.  In the users list you can see that users are assigned to any groups.  ![](https://support.icompaas.com/assets/kb/28409c2b51d2966d.png)  

**Using AWS CLI**

Perform the following to determine if an inline policy is set or a policy is directly attached to users: 

-   Run the following to get a list of IAM users:
    
    aws iam list-users --query 'Users\[\*\].UserName' --output text
    
-   For each user returned, run the following command to determine if any policies are attached to them: 
    
    aws iam list-attached-user-policies --user-name <iam\_user>
        aws iam list-user-policies --user-name <iam\_user>
    
-   If any policies are returned, the user has an inline policy or direct policy attachment.  
      
    **Implementation Plan**
    
    1.  Sign in to the AWS Management Console and open the IAM console at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/ "https://console.aws.amazon.com/iam/"). 
        
    2.  In the navigation pane, click user groups and then click create group.![](https://support.icompaas.com/assets/kb/b1121e7afc72bdd7.png)
        
    3.  In the Group Name box, type the name of the group.
    4.  Scroll down to add users to the group section and select the required user to add. 
    5.  ![](https://support.icompaas.com/assets/kb/b941c04e3eb798ab.png)Attach the required permissions policies to the group.  ![](https://support.icompaas.com/assets/kb/dd1be37e49628b4f.png)  
        
    6.  Click on create group.  
          
          
        **Perform the following to remove a direct association between a user and policy:**
        1.  Sign in to the AWS Management Console and open the IAM console at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/ "https://console.aws.amazon.com/iam/"). 
            
        2.  In the left navigation pane, click on Users.
            
        3.  For each user: 
            
        4.  Select the user, click on the Permissions tab, Expand Permissions policies.
            
        5.  Click X for each policy which are not attached from group.![](https://support.icompaas.com/assets/kb/3f307d9e2c60448c.png)
            
        6.   click Detach or Remove (depending on policy type).![](https://support.icompaas.com/assets/kb/4f059eb68a317322.png)
            
    
      
    
    **Using AWS CLI**
    
      
    
    **The following `add-user-to-group` command adds an IAM user named `Bob` to the IAM group named `Admins`:** 
    
    aws iam add-user-to-group --user-name Bob --group-name Admins
    
    This example removes the managed policy with the ARN `arn:aws:iam::123456789012:policy/TesterPolicy` from the user `Bob`: 
    
    aws iam detach-user-policy --user-name Bob --policy-arn arn:aws:iam::123456789012:policy/TesterPolicy
    
    ### **Backout Plan:**
    
    -   **AWS Console Process**
        
    
    1.  Sign in to the AWS Management Console and open the IAM console at [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/ "https://console.aws.amazon.com/iam/"). 
        
    2.  In the navigation pane, click user groups. ![](https://support.icompaas.com/assets/kb/020fc87660bb3543.png) 
        
    3.  Select the desired group and click on delete.  ![](https://support.icompaas.com/assets/kb/1ac386c7f274fa3b.png)  
        
    4.  Type the group name to confirm deletion and click on delete.![](https://support.icompaas.com/assets/kb/bec25ebe762276cb.png) 
    
    **Using AWS CLI**
    
-   The following `delete-group` command deletes an IAM group named `MyTestGroup`:
    

  

aws iam delete-group --group-name MyTestGroup

## **Reference:**

[iam — AWS CLI 1.27.30 Command Reference (amazon.com)](https://docs.aws.amazon.com/cli/latest/reference/iam/index.html "https://docs.aws.amazon.com/cli/latest/reference/iam/index.html")

[Managed policies and inline policies - AWS Identity and Access Management (amazon.com)](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html "https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_managed-vs-inline.html")

## 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.
