M365 SharePoint Search for Sensitive Content

Last updated 3 days ago on 2026-02-24
Created 3 days ago on 2026-02-24

About

Identifies search queries in SharePoint containing sensitive terms related to credentials, financial data, PII, legal matters, or infrastructure information. Adversaries who compromise user accounts often search for high-value files before exfiltration. This rule detects searches containing terms across multiple sensitivity categories, regardless of the access method (browser, PowerShell, or API). The actual search query text is analyzed against a curated list of sensitive terms to identify potential reconnaissance activity.
Tags
Domain: CloudDomain: SaaSData Source: Microsoft 365Data Source: Microsoft 365 Audit LogsUse Case: Threat DetectionTactic: DiscoveryTactic: CollectionLanguage: eql
Severity
low
Risk Score
21
MITRE ATT&CK™

Discovery (TA0007)(external, opens in a new tab or window)

Collection (TA0009)(external, opens in a new tab or window)

False Positive Examples
Security or compliance teams using eDiscovery or Content Search for legitimate investigations.HR or finance personnel legitimately searching for employee or financial records.IT administrators searching for configuration or infrastructure documentation.Legal teams searching for contract or privileged documents.
License
Elastic License v2(external, opens in a new tab or window)

Definition

Rule Type
Event Correlation Rule
Integration Pack
Prebuilt Security Detection Rules
Index Patterns
filebeat-*logs-o365.audit-*
Related Integrations

o365(external, opens in a new tab or window)

Query
text code block:
web where event.dataset == "o365.audit" and event.provider == "SharePoint" and event.action == "SearchQueryPerformed" and event.outcome == "success" and o365.audit.SearchQueryText != null and o365.audit.SearchQueryText != "" and o365.audit.SearchQueryText like~ ( /* Credentials and Secrets */ "*password*", "*credential*", "*secret*", "*api key*", "*apikey*", "*token*", "*private key*", "*certificate*", "*ssh*", "*aws*", "*azure*", "*gcp*", "*oauth*", "*bearer*", "*connection string*", "*access key*", "*secret key*", /* Financial */ "*salary*", "*payroll*", "*compensation*", "*budget*", "*revenue*", "*financial*", "*banking*", "*invoice*", "*wire transfer*", "*account number*", "*credit card*", "*routing number*", "*profit*", "*expense*", "*1099*", /* Legal and Compliance */ "*confidential*", "*privileged*", "*attorney*", "*legal hold*", "*settlement*", "*contract*", "*nda*", "*merger*", "*acquisition*", "*litigation*", "*subpoena*", "*trade secret*", "*intellectual property*", "*proprietary*", "*internal*", "*proposal*", "*poc*", /* HR and PII */ "*ssn*", "*social security*", "*employee*", "*personnel*", "*performance review*", "*termination*", "*tax*", "*w2*", "*benefits*", "*background check*", "*medical*", "*hipaa*", "*passport*", "*driver license*", "*dob*", /* Infrastructure and IT */ "*admin*", "*root*", "*vpn*", "*firewall*", "*network diagram*", "*architecture*", "*topology*", "*production*", "*database*", "*config*", "*backup*", "*disaster recovery*", "*vulnerability*", "*pentest*", "*security audit*", "*salesforce*" )

Install detection rules in Elastic Security

Detect M365 SharePoint Search for Sensitive Content in the Elastic Security detection engine by installing this rule into your Elastic Stack.

To setup this rule, check out the installation guide for Prebuilt Security Detection Rules(external, opens in a new tab or window).