Skip to content

LearnIdentity

Entra PIM and privileged role review

Brief

An admin role held all the time is an admin role an attacker gets with the account, while one activated through PIM costs them an MFA prompt, a reason and sometimes an approver. The review counts who holds each privileged role permanently and who is only eligible, reads the activation rules, finds who controls role-assignable groups and does the same for AWS IAM Identity Center.

Stage
Escalation
Reviewed
On this page
  1. Check first
  2. Who holds privileged Entra roles permanently, and who is only eligible?
  3. How are activations protected?
  4. Who controls the role-assignable groups?
  5. Which AWS permission sets grant standing admin?
  6. The defender sees
  7. Done when
  8. Not covered
  9. Tools
  10. Related research
  11. Where this page fits
  12. Reviewed

All commands

Cloud volume Chapter 7 of Cloud Penetration Testing, "Standing privilege and PIM", goes further than this page. The book is in production.

Situation
A read-only Entra ID role such as Global Reader, Microsoft Graph PowerShell with RoleManagement.Read.Directory, RoleManagementPolicy.Read.Directory and Group.Read.All, and a read-only role in the AWS Identity Center home region. Every command on this page is a read: we never activate a role, assign one or change a group, and we review only the tenant and AWS organization the scope letter names.
Goal
A privileged access table: each privileged role with its permanent and eligible holders by account type, its activation rules, the groups that carry it and their owners, and each AWS permission set with its policies, session length and assignments.
Outputs
The AWS section was captured on 8 Nov 2026 (UTC) in the Atarus lab AWS Organization from the Atarus Bench edition 2026.11-cloud-0.3, AWS CLI 2.39.3, through a read-only role in the lab's management account, which holds the Identity Center instance. The Entra sections stay representative on a placeholder tenant: they wait on an Entra ID P2 licence in the lab tenant, which the PIM schedule APIs need.

Check first

  • The client's list of privileged roles: at least Global Administrator, Privileged Role Administrator, Privileged Authentication Administrator, Security Administrator, Application Administrator and Exchange Administrator.
  • Their break glass accounts, which are expected to hold Global Administrator permanently and should be the only ones that do.
  • Whether the tenant has Entra ID P2 or Governance licences, since PIM needs them.
  • The AWS Identity Center home region and whether Identity Center is connected to Entra ID by SCIM.
  • Where the Entra audit log and AWS CloudTrail are kept, and for how long.

Steps

Who holds privileged Entra roles permanently, and who is only eligible?

Connect-MgGraph -Scopes 'RoleManagement.Read.Directory','RoleManagementPolicy.Read.Directory','Group.Read.All' -NoWelcome
$names = @{}; Get-MgRoleManagementDirectoryRoleDefinition -All | ForEach-Object { $names[$_.Id] = $_.DisplayName }
$priv = 'Global Administrator|Privileged Role Administrator|Privileged Authentication Administrator|Application Administrator'
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All -ExpandProperty Principal |
  Where-Object { $names[$_.RoleDefinitionId] -match $priv } |
  Select-Object @{n='Role';e={$names[$_.RoleDefinitionId]}}, AssignmentType,
    @{n='Ends';e={ if ($_.EndDateTime) { 'timed' } else { 'never' } }},
    @{n='Principal';e={$_.Principal.AdditionalProperties.displayName}}
Get-MgRoleManagementDirectoryRoleEligibilityScheduleInstance -All |
  Group-Object { $names[$_.RoleDefinitionId] } | Select-Object Count, Name

Expected output

Role                          AssignmentType Ends  Principal
----                          -------------- ----  ---------
Global Administrator          Assigned       never breakglass-01
Global Administrator          Assigned       never breakglass-02
Global Administrator          Assigned       never adm-ops-04   # <- a working admin account with standing Global Administrator
Application Administrator     Assigned       never grp-app-owners
Privileged Role Administrator Activated      timed adm-iam-02

Count Name
----- ----
    6 Global Administrator
    3 Privileged Role Administrator

Assigned with no end date is a standing role. Activated is a PIM activation, live for its window only. Eligible holders sit in the second list and hold nothing until they activate. We report holders by account type, break glass, admin account or group, and not by person.

Negative result. Only the break glass accounts hold Global Administrator permanently; every other privileged role is eligible, and no standing assignment goes to a group nobody reviews.

Fix. Convert standing assignments to eligible ones in PIM, keep two monitored break glass accounts, and run access reviews on eligible holders each quarter.

How are activations protected?

