Audit Log vs Unified Audit Log vs Entra Audit Log
One of the most persistent sources of confusion in Microsoft 365 digital forensics stems from the nomenclature and coexistence of multiple โaudit logsโ: the Microsoft Entra ID Audit Log, the Microsoft Purview Unified Audit Log (UAL), and Workload-Specific Local Audit Logs (such as the legacy Exchange Admin Audit Log or SharePoint Site Audit).
When an adversary alters directory roles, adds credentials to an application, or manipulates mailbox delegation, records appear across several logging platforms simultaneously. However, they do not arrive at the same time, they do not retain data for the same duration, and their underlying data schemas are not identical. Selecting the incorrect log source during an ongoing incident can lead to false negatives, delayed triage, or catastrophic evidence loss due to retention expiration.
1. Architectural Comparison & Source Systems
Section titled โ1. Architectural Comparison & Source SystemsโTo understand where evidence resides, an incident responder must trace each log back to its authoritative recording engine:
graph TD subgraph "Identity Control Plane" ENTRA_CORE[Microsoft Entra ID Directory Engine] ENTRA_LOG[Entra Audit Log<br/>Tenant Directory Changes] ENTRA_STORE[(Entra Storage<br/>7 to 30 Days)] end
subgraph "Workload Storage & Execution Plane" EXO_CORE[Exchange Online Transport & Mailboxes] SPO_CORE[SharePoint / OneDrive Subsystems] EXO_LEGACY[Legacy Admin Audit Log] end
subgraph "Compliance & Aggregation Plane" INGEST[Purview Ingestion Bus] UAL_STORE[(Unified Audit Log Store<br/>180 Days to 1 Year+)] end
ENTRA_CORE -->|Real-time: 2-5 min| ENTRA_LOG ENTRA_LOG --> ENTRA_STORE
ENTRA_CORE -->|Replication: 15-60 min| INGEST EXO_CORE -->|Publish: 15-45 min| INGEST SPO_CORE -->|Publish: 15-30 min| INGEST
EXO_CORE -->|Local Log: Immediate| EXO_LEGACY
INGEST --> UAL_STOREThe Three Logging Systems: Taxonomy & Boundary Matrix
Section titled โThe Three Logging Systems: Taxonomy & Boundary Matrixโ| Parameter | Entra ID Audit Log | Purview Unified Audit Log (UAL) | Workload-Specific Local Logs |
|---|---|---|---|
| Authoritative Scope | Identity control plane: Users, Groups, Enterprise Apps, Role Assignments, PIM. | Cross-workload enterprise activity: Exchange, SharePoint, Teams, Entra ID, Power Platform. | Workload boundary only: Exchange Mailbox/Admin audit, SharePoint Site audit. |
| Ingestion Latency | 2 to 5 minutes (Near real-time). | 15 minutes to 24 hours (Asynchronous aggregation). | Immediate (local transaction store). |
| Default Retention | Free: 7 days P1 / P2: 30 days | Standard: 180 days Premium / E5: 1 year (extensible to 10y) | Workload dependent (Exchange: 90 days). |
| Primary API Endpoint | Microsoft Graph API:/v1.0/auditLogs/directoryAudits | Office 365 Management Activity API / Graph Audit API | Exchange Online PowerShell:Search-AdminAuditLog |
| Query Cmdlet | Get-MgAuditLogDirectoryAudit | Search-UnifiedAuditLog | Search-AdminAuditLog / Get-MailboxAuditLog |
| Licensing Tier | Free, P1, P2 | Purview Audit (Standard / Premium) | Native to workload license |
2. The Duplication Problem: Traceability Across Systems
Section titled โ2. The Duplication Problem: Traceability Across SystemsโWhen an administrative event occurs in Entra IDโfor example, an attacker granting a rogue account the Exchange Administrator roleโthat single event is captured across multiple systems with distinct representations:
sequenceDiagram autonumber actor Attacker as Compromised Admin Account participant Entra as Entra ID Directory Engine participant EntraLog as Entra Audit Log (/auditLogs) participant UAL as Purview UAL (RecordType 15) participant Defender as Defender XDR (CloudAppEvents)
Attacker->>Entra: Assigns "Exchange Administrator" to Rogue_User Entra->>EntraLog: Writes directoryAudit (Latency: ~2 min) Note over EntraLog: Available in Entra Portal & Graph API Entra->>UAL: Publishes to Purview Event Bus (Latency: ~30 min) Note over UAL: Indexed as RecordType 15 in UAL Entra->>Defender: Streams to Advanced Hunting (Latency: ~10 min) Note over Defender: Queryable in CloudAppEvents (ActionType: Add member to role.)Schema Divergence on the Same Event
Section titled โSchema Divergence on the Same EventโWhile both logs describe the exact same action, their serialization differs significantly:
{ "id": "Directory_a4f89d32-28e1-4c12-b891-883109aef102", "category": "RoleManagement", "correlationId": "5e12a843-ef45-42a1-9a14-8712a45930b1", "result": "success", "resultReason": "", "activityDisplayName": "Add member to role", "activityDateTime": "2026-09-15T10:14:22.124Z", "loggedByService": "Core Directory", "operationType": "Add", "initiatedBy": { "user": { "id": "3d12f890-341a-4f89-91a1-987120adfe01", "displayName": "Global Admin Compromised", "userPrincipalName": "admin@defense-corp.org", "ipAddress": "198.51.100.45" } }, "targetResources": [ { "id": "29283109-1004-4b51-9e7f-cisco-seg-sqli", "displayName": "Exchange Administrator", "type": "Role", "modifiedProperties": [ { "displayName": "Role.DisplayName", "oldValue": null, "newValue": ""Exchange Administrator"" } ] }, { "id": "4e9c7a21-82b4-4b51-9e7f-cisco-seg-sqli", "displayName": "Rogue_User", "type": "User", "userPrincipalName": "rogue_user#EXT#@defense-corp.onmicrosoft.com" } ]}{ "CreationTime": "2026-09-15T10:14:22", "Id": "a4f89d32-28e1-4c12-b891-883109aef102", "Operation": "Add member to role.", "OrganizationId": "72f988bf-86f1-41af-91ab-2d7cd011db47", "RecordType": 15, "ResultStatus": "Success", "UserKey": "admin@defense-corp.org", "UserType": 0, "Workload": "AzureActiveDirectory", "ClientIP": "198.51.100.45", "Actor": [ { "ID": "admin@defense-corp.org", "Type": 5 } ], "Target": [ { "ID": "Exchange Administrator", "Type": 2 }, { "ID": "rogue_user#EXT#@defense-corp.onmicrosoft.com", "Type": 1 } ], "ModifiedProperties": [ { "Name": "Role.DisplayName", "NewValue": ""Exchange Administrator"", "OldValue": "" } ]}3. Scope Exclusivity: What Is ONLY Found in Which Log?
Section titled โ3. Scope Exclusivity: What Is ONLY Found in Which Log?โUnderstanding telemetry gaps is essential to ensure that responders do not search the wrong repository:
+---------------------------------------------------------------------------------------+| MICROSOFT PURVIEW UAL || || +------------------------------------+ +--------------------------------------+ || | EXCHANGE ONLINE | | SHAREPOINT / ONEDRIVE | || | - MailItemsAccessed (Bind/Sync) | | - FileDownloaded / FileAccessed | || | - New-InboxRule / Set-InboxRule | | - SharingInvitationCreated | || | - SendAs / SendOnBehalf | | - AnonymousLinkCreated | || | - SoftDelete / HardDelete | | - SiteCollectionAdminAdded | || +------------------------------------+ +--------------------------------------+ || || +------------------------------------+ +--------------------------------------+ || | MICROSOFT TEAMS | | ENTRA REPLICATION (15) | || | - ChannelAdded / TeamCreated | | - Add member to role | || | - MemberAdded / GuestInvited | | - Consent to application | || | - BotAddedToTeam | | - Add service principal credentials | || +------------------------------------+ +--------------------------------------+ |+---------------------------------------------------|-----------------------------------+ | Replication Pipeline | (15m - 60m latency) v+---------------------------------------------------------------------------------------+| ENTRA ID AUDIT LOG || || - Real-time Directory Audits (~2 min latency) || - Granular TargetResources metadata (Object GUIDs, Directory Schema Extensions) || - PIM (Privileged Identity Management) Role Activation & Justification Strings || - Conditional Access Policy Configuration & State Deltas || - Password Reset, Self-Service Lifecycle Operations |+---------------------------------------------------------------------------------------+Critical Exclusivity Rules for DFIR
Section titled โCritical Exclusivity Rules for DFIRโ- Email Item Access & Actions: ONLY found in UAL (
RecordType 2). Entra ID has zero visibility into email reads, rule manipulation, or inbox forwarding. - File Downloads & Sharing Links: ONLY found in UAL (
RecordType 6). Entra ID records authentication to SharePoint, but never the subsequent file downloads. - PIM Activation Justification: Found with maximum fidelity in Entra Audit Logs. The UAL captures the resulting role assignment, but the detailed PIM request metadata is often stripped or abbreviated.
- Historical Investigations (> 30 days): For identity events older than 30 days, responders must use the UAL (or cold storage SIEM). The Entra ID audit log natively rolls over and purges events at day 30 (even on P2 licenses).
4. Operational Triage Decision Framework
Section titled โ4. Operational Triage Decision FrameworkโDuring an active incident, apply this decision rubric to determine which log source to query first:
| Investigative Phase | Preferred Source | Secondary Source | Rationale |
|---|---|---|---|
| Phase 1: Immediate Triage (0 - 4h) Scoping compromised credentials & privilege escalation | Entra ID Audit Log (Graph API) | Defender XDR (CloudAppEvents) | Sub-5-minute latency allows real-time tracking of attacker directory actions. |
| Phase 2: Data Impact Assessment Determining stolen emails and exfiltrated documents | Purview Unified Audit Log | Workload Diagnostics (eDiscovery / Message Trace) | Only UAL indexes MailItemsAccessed and FileDownloaded. |
| Phase 3: Persistence Hunting Checking for OAuth apps, forwarding rules, federated domains | Both Entra Audit & UAL | PowerShell scripts | OAuth apps exist in both; inbox rules exist strictly in UAL/Exchange. |
| Phase 4: Historical Scoping (> 30d) Evaluating initial compromise from months prior | Purview Unified Audit Log | SIEM / Azure Log Analytics cold storage | Entra Audit native retention is capped at 30 days. |
5. Practical Extraction Workflows
Section titled โ5. Practical Extraction Workflowsโ# Authenticate to Microsoft Graph with AuditLog.Read.AllConnect-MgGraph -Scopes "AuditLog.Read.All", "Directory.Read.All"
# Query Directory Audit Logs for the last 24 hours (High Speed, Low Latency)$startTime = (Get-Date).AddDays(-1).ToString("yyyy-MM-ddTHH:mm:ssZ")
$entraEvents = Get-MgAuditLogDirectoryAudit -Filter "activityDateTime ge $startTime and category eq 'RoleManagement'" -All
# Parse initiatedBy and TargetResources$entraEvents | Select-Object ActivityDateTime, ActivityDisplayName, Result, ` @{N="InitiatedBy"; E={$_.InitiatedBy.User.UserPrincipalName}}, ` @{N="ClientIP"; E={$_.InitiatedBy.User.IpAddress}}, ` @{N="Target"; E={($_.TargetResources | Select-Object -First 1).DisplayName}} | ` Format-Table -AutoSizeConnect-ExchangeOnline -UserPrincipalName dfir@defense-corp.org
# Query UAL for the exact same operations$startDate = (Get-Date).AddDays(-1).ToUniversalTime()$endDate = (Get-Date).ToUniversalTime()
$ualEvents = Search-UnifiedAuditLog ` -StartDate $startDate ` -EndDate $endDate ` -RecordType AzureActiveDirectory ` -Operations "Add member to role.", "Consent to application." ` -ResultSize 5000 ` -Formatted
# Unpack AuditData JSON payload$ualEvents | ForEach-Object { $audit = $_.AuditData | ConvertFrom-Json [PSCustomObject]@{ CreationTime = $_.CreationTime Operation = $_.Operation Actor = $audit.Actor[0].ID ClientIP = $audit.ClientIP Target = ($audit.Target | ForEach-Object { $_.ID }) -join " -> " }} | Format-Table -AutoSize6. Forensic Gotchas & Divergence Pitfalls
Section titled โ6. Forensic Gotchas & Divergence Pitfallsโ7. Cross-Reference & Operational Mesh
Section titled โ7. Cross-Reference & Operational Meshโ- 08. Logging Architecture โ Fundamental structural map of telemetry planes.
- 10. Entra Audit Logs Analysis โ Comprehensive operational guide to directory audit records.
- 13. Unified Audit Log Deep Dive โ Complete dissection of the Purview aggregation engine.
- 18. Microsoft 365 Audit Retention & Licensing Realities โ Licensing limitations and cold storage forwarding strategies.
- 47. Correlating Microsoft 365 Evidence Sources โ Multi-layered correlation across identity, email, and files.\n