← Sentinel query library

Data access · Microsoft Sentinel

Compare OAuth blob-read volume with a seven-day baseline

Identify tenant-qualified OAuth principals whose completed daily GetBlob volume exceeds a fixed historical average, retaining response-byte and object-diversity context.

Before you run

Data & scope

Required tables
StorageBlobLogs
Time window
One completed UTC analysis day with a full-day ingestion buffer and preceding 7-day baseline
  • StorageRead logs in resource-specific StorageBlobLogs with at least nine complete UTC days of continuous account coverage.
  • Query access on an Analytics table plan supporting joins; OAuth requester tenant and object IDs must be populated for the selected rows.

Documentation review by Codex (AI). No live-tenant execution or detection-performance claim. Validate schema, data coverage and expected results in your workspace.

Kusto Query Language
Download .kql
// Hunting starter. Documentation checked 2026-11-13; not tenant-tested.
let analysisEnd = startofday(now()) - 1d;
let analysisStart = analysisEnd - 1d;
let reads = materialize(
    StorageBlobLogs
    | where TimeGenerated >= analysisStart - 7d and TimeGenerated < analysisEnd
    | where OperationName =~ "GetBlob" and AuthenticationType =~ "OAuth"
    | where toint(StatusCode) between (200 .. 299)
    | extend AccountResource = tolower(_ResourceId),
        PrincipalTenant = tolower(RequesterTenantId), PrincipalObject = tolower(RequesterObjectId),
        SafeObjectPath = tostring(split(Uri, "?")[0])
    | where isnotempty(AccountResource) and isnotempty(PrincipalTenant) and isnotempty(PrincipalObject)
    | project TimeGenerated, AccountResource, PrincipalTenant, PrincipalObject,
        ResponseBodySize, SafeObjectPath, CallerIpAddress
);
let baseline = reads
    | where TimeGenerated < analysisStart
    | summarize BaselineRequests = count(), BaselineDaysWithReads = dcount(startofday(TimeGenerated))
        by AccountResource, PrincipalTenant, PrincipalObject
    | extend BaselineDailyMean = toreal(BaselineRequests) / 7.0;
reads
| where TimeGenerated >= analysisStart
| summarize AnalysisRequests = count(), ObservedResponseBytes = sum(ResponseBodySize),
    MissingResponseSizes = countif(isnull(ResponseBodySize)),
    ObjectEstimate = dcount(iff(isnotempty(SafeObjectPath), pack_array(SafeObjectPath), dynamic(null))),
    IpSamples = make_set(CallerIpAddress, 5)
    by AccountResource, PrincipalTenant, PrincipalObject
| join kind=leftouter baseline on AccountResource, PrincipalTenant, PrincipalObject
| extend BaselineState = iff(isnull(BaselineRequests), "No matching historical rows", "Historical rows observed"),
    VolumeRatio = iff(BaselineDailyMean > 0, toreal(AnalysisRequests) / BaselineDailyMean, real(null))
| where AnalysisRequests >= 100 and (isnull(BaselineRequests) or VolumeRatio >= 3.0)
| project AnalysisStart = analysisStart, AnalysisEnd = analysisEnd,
    AccountResource, PrincipalTenant, PrincipalObject, AnalysisRequests,
    BaselineState, BaselineRequests, BaselineDaysWithReads, BaselineDailyMean,
    VolumeRatio, ObservedResponseBytes, MissingResponseSizes, ObjectEstimate, IpSamples
| order by AnalysisRequests desc
| take 200

Read-only query. Run in your own authorized workspace after checking prerequisites.

This hunt compares a completed UTC day of successful OAuth GetBlob requests with the preceding seven days for the same account and tenant-qualified object identity. It returns at least 100 requests where volume is three times the historical daily mean, or where no matching historical rows were observed. These are configurable triage thresholds.

Define the comparison precisely

The analysis day ends at yesterday’s midnight, leaving one full UTC day for delayed records to arrive. That buffer reduces partial-day bias but does not guarantee complete ingestion. The query is intentionally delayed historical analysis, not a near-real-time exfiltration detector.

The baseline mean divides all matching requests by seven calendar days. Days without records contribute implicitly to that average only under the prerequisite that collection was continuous. BaselineDaysWithReads shows activity coverage, not connector uptime. A quiet weekend and a logging outage both reduce observed counts unless investigated separately.

No-baseline results retain a null ratio and an explicit state. They are not assigned an infinite increase or a fabricated historical zero. Blank tenant, object and account identifiers are excluded. Authentication by SAS, account key or anonymous access is outside this query, even if it caused a large transfer. Requester and response fields.

Interpret the output

ObservedResponseBytes measures available service response-body sizes. Retries, ranged downloads and repeated reads can count the same underlying data multiple times. ObjectEstimate is approximate and based on sanitized request paths; neither value is an exact count of unique sensitive information leaving the organization.

Identify the workload owner and compare the analysis day with ingestion rebuilds, backup verification, analytics jobs and model-training preparation. These activities may legitimately read large corpora. Examine whether the accessed paths and destination workflow fit the principal’s approved purpose.

An unauthorized read of one high-value object can fall below every threshold. Keep separate authorization and sensitive-object investigations rather than treating this volume view as comprehensive data-loss coverage.

Tune and validate

Validate against an ordinary day, a known bulk job and a new approved principal. Confirm that baseline and analysis windows do not overlap and that the displayed UTC boundaries match your expected interval. Compare a scoped raw-event count with the summary before scheduling it.

Restrict accounts or principals first in high-volume workspaces. Review the collection categories and export route using the Blob monitoring reference. This documentation-checked query has not run in a tenant. It returns up to 200 principal/account groups, and no returned ratio is proof of malicious intent or complete transfer measurement.

Verify the source

Microsoft references

  1. Microsoft Learn — StorageBlobLogs table ↗
  2. Microsoft Learn — Blob Storage monitoring reference ↗
Before turning a hunt into an alert

Measure normal activity, validate known test cases, account for ingestion delays, choose a threshold and entity mapping, and assign an owner. Results require investigation.

Follow the detection learning path →