Before you run
Data & scope
- Required tables
- Time window
- 7 days
- Microsoft Entra ID connector with AuditLogs collected throughout the stated lookback and access to audit payloads.
- Any Microsoft Entra ID license supports audit ingestion; workspace query permissions and appropriate directory evidence access 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 owner to application", "Remove owner from application")
| 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.
An application registration owner change can alter who manages an application’s configuration and credentials. This hunt shows successful additions and removals of owners on application objects. It supports reviews of the administrative chain behind an AI application, deployment pipeline or connector.
Identify the object before judging the change
An application registration and its enterprise application service principal are distinct directory objects. They can have different owners and object IDs. This query selects the application-specific audit operations; use the separate service-principal ownership hunt for local enterprise application changes. Object model.
The full target payload remains visible because ownership events can describe both the owned application and the owner relationship. The query does not assume that TargetResources element zero is always the application, or that the initiating actor is the newly added owner. Resolve the relationship from the actual event and confirm it against current directory metadata.
Addition and removal are both included. Removing an obsolete owner can be approved maintenance, while removing a recovery owner can undermine oversight. The successful result only establishes the logged operation outcome, not whether the change followed the correct approval process.
Review administrative authority
Compare the event with a change request and the application’s ownership register. Resolve the actor and affected owner identities, then inspect the application’s sensitivity, credentials and permissions. A legitimate handover, team reorganization or automated onboarding process can explain a change.
If the relationship is unexpected, determine whether the owner subsequently changed credentials, redirect settings or other application configuration. Keep event-time evidence separate from current state; a later rollback can remove the visible owner without erasing its earlier influence. Microsoft’s application security operations guidance includes ownership among changes worth monitoring.
Validate the interpretation
Test a known owner addition and removal in an approved test application. Confirm that the actor, application and affected owner can be distinguished from the raw target evidence. Verify that a service-principal ownership change does not appear here.
This query presents the latest 200 records from seven days and does not calculate current ownership, effective permissions or the consequences of a grant. It is documentation-checked and has not been executed in a tenant. Review automation and delegated administration context before labelling an ownership change as persistence or initiating containment.
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 →