analyzing-office365-audit-logs-for-compromise

Solid

Parse Office 365 Unified Audit Logs via Microsoft Graph API to detect email forwarding rule creation, inbox delegation, suspicious OAuth app grants, and other indicators of account compromise.

AI & Automation 12,642 stars 1468 forks Updated today Apache-2.0

Install

View on GitHub

Quality Score: 97/100

Stars 20%
100
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
88
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Analyzing Office 365 Audit Logs for Compromise ## Overview Business Email Compromise (BEC) attacks often leave traces in Office 365 audit logs: suspicious inbox rule creation, email forwarding to external addresses, mailbox delegation changes, and unauthorized OAuth application consent grants. This skill uses the Microsoft Graph API to query the Unified Audit Log, enumerate inbox rules across mailboxes, detect forwarding configurations, and identify compromised account indicators. ## When to Use - When investigating security incidents that require analyzing office365 audit logs for compromise - When building detection rules or threat hunting queries for this domain - When SOC analysts need structured procedures for this analysis type - When validating security monitoring coverage for related attack techniques ## Prerequisites - Azure AD app registration with `AuditLog.Read.All`, `MailboxSettings.Read`, `Mail.Read` (application permissions) - Python 3.9+ with `msal`, `requests` - Client secret or certificate for authentication - Global Reader or Security Reader role ## Steps 1. Authenticate to Microsoft Graph using MSAL client credentials flow 2. Query Unified Audit Log for suspicious operations (Set-Mailbox, New-InboxRule) 3. Enumerate inbox rules across mailboxes and flag forwarding rules 4. Detect mailbox delegation changes (Add-MailboxPermission) 5. Identify OAuth consent grants to suspicious applications 6. Check for suspicious sign-in patterns from audit logs ...

Details

Author
mukul975
Repository
mukul975/Anthropic-Cybersecurity-Skills
Created
3 months ago
Last Updated
today
Language
Python
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category