# (L2) Ensure privileged role assignments are activated and not assigned

Privileged directory roles are held through Privileged Identity Management (PIM) activation instead of permanent active assignment.

Source: https://maester.dev/docs/tests/CIS.M365.5.3.1

<!-- This file is generated by website/scripts/generate-test-docs.mjs. Do not edit manually. -->

<div class="test-byline"><div class="test-byline-avatars"><a class="test-byline-avatar test-byline-avatar--author" href="/contributors/jeremyfinney-lgtm" title="Jeremy Finney · Original author"><img src="https://github.com/JeremyFinney-lgtm.png" alt="Jeremy Finney" width="28" height="28" loading="lazy" decoding="async" /></a></div><div class="test-byline-meta"><span class="test-byline-text">Contributed by <a href="/contributors/jeremyfinney-lgtm">Jeremy Finney</a></span><a class="test-byline-link" href="/contributors">All contributors →</a></div></div>

<p class="test-part">Part of <a href="/docs/tests/cis">CIS</a> · Entra ID · Privileged Identity Management · <a href="/docs/tests">All checks</a></p>

```powershell title="Run this check"
Invoke-Maester -TestId CIS.M365.5.3.1
```

## Overview

Privileged directory roles are held through Privileged Identity Management (PIM) activation instead of permanent active assignment.

An account with a permanent privileged role is a permanent target: a stolen password or token gives immediate administrative access, at any hour, with no approval, justification or time limit. Making the role eligible means the account is an ordinary user until an admin activates the role for a few hours, with MFA and an audit trail. An attacker who adds a role to an account to keep access leaves a permanent assignment, and this test lists it.

The test lists every active assignment to a privileged role. Users and groups pass when the assignment type is **Activated**. Service principals pass when the assignment has an end date. Permanent Global Administrator assignments are accepted only for accounts listed in the EmergencyAccessAccounts setting of maester-config.json, up to two. When the setting is empty, every permanent assignment fails. See [Emergency access accounts](https://maester.dev/docs/configuration/emergency-access-accounts) for how to configure it. Microsoft Entra ID P2 or Microsoft Entra ID Governance licences are required.

#### Remediation action

1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com).
2. Go to **Entra ID** > **Roles & admins**, or open [Privileged Identity Management](https://entra.microsoft.com/#view/Microsoft_Azure_PIMCommon/ResourceMenuBlade/~/roles/resourceId//resourceType/tenant/provider/aadroles) and select **Microsoft Entra roles**.
3. Open **Assignments** > **Active assignments** and select each permanent assignment of a privileged role.
4. Select **Update** and change the assignment to **Eligible**, then save.
5. Ask the administrators to activate their role when they need it. Keep two cloud-only emergency access accounts as the only permanent Global Administrators, and list them in the EmergencyAccessAccounts setting of maester-config.json.

#### Related links

* [Microsoft Entra admin center - Privileged Identity Management](https://entra.microsoft.com/#view/Microsoft_Azure_PIMCommon/ResourceMenuBlade/~/roles/resourceId//resourceType/tenant/provider/aadroles)
* [Assign Microsoft Entra roles in Privileged Identity Management](https://learn.microsoft.com/entra/id-governance/privileged-identity-management/pim-how-to-add-role-to-user)
* [Best practices for Microsoft Entra roles](https://learn.microsoft.com/entra/identity/role-based-access-control/best-practices)
* [CIS Microsoft 365 Foundations Benchmark v7.0.0 - 5.3.1](https://www.cisecurity.org/benchmark/microsoft_365)

## Details

<details>
<summary>Every attribute of this check</summary>

| Field | Value |
| --- | --- |
| Test ID | CIS.M365.5.3.1 |
| Severity | High |
| Suite | CIS |
| Product | Entra ID |
| Feature | Privileged Identity Management |
| Area | Privileged access |
| Resource type | DirectoryRole |
| User impact | Low |
| Implementation cost | Medium |
| MITRE ATT&CK | T1078.004 Cloud Accounts, T1098.003 Additional Cloud Roles |
| Supports benchmark | CIS Microsoft 365 Foundations Benchmark (version 7.0.0), requirement 5.3.1 |
| Benchmark level | L2 |
| Benchmark profiles | E5 Level 2 |
| Supports controls | cis-m365:5.3.1, nist-800-53-r5:AC-6(5) |
| PowerShell test | [Test-MtCisPrivilegedRolesActivatedNotAssigned](https://github.com/maester365/maester/blob/main/tests/cis/Test.CIS.M365.5.3.1.ps1) |
| Services | Graph |
| Compatible licenses | AAD_PREMIUM_P2, Entra_Identity_Governance |

</details>

## Source

- Test: [`tests/cis/Test.CIS.M365.5.3.1.ps1`](https://github.com/maester365/maester/blob/main/tests/cis/Test.CIS.M365.5.3.1.ps1)
- Documentation: [`tests/cis/Test.CIS.M365.5.3.1.md`](https://github.com/maester365/maester/blob/main/tests/cis/Test.CIS.M365.5.3.1.md)
