plugins/lobbi-m365-automator/skills/m365-auditor/SKILL.md
Design Microsoft 365 audit log query specifications and compliance reporting for FINRA, state insurance examiner, and internal audit requirements in financial services tenants.
npx skillsauth add markus41/claude plugins/lobbi-m365-automator/skills/m365-auditorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Produce a Microsoft 365 audit specification that covers audit log query design, report templates, alert rules, and retention configuration for financial services compliance requirements. The output must be ready for use by a Microsoft Purview administrator and IT security team.
Verify and document audit enablement status for each workload:
| Workload | Audit Source | Enable Command | |----------|-------------|----------------| | Exchange Online | Microsoft Purview Audit | Enabled by default for E3/E5 | | SharePoint Online | Microsoft Purview Audit | Enabled by default | | Microsoft Teams | Microsoft Purview Audit | Enabled by default | | Azure AD / Entra ID | Microsoft Purview Audit | Enabled by default | | Power Platform | Microsoft Purview Audit | Must be enabled per environment | | Microsoft Defender for O365 | Defender portal | Separate configuration |
Audit log retention tier:
| License | Retention Period | Coverage | |---------|-----------------|----------| | E3 or Business Premium | 90 days | Standard audit | | E5 | 1 year | Standard + advanced audit | | Microsoft Purview Audit (Premium) add-on | 1 year or 10 years | Advanced audit events |
For FINRA-regulated broker-dealers: 10-year retention add-on is required for broker communications (FINRA Rule 17a-4). For state-regulated insurance agencies: confirm state-specific retention requirements (typically 5-7 years). Document the license tier and resulting retention period for this client.
Events to capture and review:
| Operation | Description | Risk Signal | |-----------|-------------|-------------| | UserLoggedIn | Successful sign-in | Baseline — look for anomalous locations | | UserLoginFailed | Failed sign-in | >5 failures = potential brute force | | MFADenied | MFA challenge denied | User denying legitimate login | | UserPasswordChanged | Password change | Verify it was user-initiated | | Set-MsolUserPassword | Admin password reset | Privilege action — must be logged | | Add member to role | Role assignment | Any admin role grant requires review | | Remove member from role | Role removal | Ensure it was authorized offboarding |
| Operation | Description | Risk Signal | |-----------|-------------|-------------| | FileAccessed | File opened or downloaded | Baseline — look for bulk access | | FileDownloaded | File downloaded to device | >50 files in 1 hour = alert | | SharingInvitationCreated | External share initiated | Any sharing outside approved domains | | AnonymousLinkCreated | Anyone link created | Should be blocked by policy — if seen, alert | | FileDeleted | File deleted | Bulk deletion (>20 files) = alert | | FileModified | File edited | Useful for content audit trails |
| Operation | Description | Risk Signal | |-----------|-------------|-------------| | Send | Email sent | High volume from single user | | SendAs | Email sent as another identity | Any occurrence warrants review | | HardDelete | Email permanently deleted | During investigation period = alert | | MessageForwardingRuleEnabled | Auto-forward rule created | External auto-forward = data exfiltration risk | | New-InboxRule | New inbox rule | Check destination for external address |
| Operation | Description | Risk Signal | |-----------|-------------|-------------| | TeamCreated | New team created | Verify naming policy compliance | | MemberAddedToTeam | Member added | External guest added = review | | ChatMessageSent | Chat message | Keyword detection for compliance | | FileUploadedToChannel | File uploaded | Large file uploads | | MeetingRecordingCreated | Recording started | Verify recording policy compliance |
| Operation | Description | Risk Signal | |-----------|-------------|-------------| | Set-TransportRule | Mail flow rule changed | All changes require change ticket | | Set-AdminAuditLogConfig | Audit config changed | Attempt to disable auditing = critical alert | | New-RoleGroupMember | Admin role granted | Privileged access change | | Set-RetentionCompliancePolicy | Retention policy changed | Compliance risk |
Provide ready-to-use Search-UnifiedAuditLog PowerShell query templates.
Weekly security summary query:
# Run every Monday for prior week
$StartDate = (Get-Date).AddDays(-7).ToString("MM/dd/yyyy")
$EndDate = (Get-Date).ToString("MM/dd/yyyy")
# Authentication failures
Search-UnifiedAuditLog -StartDate $StartDate -EndDate $EndDate `
-Operations "UserLoginFailed" `
-ResultSize 1000 |
Select-Object -ExpandProperty AuditData |
ConvertFrom-Json |
Select-Object CreationTime, UserId, Operation, ClientIPAddress, UserAgent |
Export-Csv ".\weekly-auth-failures.csv" -NoTypeInformation
# External sharing events
Search-UnifiedAuditLog -StartDate $StartDate -EndDate $EndDate `
-Operations "SharingInvitationCreated","AnonymousLinkCreated" `
-ResultSize 1000 |
Select-Object -ExpandProperty AuditData |
ConvertFrom-Json |
Select-Object CreationTime, UserId, Operation, ObjectId, TargetUserOrGroupName |
Export-Csv ".\weekly-external-sharing.csv" -NoTypeInformation
# Admin role changes
Search-UnifiedAuditLog -StartDate $StartDate -EndDate $EndDate `
-Operations "Add member to role.","Remove member from role." `
-ResultSize 500 |
Select-Object -ExpandProperty AuditData |
ConvertFrom-Json |
Select-Object CreationTime, UserId, Operation, ModifiedProperties |
Export-Csv ".\weekly-role-changes.csv" -NoTypeInformation
On-demand examination evidence query (for regulatory examiner requests):
# Query specific user activity for examination period
param(
[string]$UserEmail,
[string]$StartDate, # MM/dd/yyyy
[string]$EndDate # MM/dd/yyyy
)
$Operations = @(
"Send","FileAccessed","FileDownloaded","FileDeleted",
"UserLoggedIn","UserLoginFailed","SharingInvitationCreated"
)
Search-UnifiedAuditLog -StartDate $StartDate -EndDate $EndDate `
-UserIds $UserEmail `
-Operations $Operations `
-ResultSize 5000 |
Select-Object -ExpandProperty AuditData |
ConvertFrom-Json |
Select-Object CreationTime, UserId, Operation, ObjectId, ClientIPAddress, UserAgent |
Sort-Object CreationTime |
Export-Csv ".\examination-evidence-$UserEmail.csv" -NoTypeInformation
Delivered every Monday. Sections:
Delivered first business day of each month. Sections:
On-demand, per examiner request. Contents:
Configure Microsoft Sentinel or Microsoft Defender for Identity (or equivalent SIEM) to alert on:
| Alert Name | Condition | Severity | Notification | |-----------|-----------|----------|-------------| | Bulk file download | >50 files downloaded by one user in 60 minutes | High | Security team email + Teams post | | External auto-forward detected | New-InboxRule with external forward destination | Critical | Immediate page to security lead | | Anonymous link created | AnonymousLinkCreated operation detected | High | Security team email | | Admin role granted | Add member to role (any admin role) outside change window | Medium | IT manager email | | Audit config changed | Set-AdminAuditLogConfig | Critical | Immediate page — auditing may be compromised | | Login from new country | User authenticates from country not in baseline | Medium | User notification + security team | | Multiple failed MFA | >3 MFA failures for one user in 30 minutes | High | Security team email | | Mass email deletion | >100 emails HardDeleted in 24 hours | High | Security team email |
Document the retention configuration to be applied:
# Set 10-year audit retention for regulated users (FINRA)
Set-MailboxAuditBypassAssociation -Identity "[email protected]" -AuditBypassEnabled $false
# Enable mailbox auditing for all users (verify it's on)
Get-Mailbox -ResultSize Unlimited |
Where-Object {$_.AuditEnabled -eq $false} |
Set-Mailbox -AuditEnabled $true
# Verify audit log retention tier
Get-AdminAuditLogConfig | Select-Object UnifiedAuditLogIngestionEnabled, AdminAuditLogEnabled
For Microsoft Purview Audit (Premium) 10-year retention: Must be assigned per-user via the Compliance portal > Audit > Audit retention policies. Create a policy with 10-year duration and assign to all licensed users in regulated roles.
Deliver as:
development
Enhanced plan-authoring skill with Pre-Writing context gathering, task metadata, non-TDD templates, Red Flags, telemetry, and an automated plan linter. Use when you have a spec or requirements for a multi-step task, before touching code.
tools
Documentation intelligence engine with graph-based API docs, algorithm library, and drift detection
tools
Ultraplan cloud planning — kick off a plan in the cloud from your terminal, review and revise in the browser, then execute remotely or send back to CLI
tools
--- name: mcp description: Configure MCP servers for Claude Code — stdio vs HTTP, authentication, Tools/Resources/Prompts distinction, channels (CI webhook, mobile relay, Discord bridge, fakechat), and cost of always-loaded tools. Use this skill whenever adding an MCP server, debugging connection issues, choosing between MCP Tools vs Prompts vs Resources, installing channel servers, or managing .mcp.json. Triggers on: "MCP server", "mcp config", "add Obsidian MCP", "install context7", "channels"