$a = Get-MgPolicyRoleManagementPolicyAssignment -Filter "scopeId eq '/' and scopeType eq 'DirectoryRole' and roleDefinitionId eq '62e90394-69f5-4237-9190-012177145e10'"
Get-MgPolicyRoleManagementPolicyRule -UnifiedRoleManagementPolicyId $a.PolicyId |
  Where-Object Id -in 'Expiration_EndUser_Assignment','Enablement_EndUser_Assignment','Approval_EndUser_Assignment' |
  ForEach-Object { $p = $_.AdditionalProperties
    [pscustomobject]@{ Rule = $_.Id; Max = $p.maximumDuration; Enabled = ($p.enabledRules -join ','); Approval = $p.setting.isApprovalRequired } }

Expected output

Rule                          Max  Enabled       Approval
----                          ---  -------       --------
Expiration_EndUser_Assignment PT8H
Enablement_EndUser_Assignment      Justification   # <- a reason is asked for, MFA is not
Approval_EndUser_Assignment                      False

The id is the Global Administrator role template. These three rules set how long an activation lasts, what the user must provide and whether someone approves it. An activation that asks only for a reason is a standing role with one extra click for anyone who already holds the session. We read the same rules for each privileged role, since each has its own policy.

Negative result. For Global Administrator and Privileged Role Administrator: MFA or an authentication context on activation, approval required, and a maximum of a few hours.

Fix. Require MFA, preferably through an authentication context that asks for a phishing-resistant method, require approval for the top roles, and shorten the maximum duration.

Who controls the role-assignable groups?

Get-MgGroup -Filter 'isAssignableToRole eq true' -All -Property Id,DisplayName |
  ForEach-Object { [pscustomobject]@{ Group = $_.DisplayName; Owners = @(Get-MgGroupOwner -GroupId $_.Id -All).Count } }

Expected output

Group            Owners
-----            ------
grp-app-owners        3   # <- three owners decide who becomes Application Administrator
grp-tier0-admins      0

A role granted to a group is held by every member, and a group's owners can add members. For role-assignable groups only Privileged Role Administrators, Global Administrators and the owners can change membership, so the owners are effectively role holders. For each owner we check whether that account already holds the role; an owner who does not is a path to it.

Negative result. Role-assignable groups have no owners, or only owners who hold the group's role themselves, and membership is managed through PIM for Groups.

Fix. Remove owners who do not hold the role, and put the groups under PIM for Groups so membership is eligible and time-bound too.

Which AWS permission sets grant standing admin?

inst=$(aws sso-admin list-instances --query 'Instances[0].InstanceArn' --output text)
for ps in $(aws sso-admin list-permission-sets --instance-arn "$inst" --query 'PermissionSets' --output text); do
  printf '%s\t%s\n' "$(aws sso-admin describe-permission-set --instance-arn "$inst" --permission-set-arn "$ps" \
      --query 'PermissionSet.[Name,SessionDuration]' --output text)" \
    "$(aws sso-admin list-managed-policies-in-permission-set --instance-arn "$inst" --permission-set-arn "$ps" \
      --query 'AttachedManagedPolicies[].Name' --output text)"
done

Expected output

ReadOnly	PT1H	ViewOnlyAccess
AdministratorAccess	PT12H	AdministratorAccess   # <- twelve-hour admin sessions for anyone assigned
AtarusOperator	PT4H	AdministratorAccess   # <- the firm's own operator set

Two of the three sets carry AdministratorAccess. AtarusOperator is the firm's own operator set, the one it uses to build and run this lab, with four-hour sessions. In a client's organization a line like it is one more standing admin set to account for, whoever it belongs to. Identity Center has no eligible assignment of its own: anyone assigned a permission set can start a session with it at any time. Time-bound elevation comes from a broker such as AWS's open source TEAM solution, or from PIM for Groups on the Entra group that SCIM pushes into Identity Center. Each administrator set's assignments come next, from list-account-assignments for every account and set, by group; the lab capture stops before that call, so its output is not shown here.

Negative result. Administrator permission sets have sessions of an hour or two and are assigned only through a time-bound elevation process.

Fix. Shorten admin session duration, assign admin sets to groups whose membership is eligible, and alert on CreateAccountAssignment.

The defender sees

Our reads appear in the Entra sign-in log as a Graph PowerShell sign-in and, where enabled, in Microsoft Graph activity logs; the AWS reads are ListInstances, ListPermissionSets, DescribePermissionSet and ListManagedPoliciesInPermissionSet in CloudTrail. The changes worth an alert are in the Entra audit log: Add member to role outside of PIM (permanent), Add member to role completed (PIM activation) at odd hours, changes to role settings, and owners added to role-assignable groups, plus CreateAccountAssignment in AWS. PIM's own alerts flag too many Global Administrators and roles assigned outside PIM. A stolen session on a standing admin account is the case these alerts exist for.

Done when

Permanent and eligible holders of every privileged Entra role are counted, activation rules are read for each, every role-assignable group is listed with its owner count, and every AWS permission set with administrator rights is listed with its assignments.

Not covered

Conditional Access for admins (see the Conditional Access review), Azure resource roles in PIM, and on-premises Active Directory groups.