T1213

Data from Information Repositories

Adversaries may leverage information repositories to mine valuable information. Information repositories are tools that allow for storage of information, typically to facilitate collaboration or information sharing between users, and can store a wide variety of data that may aid adversaries in further objectives, such as Credential Access, Lateral Movement, or Defense Evasion. Targets include SharePoint, Confluence, code repositories, CRM systems, databases, and messaging platforms such as Slack and Microsoft Teams. Adversaries may harvest credentials, network diagrams, system architecture documentation, PII, or source code from these repositories. Cloud-native services (AWS RDS, ElasticSearch, Redis) may also be improperly secured, enabling unauthenticated access to sensitive data stores.

Microsoft Sentinel / Defender
kusto
// Detect bulk document access / data mining from SharePoint, OneDrive, and Microsoft Teams
let BulkAccessThreshold = 50;
let SensitiveKeywords = dynamic(["password", "credential", "secret", "vpn", "firewall", "network diagram",
  "architecture", "api key", "token", "private key", "ssn", "social security",
  "salary", "payroll", "customer data", "pii", "database", "connection string"]);
let TimeWindow = 1h;
// Branch 1: Bulk file access / download from SharePoint or OneDrive
let BulkAccess =
  OfficeActivity
  | where TimeGenerated > ago(24h)
  | where Workload in ("SharePoint", "OneDrive")
  | where Operation in ("FileDownloaded", "FileSyncDownloadedFull", "FileAccessed", "FilePreviewed", "FileSyncUploadedFull")
  | summarize
      OperationCount = count(),
      UniqueFiles = dcount(OfficeObjectId),
      UniqueExtensions = dcount(tostring(split(OfficeObjectId, ".")[-1])),
      Operations = make_set(Operation, 10),
      SourceIPs = make_set(ClientIP, 10),
      SiteUrls = make_set(Site_Url, 10),
      EarliestAccess = min(TimeGenerated),
      LatestAccess = max(TimeGenerated)
      by UserId, bin(TimeGenerated, TimeWindow)
  | where OperationCount >= BulkAccessThreshold
  | extend AccessDurationMinutes = datetime_diff('minute', LatestAccess, EarliestAccess)
  | extend FilesPerMinute = iff(AccessDurationMinutes > 0, toreal(UniqueFiles) / toreal(AccessDurationMinutes), toreal(UniqueFiles))
  | extend DetectionType = "BulkFileAccess"
  | project TimeGenerated, UserId, DetectionType, OperationCount, UniqueFiles, FilesPerMinute, Operations, SourceIPs, SiteUrls;
// Branch 2: Sensitive keyword searches in SharePoint
let SensitiveSearch =
  OfficeActivity
  | where TimeGenerated > ago(24h)
  | where Workload == "SharePoint"
  | where Operation == "SearchQueryPerformed"
  | where tolower(tostring(SearchQuery)) has_any (SensitiveKeywords)
  | summarize
      SearchCount = count(),
      UniqueQueries = dcount(SearchQuery),
      QuerySamples = make_set(SearchQuery, 5),
      SourceIPs = make_set(ClientIP, 5)
      by UserId, bin(TimeGenerated, TimeWindow)
  | extend DetectionType = "SensitiveKeywordSearch"
  | extend OperationCount = SearchCount
  | project TimeGenerated, UserId, DetectionType, OperationCount, UniqueQueries, QuerySamples, SourceIPs;
// Branch 3: External sharing of documents from SharePoint/OneDrive
let ExternalSharing =
  OfficeActivity
  | where TimeGenerated > ago(24h)
  | where Workload in ("SharePoint", "OneDrive")
  | where Operation in ("SharingInvitationCreated", "AnonymousLinkCreated", "SecureLinkCreated", "AddedToSecureLink")
  | extend IsExternalShare = ExternalAccess == true or Operation == "AnonymousLinkCreated"
  | where IsExternalShare == true
  | summarize
      ShareCount = count(),
      UniqueFiles = dcount(OfficeObjectId),
      TargetAccounts = make_set(TargetUserOrGroupName, 10),
      SiteUrls = make_set(Site_Url, 5)
      by UserId, bin(TimeGenerated, TimeWindow)
  | where ShareCount >= 5
  | extend DetectionType = "BulkExternalSharing"
  | extend OperationCount = ShareCount
  | project TimeGenerated, UserId, DetectionType, OperationCount, UniqueFiles, TargetAccounts, SiteUrls;
// Union all branches
BulkAccess
| union SensitiveSearch
| union ExternalSharing
| sort by OperationCount desc
high severity medium confidence

Data Sources

Application Log: Application Log Content Cloud Service: Cloud Service Enumeration Microsoft 365 Unified Audit Log SharePoint Audit Logs OneDrive Audit Logs

Required Tables

OfficeActivity

False Positives

  • Migration projects — IT teams or contractors using tools like ShareGate or AvePoint to migrate SharePoint content generate extremely high file access counts
  • Backup and archival solutions — tools like Veeam, AvePoint Backup, or native SharePoint backup solutions download all files regularly
  • Legitimate enterprise search indexing — search crawlers or content indexing services authorized by IT generate bulk FileAccessed events
  • Legal eDiscovery — compliance officers performing court-ordered or internal investigation eDiscovery searches may access large volumes of documents and use sensitive keywords
  • Data loss prevention (DLP) scanning tools — DLP platforms that scan SharePoint for sensitive content will trigger both bulk access and sensitive keyword detections

Unlock Pro Content

Get the full detection package for T1213 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections