---
title: IAM policies should be attached and managed at the group level
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: >-
  Docs > Datadog Security > OOTB Rules > IAM policies should be attached and
  managed at the group level
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# IAM policies should be attached and managed at the group level
 
## Description{% #description %}

IAM users should receive permissions only through IAM groups (or roles), not through managed policies attached directly to the user. Managing permissions at the group level simplifies access management, reduces the risk of excessive or inconsistent privileges, and makes it easier to audit and revoke access as users change roles.

This rule evaluates each IAM user and fails if one or more managed policies are attached directly to the user (the `attached_policies` list is non-empty) or the user has an inline policy. Users with no directly attached managed policies and no inline policies pass.

## Remediation{% #remediation %}

1. Create an IAM group (or use an existing one) that grants the permissions the user requires, as described in [IAM user groups](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html).
1. Add the user to the group.
1. Detach each managed policy and delete each inline policy on the user, as described in [Adding and removing IAM identity permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html).

## References{% #references %}

- [IAM user groups](https://docs.aws.amazon.com/IAM/latest/UserGuide/id_groups.html)
- [Adding and removing IAM identity permissions](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_manage-attach-detach.html)
- [CIS Amazon Web Services Benchmarks](https://www.cisecurity.org/benchmark/amazon_web_services)
