OAuth & Identity Persistence · T1078 / T1098.003

PIM (Privileged Identity Management) Activation Forensics & Anomaly Hunting

Direct Answer (Key Forensic Takeaway)

Entra Privileged Identity Management (PIM) logs role activations as "Add member to role completed (PIM activation)" alongside user-entered Justification text and initiator IP. During an AiTM takeover of an eligible admin, the attacker activates Global or Exchange Admin inside the stolen session—often entering generic justification text like "maintenance" or tampering with "Update role setting in PIM".

Why This Artifact Matters in M365 Incident Response

Deploying Microsoft Entra Privileged Identity Management (PIM) eliminates standing Global Administrators—dramatically shrinking day-to-day attack surface. Yet PIM is not magic armor against session hijacking: if an eligible admin falls for an Evilginx AiTM lure while un-elevated, the attacker sitting inside that stolen session can click straight into PIM and activate Global Administrator unless PIM enforces a fresh Conditional Access Authentication Context with Phishing-Resistant MFA.

Investigating PIM audit trails lets defenders catch both unauthorized admin activations and stealth policy weakening.

In Entra Audit Logs (and Purview RecordType 8), watch three distinct PIM signals: `Add member to role requested (PIM activation)` / `Add member to role completed (PIM activation)`, `Update role setting in PIM` (which exposes someone turning off approval gates, dropping MFA on activation, or extending maximum activation windows to 24 hours), and `Add eligible member to role`.

Always correlate the PIM activation timestamp against the administrator’s Entra Interactive and Non-Interactive Sign-In logs over the preceding 15 minutes: if the admin signed in from Houston at 13:50 UTC, yet PIM activation came from a Frankfurt IP (`194.26.135.210`) at 14:04 UTC, you have undeniable proof of AiTM privilege elevation.

1. RAW TELEMETRY OAuth & Identity Persistence T1078 / T1098.003 2. CLIENT-SIDE PARSE AuditVane Engine Entra PIM activation audit log for 0 Bytes Uploaded 3. SOC OUTCOME Scoped Containment IOCs · CSV · KQL
Local browser DFIR workflow for Entra PIM activation audit log forensics (T1078 / T1098.003)
AdSense-Ready In-Article Placement

Step-by-Step Attack Reconstruction Timeline

An eligible Exchange Administrator opens a phishing PDF at 13:55 UTC on an AiTM proxy. At 14:04 UTC, the attacker triggers `Add member to role completed (PIM activation)` for `Exchange Administrator` with `resultReason: "urgent maintenance"` from `194.26.135.210`.

Because PIM only checked whether the existing browser cookie already contained an MFA claim rather than demanding a fresh FIDO2 tap via Conditional Access Authentication Context, elevation succeeds immediately—until AuditVane (`AV-011` + `AV-009`) correlates the Frankfurt IP with the PIM event.

PIM Activation Event in Entra Directory Audit JSON

{
  "activityDateTime": "2026-12-02T14:04:19Z",
  "activityDisplayName": "Add member to role completed (PIM activation)",
  "category": "RoleManagement",
  "initiatedBy": { "user": { "userPrincipalName": "sysadmin@contoso-demo.invalid", "ipAddress": "194.26.135.210" } },
  "targetResources": [{ "displayName": "Exchange Administrator", "type": "Role" }],
  "resultReason": "urgent maintenance"
}

Notice `initiatedBy.user.ipAddress` (`194.26.135.210`) alongside `resultReason: "urgent maintenance"`—comparing this IP directly against the admin’s Entra Sign-In JSON exposes the compromised session instantly.

Forensic Telemetry Fields & High-Signal Indicators

Telemetry Field / Pattern Meaning in M365 / Entra High-Signal Threat Indicator
Add member to role completed (PIM activation)Eligible admin activated directory roleCross-check IP, SessionId & ticket number in Justification
Update role setting in PIMModified MFA, approval, or duration ruleFlagged Critical by AuditVane AV-011
resultReason / JustificationFree-text justification supplied by userCompare against real ITSM change tickets (look for ".")
ExpirationDurationHow long elevated privilege lastsLook for 8h–24h abnormal max-duration pulls
TicketNumberOptional ITSM reference fieldBlank or bogus "1234" warrants verification
CA Authentication ContextForces fresh FIDO2/Compliant check on PIM activateBest defense against stolen AiTM session elevation

Inspect Active PIM Schedules & Audit PIM Activations via Graph

Connect-MgGraph -Scopes "RoleManagement.Read.Directory","AuditLog.Read.All"
# 1. Inspect currently active PIM role activations:
Get-MgRoleManagementDirectoryRoleAssignmentScheduleInstance -All |
  Where-Object { $_.AssignmentType -eq "Activated" } |
  Format-Table PrincipalId, RoleDefinitionId, StartDateTime, EndDateTime

# 2. Query recent PIM activation & setting audit logs:
Get-MgAuditLogDirectoryAudit -Filter "category eq 'RoleManagement'" -Top 100 |
  Where-Object { $_.ActivityDisplayName -match "PIM|role setting" } |
  Select-Object ActivityDateTime, ActivityDisplayName, ResultReason, @{N="Actor";E={$_.InitiatedBy.User.UserPrincipalName}}

Sample Active PIM Elevation Audit

ActivityDateTime     ActivityDisplayName                         ResultReason        Actor
----------------     -------------------                         ------------        -----
2026-12-02T14:04:19Z Add member to role completed (PIM activation) urgent maintenance  sysadmin@contoso.invalid

Weak PIM Configuration vs. AiTM-Resistant PIM Hardening

PIM SettingVulnerable to AiTM Session Theft?Recommended Hardened Control
Require Azure MFA on activation (Legacy)YES — satisfied by existing stolen MFA cookieSwitch to Require Entra Conditional Access Authentication Context
Phishing-Resistant MFA Auth ContextNO — forces fresh FIDO2/Passkey tap at activationBind Tier-0 roles to Phishing-Resistant Auth Strength Context
Require Approval on Global AdminMitigates single-admin takeoverRequire peer approval from 2nd verified Tier-0 admin
Maximum Activation Duration8–24 hours gives attacker wide dwell windowCap Global/Priv Role Admin activations to 1–4 hours

Step-by-Step Triage, Containment & Verification

  1. Drop Entra Directory Audit JSON and Sign-In JSON together into AuditVane and inspect AV-011 findings.
  2. Review every `PIM activation` and `Update role setting` event alongside the actor’s Entra Sign-In IP and `riskLevelDuringSignIn`.
  3. Verify `resultReason` strings directly against approved change-management / helpdesk tickets.
  4. If suspicious, immediately deactivate the active PIM assignment in Entra PIM, revoke user sessions (`Revoke-MgUserSignInSession`), and reset admin credentials.
  5. Upgrade PIM role settings for Global Admin, Privileged Role Admin, and Exchange Admin to require **Conditional Access Authentication Context** enforcing Phishing-Resistant MFA (FIDO2) and peer approval.

How to Verify Containment Completed Cleanly

  • All currently Activated PIM assignments checked and unauthorized ones deactivated.
  • Update role setting in PIM audited to verify MFA, approval, and max duration weren’t weakened.
  • Tier-0 PIM roles linked to Conditional Access Authentication Context (Phishing-Resistant MFA).

Analyst Blind Spots, Licensing Quirks & False Positives

A widely misunderstood quirk in Entra PIM: checking "Require Azure MFA on activation" inside PIM role settings ONLY checks whether the user’s current session token already holds an MFA claim—meaning a stolen AiTM session satisfies it silently with zero prompt! Only Conditional Access **Authentication Context** with Sign-In Frequency (`Every time`) + Phishing-Resistant MFA forces a fresh hardware key check at activation.

Also watch `Update role setting in PIM`: an attacker who already holds Privileged Role Admin can lower activation rules first before elevating.

Frequently Asked Questions

Can an AiTM attacker activate PIM without knowing the admin’s MFA device?

Yes, unless PIM uses Conditional Access Authentication Context configured with Sign-In Frequency Every Time and Phishing-Resistant MFA.

How do attackers abuse Update role setting in PIM?

They disable peer approval, turn off activation notifications, or expand activation duration up to 24 hours.

Does AuditVane highlight PIM role mutations?

Yes! Rule AV-011 catches Add member to role, Add eligible member to role, and Update role setting events automatically.

Should regular admins check PIM justification logs periodically?

Yes—auditing vague justifications (".", "test", "maintenance") alongside Sign-In IPs quickly surfaces anomalous activations.

Related Forensics Guides