2025-08-05
Detect Risky SharePoint and OneDrive External Sharing

Stop Flying Blind: A Practical Framework to See and Control SharePoint/OneDrive External Sharing at Scale
What this session covers
-
Why default M365 auditing misses critical SharePoint/OneDrive sharing events
-
The tenant-level switches you must flip for complete logs
-
PowerShell recipes that turn raw audit firehose into signal
-
Real-time alerting that escalates risk without spamming your inbox
-
How to automate and scale the whole system across thousands of users/sites
Key takeaways
-
“Audit enabled” ≠ complete visibility. Anonymous link creation/usage and guest access often slip by default.
-
If the data isn’t logged, no script or SIEM can rescue you. Fix audit coverage first, then automate.
-
Context wins: file sensitivity + destination domain + user behavior = actionable alerts.
-
Scale requires pagination, delta windows, and automation (not weekly CSV archaeology).
-
Treat monitoring as a product: version your scripts, review rules monthly, and auto-onboard new sites.
Fix your audit foundation (must-do settings)
-
Enable enhanced auditing for SharePoint and OneDrive at the tenant level.
-
Log both link creation and link usage (including anonymous/guest links).
-
Extend retention beyond 90 days to meet investigation/compliance needs.
-
Standardize site provisioning so new sites inherit these settings automatically.
Turning noise into signal (PowerShell done right)
-
Query only the events that matter: SharingCreated, SharingSet, AnonymousLinkCreated/Used, AccessRequestApproved.
-
Enrich every row:
• Destination domain classification: corporate/partner/personal (gmail, yahoo, outlook, etc.).
• File sensitivity label and container (site/OneDrive).
• Actor risk context (departing employee, VIP, privileged role). -
Flag by rules, not vibes:
• Sensitive label AND external/personal domain → HIGH.
• Unlabeled to partner allowlist → LOW.
• Many shares in short window by new/guest account → MEDIUM/HIGH (burst). -
Output two artifacts:
• “Action queue” (10–50 rows): only items needing human review.
• “Evidence log” (full, normalized) for BI/SIEM.
Real-time alerts that actually work
-
Replace “alert on all external shares” with layered policies:
• Sensitive label AND external recipient outside allowlist → immediate alert to SecOps.
• Anonymous link created on sensitive file → alert + auto-expire link.
• Unusual volume: N external shares by one user in X minutes → throttle + notify. -
Add cooling and deduplication to prevent alert fatigue.
-
Route alerts to a focused channel/ticket queue with owner, playbook, and rollback link.
Scaling to enterprise
-
Automation spine:
• Azure Automation/Logic Apps schedules: rolling 7-day deltas + monthly backfills.
• Pagination + checkpointing (resume from last cursor; handle 429s).
• Auto-discover new sites/OneDrives; apply audit/labels/alerts on creation. -
Data model:
• Normalize to Users, Sites, Items, Links, Events, SensitivityLabels, Domains.
• Use star schema for BI and incremental refresh on lastModified. -
Health checks:
• Monitor expected event volume; alert if drops (broken pipeline).
• Version-control scripts and detection rules.
Fast wins this week
-
Turn on anonymous link usage logging and extend retention.
-
Build a “personal domains” allow/deny list; flag gmail/outlook/hotmail.
-
Add sensitivity labels to finance/HR libraries; block anonymous by policy.
-
Ship a weekly “Top 10 risky shares” digest with owner + one-click revoke.
-
Create a burst rule: “≥5 external shares in 10 minutes by the same user.”
30-day rollout plan (outline)
-
Week 1: Audit policy hardening, retention, baseline exports, domain allowlist.
-
Week 2: PowerShell enrichment (labels, domains), risk scoring, action queue.
-
Week 3: Real-time alert rules with dedupe/cooldowns; auto-expire risky links.
-
Week 4: Automation at scale (Azure Automation/Logic Apps), BI dashboard, playbooks.
Executive & ops KPIs
-
External exposure velocity: new external links/day (by site/label/domain).
-
Sensitive spill rate: sensitive files shared to non-partner domains.
-
Dwell to revoke: time from risky share to access revoked.
-
Burst anomalies: users exceeding share thresholds.
-
Auto-remediation coverage: % risky links auto-expired/blocked.
Who should watch
-
M365 admins tired of Swiss-cheese audit trails
-
SecOps/Compliance teams who need evidence, not vibes
-
IT leaders scaling collaboration without losing control
Common pitfalls to avoid
-
Relying on default audit and 90-day retention.
-
Export-everything scripts with no enrichment or triage.
-
“Alert on everything” rules that train teams to ignore alerts.
-
Static site lists—always discover dynamically.
-
One-time cleanup with no automation to keep it clean.
Playbooks to keep handy
-
Revoke & notify external: kill link, inform owner, require re-share via partner domain.
-
Departing employee sweep: enumerate their OneDrive shares; auto-revoke personal domains; handoff to manager.
-
VIP watch: tighter thresholds and instant paging for exec content.
Bottom line
See it, score it, stop it—fix audit first, enrich with context, alert smart, and automate everything that scales. That’s how you keep collaboration fast and your data inside the walls.
FAQ
Why don't default audit logs catch risky external sharing?
Default auditing can miss anonymous link creation and use and guest access. If the data is not logged, no script or SIEM can recover it, so fix audit coverage first.
Which tenant settings improve sharing visibility?
Enable enhanced auditing for SharePoint and OneDrive, log link creation and usage including anonymous and guest links, and extend retention beyond 90 days.
Which sharing events should you query with PowerShell?
Query SharingCreated, SharingSet, AnonymousLinkCreated and AnonymousLinkUsed, and AccessRequestApproved. Querying only the events that matter, and enriching each row, turns the raw audit firehose into signal.
How do you make sharing alerts useful?
Combine file sensitivity, destination domain and user behavior into context-rich alerts. This escalates real risk without spamming your inbox, which is how the episode keeps alerting actionable at enterprise scale.
How do you scale external sharing monitoring?
Use pagination, delta windows and automation instead of weekly CSV archaeology, version your scripts, review rules monthly and auto-onboard new sites.
Apple Podcasts · Spotify · YouTube
Host: Mirko Peters
Related articles
Articles on the topics of this episode:
- Why Your Default M365 Audit Logs Are Hiding Dangerous External Sharing
- Microsoft 365 Label-Based Encryption
- Best Ways to Collaborate with SharePoint
- Sentinel Built-In Windows Rules Never Fire on Forwarded Events: WindowsEvent vs SecurityEvent
- Understanding and Defending Against ntds.dit Exploitation
- Navigating Data Sovereignty and Compliance in Azure AI Deployments
- Maximizing ROI and Efficiency with Microsoft Sentinel
- Consolidate and Conquer: Leveraging AI and Security Copilot