← Sentinel query library

Data access · Microsoft Sentinel

Find successful Key Vault callers absent from a prior baseline

Compare tenant-qualified object identities accessing each vault with seven preceding days, keeping client applications and operation samples for investigation.

Before you run

Data & scope

Required tables
AZKVAuditLogs
Time window
24-hour investigation window plus preceding 7 days
  • Resource-specific Key Vault AuditEvent logs in AZKVAuditLogs, with eight days of continuous coverage for each investigated vault.
  • Query access on an Analytics table plan supporting the join; verify the tenant and object-ID claims in your actual Identity payloads.

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 investigationStart = ago(1d);
let accesses = materialize(
    AZKVAuditLogs
    | where TimeGenerated >= investigationStart - 7d and TimeGenerated <= now()
    | where HttpStatusCode between (200 .. 299)
    | extend CallerObjectId = tolower(coalesce(tostring(Identity.claim.oid),
            tostring(Identity.claim["http://schemas.microsoft.com/identity/claims/objectidentifier"]))),
        CallerTenantId = tolower(coalesce(tostring(Identity.claim.tid),
            tostring(Identity.claim["http://schemas.microsoft.com/identity/claims/tenantid"]))),
        ClientAppId = tostring(Identity.claim.appid), VaultResource = tolower(_ResourceId)
    | where isnotempty(CallerObjectId) and isnotempty(CallerTenantId) and isnotempty(VaultResource)
    | project TimeGenerated, VaultResource, CallerTenantId, CallerObjectId,
        ClientAppId, OperationName, CallerIpAddress, CorrelationId
);
let prior = accesses
    | where TimeGenerated < investigationStart
    | summarize PriorRows = count() by VaultResource, CallerTenantId, CallerObjectId;
accesses
| where TimeGenerated >= investigationStart
| summarize RecentRequests = count(), FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated),
    Operations = make_set(OperationName, 10), Applications = make_set(ClientAppId, 5),
    IpSamples = make_set(CallerIpAddress, 5), CorrelationSamples = make_set(CorrelationId, 5)
    by VaultResource, CallerTenantId, CallerObjectId
| join kind=leftouter prior on VaultResource, CallerTenantId, CallerObjectId
| where isnull(PriorRows)
| extend BaselineFinding = "Principal absent from available prior 7-day successful requests"
| project FirstSeen, LastSeen, VaultResource, CallerTenantId, CallerObjectId,
    BaselineFinding, RecentRequests, Operations, Applications, IpSamples, CorrelationSamples
| order by RecentRequests desc, LastSeen desc
| take 200

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

This hunt highlights successful vault callers whose tenant-qualified object identity was absent from the preceding seven days of successful requests to the same vault. It is useful during workload onboarding reviews and investigations of newly exercised access. The result is an observation about retained telemetry, not proof that the identity is new or newly authorized.

Keep identity and resource boundaries explicit

The comparison key contains vault resource ID, tenant ID and object ID. It does not use a display name or shared network address as the identity join. The query attempts short and URI-form claims in the dynamic Identity payload; inspect your events to confirm those shapes. Records missing any required identity key are excluded and require a separate completeness review. Audit schema.

Client application IDs remain context. A delegated user can appear through multiple clients, and the same application registration can have different service-principal objects in different tenants. This view is deliberately about the object principal, so a new client application for an already observed principal may not be returned.

The historical and investigation windows do not overlap. Only successful requests establish prior observation. A principal with earlier failures followed by its first observed success is therefore eligible, even if the identity itself is familiar.

Investigate why access appeared

Resolve the object and its owner, then inspect which operation succeeded. New SecretGet activity and a routine metadata operation have different implications. Confirm that the workload was expected to use that vault and that the granted authority fits its purpose.

Review recent role assignments, access-policy changes, identity federation settings and deployment history. The query does not establish which permission granted a request or whether any credential changed. Use the operation and correlation samples to retrieve the complete event sequence before drawing that connection.

The seven-day baseline can miss monthly jobs, newly enabled logging and quiet disaster-recovery identities. A vault receiving records today may still have an incomplete historical export. Validate retention and collection independently. Key Vault logging.

Tune and validate

Test an established caller, a newly approved caller and an event with missing tenant claims. Confirm that a caller already observed in one vault still appears when first seen in another. Check that missing identities are not accidentally combined into a single “new” principal.

Longer baselines increase scan and retention requirements. Scope by vault before scaling this into a scheduled workflow. The output is capped at 200 pairs, and samples are not complete inventories. This recipe is documentation-checked and has not been run in a tenant; first observation alone is not malicious activity.

Verify the source

Microsoft references

  1. Microsoft Learn — AZKVAuditLogs table ↗
  2. Microsoft Learn — Key Vault logging ↗
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 →