Skip to content

About

Enterprise Microsoft Purview Audit implementation — unified audit log search, security investigation, insider threat detection, and compliance reporting across Microsoft 365.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

Microsoft Purview Audit

Enterprise audit log search, security investigation, and compliance reporting across Microsoft 365 — MS-102 implementation lab

License: MIT Platform Status MS-102


Enterprise Overview

Microsoft Purview Audit provides a centralised, searchable record of user, administrator, application, and service activities across Microsoft 365 workloads. When a security incident occurs — whether a data breach, insider threat event, or compliance violation — the Unified Audit Log (UAL) is the primary data source for forensic investigation.

This repository documents an enterprise implementation of Microsoft Purview Audit, covering audit configuration verification, targeted audit searches, structured investigation workflow, log export for evidence preservation, and integration with compliance reporting processes.

Attribute Value
Tenant securem365lsb.onmicrosoft.com
Workloads Covered Exchange Online, SharePoint Online, OneDrive, Teams, Entra ID
Audit Tier Audit Standard
Investigation Scenario Insider Threat — File Access Pattern Analysis
Events Captured 12 FileAccessed events (testuser1, 2026-07-02)
Export Format CSV — chain-of-custody evidence

Business Problem

Challenge Impact
No visibility into who accessed sensitive SharePoint documents Unable to investigate potential data exfiltration
File deletions occur with no accountability record Security team cannot determine scope of data loss
Privileged account actions not reviewed systematically Compliance gap for administrator accountability
Security incidents investigated reactively, without data Mean time to investigate (MTTI) is days, not hours
Regulatory auditors require evidence of monitoring controls Failed audits, potential fines, remediation costs

Business Requirements

  1. Audit Trail — Every user and administrator action across M365 workloads must generate a searchable audit record
  2. Targeted Search — Security team must be able to search by user, date range, workload, and activity type
  3. Investigation Workflow — Structured process for investigating file access, deletion, sharing, and admin changes
  4. Evidence Export — Audit results must be exportable to CSV for legal hold and forensic reporting
  5. Compliance Reporting — Audit data must support regulatory requirements (ISO 27001, GDPR Article 5)
  6. Retention — Audit records retained for a minimum of 90 days (Audit Standard)

Microsoft Solution

Microsoft Purview Audit addresses all requirements through the Unified Audit Log:

  • Unified Audit Log — Centralised repository capturing activities from all M365 workloads
  • Audit Search — Configurable search by date range, user, activity type, file, and workload
  • Activity Filters — Granular filters for file operations, mailbox access, Teams events, admin changes
  • Export to CSV — Full audit export with JSON AuditData field for forensic analysis
  • Audit Standard — 90-day retention, full search capability, CSV export (included in E3/E5)
  • Audit Premium — Extended retention (1–10 years), high-value audit events, advanced investigation (requires E5)

Environment

Component Detail
Tenant Microsoft 365 E5 Trial
Admin Portal compliance.microsoft.com
Test Account testuser1@securem365lsb.onmicrosoft.com
Investigation Period 2026-07-01 to 2026-07-03
Activity Investigated FileAccessed (SharePoint Online)
Files Accessed GSM-Test.docx, GSM Confidential Documents
Total Events Found 12 audit records

Architecture

  ┌──────────────────────────────────────────────────────────────────────┐
  │                MICROSOFT 365 AUDIT ARCHITECTURE                      │
  │                  compliance.microsoft.com                            │
  └──────────────────────────────────────────────────────────────────────┘

  ACTIVITY SOURCES           UNIFIED AUDIT LOG          INVESTIGATION TOOLS
  ┌──────────────┐          ┌────────────────────┐     ┌──────────────────┐
  │ Exchange     │─────────▶│                    │────▶│  Audit Search    │
  │ Online       │          │   UNIFIED AUDIT    │     │  Date/User/      │
  └──────────────┘          │       LOG          │     │  Activity Filter │
  ┌──────────────┐          │                    │     └──────────────────┘
  │ SharePoint   │─────────▶│  90-day Standard   │     ┌──────────────────┐
  │ Online       │          │  1–10yr Premium    │────▶│  Results Review  │
  └──────────────┘          │                    │     │  Activity/User/  │
  ┌──────────────┐          │  Record Types:     │     │  IP/Workload     │
  │ OneDrive     │─────────▶│  • SharePoint      │     └──────────────────┘
  └──────────────┘          │  • Exchange        │     ┌──────────────────┐
  ┌──────────────┐          │  • AzureAD         │────▶│  CSV Export      │
  │ Microsoft    │─────────▶│  • MicrosoftTeams  │     │  Evidence        │
  │ Teams        │          │  • OneDrive        │     │  Preservation    │
  └──────────────┘          │  • SecurityCompli  │     └──────────────────┘
  ┌──────────────┐          └────────────────────┘     ┌──────────────────┐
  │ Entra ID     │─────────────────────────────────────▶│  PowerShell     │
  └──────────────┘                                     │  Automation      │
                                                        └──────────────────┘

