Before you run
Data & scope
- Required tables
- Time window
- 7 days
- Microsoft Entra ID connector with AuditLogs available for 7 days and permission to inspect audit payloads.
- Any Microsoft Entra ID license supports audit ingestion; workspace query permissions and relevant administration evidence are required.
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.
AuditLogs
| where TimeGenerated >= ago(7d) and TimeGenerated <= now()
| extend AuditOperation = coalesce(ActivityDisplayName, OperationName)
| where AuditOperation in~ ("Add Conditional Access policy",
"Update Conditional Access policy", "Delete Conditional Access policy")
| where Result =~ "success"
| extend ActorObjectId = coalesce(tostring(InitiatedBy.user.id),
tostring(InitiatedBy.app.servicePrincipalId)),
ActorName = coalesce(tostring(InitiatedBy.user.userPrincipalName),
tostring(InitiatedBy.app.displayName)),
ActorIP = coalesce(tostring(InitiatedBy.user.ipAddress), tostring(InitiatedBy.app.ipAddress))
| project TimeGenerated, AADTenantId, AuditId = Id, AuditOperation, ActorObjectId,
ActorName, ActorIP, TargetResources, AdditionalDetails, CorrelationId
| order by TimeGenerated desc
| take 200
Read-only query. Run in your own authorized workspace after checking prerequisites.
A successful Conditional Access write is a signal to review the policy change, not proof that access became weaker. This query collects successful creation, update and deletion events over seven days. It helps connect an unexpected sign-in outcome with the configuration changes that preceded it.
Preserve the policy evidence
The explicit operation names come from the audit activity catalog. Named-location changes, authentication-context changes and security-defaults changes are separate activities and are not included. If one of those dependencies is relevant, investigate it explicitly rather than claiming this query covers all access-policy configuration.
TargetResources and AdditionalDetails retain the original policy change evidence. The query avoids a fixed JSON path for enablement, exclusions or grant controls because the generic audit contract does not guarantee one layout for every operation. Parse a validated sample before automating a before/after comparison. Target-resource contract.
Resolve the initiating actor and target policy by IDs. A deployment service can be the actor for an approved human change; a familiar service identity can also make an unauthorized change. The audit result alone does not establish approval.
Decide what changed in effective access
Compare the recorded old/new values with the reviewed configuration. Pay attention to targeted resources and users, exclusions, policy state, grant requirements and session controls. Evaluate a change in the context of the whole applicable policy set. Deleting a redundant policy may leave effective protection unchanged, while a small exclusion can materially alter a sensitive population.
Use representative sign-in evidence and the Conditional Access troubleshooting workflow to test the resulting behavior. Preserve the event-time configuration because the currently displayed policy may already have changed again.
Validate and avoid false certainty
Exercise a benign add, edit and delete in an approved test environment. Check that all three appear with the expected actor and target evidence. Review a failed modification separately; it should not appear in this successful-change view.
Scheduled deployments, emergency recovery and planned policy migrations are common explanations. Keep exceptions tied to a specific change window and expected policy, rather than suppressing all automation. This documentation-checked hunt has not been executed in a tenant. Its latest-200-row cap and seven-day range are investigation boundaries, not a guarantee that no other policy dependency changed.
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 →