Before you run
Data & scope
- Required tables
- Time window
- 24 hours
- Azure Blob resource logs exported in resource-specific mode to StorageBlobLogs, including the categories needed by this hunt.
- Query access and 24 hours of retained Blob logs for each investigated account; Azure Activity alone does not record blob requests.
Documentation review by Codex (AI). No live-tenant execution or detection-performance claim. Validate schema, data coverage and expected results in your workspace.
// Hunting starter. Documentation checked 2026-11-13; not tenant-tested.
StorageBlobLogs
| where TimeGenerated >= ago(1d) and TimeGenerated <= now()
| where AuthenticationType =~ "SAS"
| extend HttpCode = toint(StatusCode),
SafeObjectPath = tostring(split(Uri, "?")[0])
| summarize ObservedRequests = count(),
SuccessfulRequests = countif(HttpCode between (200 .. 299)),
DeniedRequests = countif(HttpCode in (401, 403)),
OtherStatusRequests = countif(isnull(HttpCode)
or (HttpCode !between (200 .. 299) and HttpCode !in (401, 403))),
ExpiryMessages = make_set(SasExpiryStatus, 5),
RequestsWithExpiryMessage = countif(isnotempty(SasExpiryStatus)),
Operations = make_set(OperationName, 10),
ObjectSamples = make_set(SafeObjectPath, 5),
Statuses = make_set(StatusCode, 10),
FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated)
by AccountResource = _ResourceId, AccountName, CallerIpAddress
| order by RequestsWithExpiryMessage desc, SuccessfulRequests desc, LastSeen desc
| take 200
Read-only query. Run in your own authorized workspace after checking prerequisites.
This recipe inventories requests recorded with SAS authentication. It is useful when reviewing delegated storage access, migrating credential patterns or investigating a leaked URL. It does not enumerate all issued SAS tokens: an unused token cannot appear in request telemetry, and one token can produce many request rows.
Preserve the signing distinction
Azure supports user delegation, service and account SAS mechanisms. They do not all have the same signing authority or revocation behavior. A row labelled SAS is not sufficient evidence that the request relied directly on an account key. SAS model.
The filter follows Microsoft’s documented Log Analytics example using AuthenticationType equal to SAS. Inspect your actual resource-log representation before adapting a raw JSON field or a different table with differently formatted labels. Shared Key and SAS query guidance.
The hunt reports available SasExpiryStatus messages. A populated message deserves inspection, but the query does not translate every message into a blocking outcome. Expiration-policy behavior depends on its configuration, and missing messages do not prove a token had an acceptable lifetime. SAS expiration policy.
Avoid redistributing credentials during triage
The query deliberately strips everything after the question mark from sampled request URIs. It does not output AuthenticationHash or other token-related material. Treat even sanitized paths as potentially sensitive metadata.
Do not paste a full SAS URL into a case title, shared document or third-party analysis service. If token-level evidence must be preserved, use your restricted incident-evidence process. Determine the token’s actual type, scope and owner through approved records rather than inferring them solely from the source IP.
Review successful operations, affected paths and expiry messages together. A SAS used by a legitimate ingestion job can still be overbroad or longer-lived than intended. A denied request may reflect expiration, insufficient permissions or network controls without establishing compromise.
Tune and validate
Known batch imports, temporary customer transfers and recovery operations can produce legitimate bursts. Base exceptions on an accountable workflow and bounded scope; an IP address shared by many services is a weak ownership signal.
Validate an approved short-lived SAS request and a harmless rejected request against a nonsensitive object. Check that copied results contain no query-string token and that unknown HTTP statuses remain in the “other” bucket. The 24-hour scan returns up to 200 account/address groups. This documentation-checked hunt has not been executed in a tenant and does not certify token policy compliance or uniquely identify the human using a SAS.
Verify the source
Microsoft references
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 →