2.13 Ensure IAM users receive permissions only through groups

Information

IAM users are granted access to services, functions, and data through IAM policies. There are four ways to assign policies to a user:

- Attach an inline (user) policy directly to the user
- Attach a managed policy directly to the user
- Add the user to an IAM group with attached policies
- Add the user to an IAM group with inline policies

Only assigning permissions through IAM groups is recommended.

Assigning IAM policies through groups centralizes permissions management and aligns access with organizational roles. This reduces complexity and lowers the likelihood of excessive or inconsistent permissions.

Solution

From Console:

Create and configure a group:

- Sign in to the AWS Management Console and open the IAM console( https://console.aws.amazon.com/iam/ )
- In the navigation pane, click User Groups and then click Create Group
- Enter a group name and click Next
- Select the appropriate policies
- Click Create Group

Add users to the group:

- Navigate to User Groups
- Select the group
- Click Add users to group
- Select users and click Add users

Remove direct user policies:

- Navigate to Users
- Select the user
- Go to the Permissions tab
- Remove any directly attached policies

From Command Line:

- Create a group:

aws iam create-group --group-name <group-name>
- Attach a policy to the group:

aws iam attach-group-policy --group-name <group-name> --policy-arn <policy-arn>
- Add user to group:

aws iam add-user-to-group --user-name <user-name> --group-name <group-name>
- Detach managed policies from user:

aws iam detach-user-policy --user-name <user-name> --policy-arn <policy-arn>
- Delete inline policies from user:

aws iam delete-user-policy --user-name <user-name> --policy-name <policy-name>

Impact:

Directly assigning policies to users increases the risk of misconfigured or excessive permissions and makes access management more difficult to audit and maintain.

See Also

https://workbench.cisecurity.org/benchmarks/24575

Item Details

Category: ACCESS CONTROL, AUDIT AND ACCOUNTABILITY

References: 800-53|AC-2, 800-53|AC-3, 800-53|AC-6, 800-53|AC-6(1), 800-53|AC-6(7), 800-53|AU-9(4), CCE|CCE-78912-3, CSCv7|16.1

Plugin: amazon_aws

Control ID: c81f9062f90bdefa26bf71276257380afa8820195e46bcb32fa2fafc2bf3cb39