Implementation Phases

Phase 1 — Enable Microsoft Purview Audit

Navigate to compliance.microsoft.com → Solutions → Audit. Verify audit is enabled for the tenant. By default, auditing is enabled for Microsoft 365 organizations, but this must be confirmed before relying on audit data for investigations.

Purview Audit Solution Overview

Key Verification Points:

  • Auditing status shows as enabled
  • All workloads appear in the audit solution
  • Administrative accounts have Audit Logs or View-Only Audit Logs role assigned

Phase 2 — Configure Audit Search

Navigate to Audit → Search. Configure the search parameters:

Parameter Value Purpose
Date Range 2026-07-01 to 2026-07-03 Scope investigation window
Activities FileAccessed Target specific operation type
Users testuser1 Scope to single identity
Record Types SharePointFileOperation Filter by workload

Audit Search Configuration

Phase 3 — Execute Audit Search

Submit the search and monitor progress. The audit search is asynchronous — results are returned progressively as the UAL is queried across all storage partitions.

Search In Progress

Search Completed — 12 Results

Results Summary:

  • Search status: Completed (100%)
  • Total events returned: 12 audit records
  • Search identifier: Jul 1 – Jul 3 testuser1 fileaccessed

Phase 4 — Investigate User Activities

Review returned audit events. Each record contains:

Field Description
Date (UTC) Timestamp of activity
User Identity performing the action
Activity Operation type (FileAccessed, FileDeleted, etc.)
Record Type Workload source (SharePointFileOperation)
IP Address Client IP at time of action
Item Affected file or resource

Audit Search Results — 12 Events

Investigation Findings:

  • User: testuser1@securem365lsb.onmicrosoft.com
  • Files Accessed: GSM-Test.docx, GSM Confidential Documents
  • Date: 2026-07-02
  • Record Type: SharePointFileOperation (Record Type 6)
  • Pattern: 12 file access events in a focused time window — consistent with data reconnaissance

Phase 5 — Export Audit Results

Select Export Results to download a full CSV export of all matching audit events. The export preserves complete AuditData JSON for each record, providing full forensic context.

Export In Progress

Export Complete

Export Output:

  • Format: CSV with AuditData JSON column
  • Columns: RecordId, CreationDate, RecordType, Operation, UserId, AuditData
  • Records: 12 rows
  • Evidence status: Preserved for compliance and incident response

Phase 6 — Validation

Open the exported CSV in Excel to verify completeness and accuracy. All 12 events confirmed present with full audit context.

Audit Export — Excel Validation

Export Field Validation:

Column Value Confirmed
RecordId Unique GUID per record
CreationDate 2026-07-02 (UTC)
RecordType 6 (SharePoint)
Operation FileAccessed
UserId testuser1@securem365lsb.onmicrosoft.com
AuditData Full JSON with session IDs and client app details

Validation Results

Test Case Description Result
TC-AUD-01 Audit solution accessible at compliance.microsoft.com → Solutions → Audit ✅ Pass
TC-AUD-02 Audit search executes with date, user, and activity filters ✅ Pass
TC-AUD-03 Search completes with 12 results for testuser1 FileAccessed ✅ Pass
TC-AUD-04 Audit results display Activity, User, IP, Date, RecordType fields ✅ Pass
TC-AUD-05 Export completes and CSV downloads successfully ✅ Pass
TC-AUD-06 CSV validates in Excel with all 12 records and AuditData JSON intact ✅ Pass

PowerShell Automation

