Before you run
Data & scope
- Required tables
- Time window
- 24 hours
- Azure Activity export from the relevant subscriptions to AzureActivity in this workspace.
- Query access and at least 24 hours of retained Administrative activity; portal Activity Log alone does not populate this table.
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.
AzureActivity
| where TimeGenerated >= ago(1d) and TimeGenerated <= now()
| where CategoryValue =~ "Administrative"
| where OperationNameValue in~ (
"Microsoft.KeyVault/vaults/write",
"Microsoft.KeyVault/vaults/delete",
"Microsoft.KeyVault/vaults/accessPolicies/write")
| extend ChangeFamily = case(
OperationNameValue endswith "/accessPolicies/write", "Access-policy mutation",
OperationNameValue endswith "/delete", "Vault deletion", "Vault create or update")
| project TimeGenerated, ChangeFamily, OperationNameValue,
ActivityStatusValue, ActivitySubstatusValue,
SubscriptionId, ResourceGroup, ResourceId = coalesce(_ResourceId, ResourceId),
Caller, CallerIpAddress, EventDataId, OperationId, CorrelationId
| order by TimeGenerated desc
| take 200
Read-only query. Run in your own authorized workspace after checking prerequisites.
This inventory supports investigation of the control objects around secrets and cryptographic keys. It selects vault creation or update, vault deletion, and access-policy mutation operations. It does not read secrets or retrieve cryptographic material. The action names and their management meaning come from Microsoft’s security resource permissions reference.
Separate configuration from data access
A generic vault write does not prove which setting changed. The event may reflect a harmless tag update, a networking adjustment, an access-control-model change or a new resource. Recover the approved previous configuration and compare it with the effective current configuration rather than deriving a conclusion from the verb alone.
Access-policy changes are only one authorization path. A vault using Azure RBAC requires separate investigation of role assignments at applicable scopes. An empty access-policy result therefore does not establish unchanged access. Likewise, credential changes to an already authorized workload can affect practical access without any vault configuration mutation.
Secret retrieval, key use and object deletion require data-plane audit evidence. Use the resource-specific Key Vault hunts to examine those actions, and correlate only with verified identity and resource context. Key Vault logging.
Investigate the control decision
Determine the vault’s business role: model credentials, signing keys, ingestion secrets or connector configuration may have different operational consequences. Check the initiating caller, deployment record and intended change scope. Inspect network restrictions, authorization configuration, recovery settings and logging destinations where relevant to the actual configuration difference.
Keep failed and intermediate events visible. A failed write can explain a broken deployment without establishing that the requested permissions became effective. Confirm the final service state and preserve the relevant event, operation and correlation IDs.
If the concern is unauthorized secret access after a configuration change, construct a separate bounded timeline from the change through relevant successful data operations. A shared source IP or close timestamp alone is not proof that the same principal benefited from the change.
Tune and validate
Routine deployment tools often rewrite complete vault definitions. Certificate lifecycle work, networking migrations and approved authorization-model changes are also plausible explanations. Tune around verified configuration differences and accountable ownership rather than suppressing all writes by a deployment principal.
Validate a benign update, an access-policy change and a failed operation from historical records. Ensure the labels and outcomes remain accurate, and confirm that RBAC-only changes are understood as outside this query’s explicit list. It scans 24 hours, returns at most 200 rows, and has been documentation-checked without live-tenant execution.
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 →