Script Purpose
Search-UnifiedAuditLog.ps1 Targeted audit log search with activity, user, and date filters
Export-AuditLogs.ps1 Bulk audit export to CSV and JSON with retention-aware batching
Get-AuditConfiguration.ps1 Audit configuration audit — enabled status, mailboxes, admin roles
# Quick audit search example
.\Search-UnifiedAuditLog.ps1 `
  -StartDate "2026-07-01" `
  -EndDate "2026-07-03" `
  -UserIds "testuser1@securem365lsb.onmicrosoft.com" `
  -Operations "FileAccessed" `
  -OutputPath "C:\AuditExports"

Audit Standard vs Audit Premium

Feature Audit Standard Audit Premium
Audit Search ✅ ✅
Export to CSV ✅ ✅
Retention 90 days 1–10 years
High-Value Events Limited Enhanced (MailItemsAccessed, Send)
Advanced Investigation ❌ ✅
Licensing E3 / E5 E5 / Compliance Add-On
This Lab ✅ Standard —

Lessons Learned

  1. Audit is enabled by default — but verify before an incident occurs. Many organizations assume it is active without checking.
  2. Search scope determines performance — broad date ranges across all users can be slow. Targeted searches (specific user, activity, and date range) return results faster and are easier to analyse.
  3. AuditData JSON is the forensic record — the CSV columns are metadata; the AuditData JSON field contains the complete activity context including client IP, session IDs, browser agent, and exact resource path.
  4. Export early — Audit Standard retains logs for 90 days. Export and preserve evidence immediately when an incident is identified; do not rely on the portal for long-term retention.
  5. Audit Premium required for mailbox reads — the MailItemsAccessed event (critical for email breach investigation) is an Audit Premium–only event.

Troubleshooting

Issue Likely Cause Resolution
Audit solution not visible Missing role Assign Audit Logs or View-Only Audit Logs role
Search returns no results Audit not enabled Run Get-AdminAuditLogConfig to verify
Events missing for a user User excluded from audit Check per-user audit settings in Exchange
Export fails silently Permissions issue Verify Compliance Administrator or eDiscovery roles
AuditData column is empty CSV parsing issue Open CSV in Excel; use Data → Text Import for large files
Search times out Overly broad scope Narrow date range or add user/activity filters

Future Improvements

  • Configure Audit Premium for extended retention and MailItemsAccessed events
  • Create scheduled PowerShell jobs for weekly audit log export
  • Build Power BI dashboard connected to exported audit CSV
  • Integrate audit alerts with Microsoft Sentinel for real-time incident creation
  • Configure audit retention policies for specific record types (3-year for admin actions)
  • Implement audit log archival to Azure Blob Storage for long-term compliance

Repository Structure

Microsoft-Purview-Audit/
├── README.md                          # This document
├── LICENSE                            # MIT License
├── .gitignore                         # Excludes credentials, exports, logs
├── GITHUB-METADATA.md                 # Repository metadata and push guide
├── WEBSITE-PORTFOLIO-CARD.md          # Portfolio card HTML block
├── architecture/
│   └── purview-audit-architecture.md  # 4 Mermaid architecture diagrams
├── docs/
│   ├── 01-overview.md                 # What is Purview Audit, architecture, licensing
│   ├── 02-enable-audit.md             # Enabling and verifying audit
│   ├── 03-audit-search.md             # Configuring and running audit searches
│   ├── 04-investigation.md            # Investigation workflow and findings
│   ├── 05-export-results.md           # Exporting audit logs for evidence
│   ├── 06-validation.md               # 6 test cases with pass results
│   ├── troubleshooting.md             # 6 common issues and resolutions
│   └── screenshots-placement-guide.md # Screenshot index and placement map
├── images/
│   ├── 02-enable-audit/               # Audit solution screenshots
│   ├── 03-audit-search/               # Search configuration and progress
│   ├── 04-investigation/              # Audit results screenshots
│   ├── 05-export-results/             # Export workflow screenshots
│   └── 06-validation/                 # CSV validation in Excel
└── scripts/
    ├── Search-UnifiedAuditLog.ps1     # Targeted audit search automation
    ├── Export-AuditLogs.ps1           # Bulk audit log export
    └── Get-AuditConfiguration.ps1     # Audit configuration audit

References

About

Enterprise Microsoft Purview Audit implementation — unified audit log search, security investigation, insider threat detection, and compliance reporting across Microsoft 365.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages