← Sentinel query library

Identity · Microsoft Sentinel

Inventory successful cross-tenant sign-in relationships

Keep home and resource tenant identifiers alongside the recorded cross-tenant access type when reviewing external access.

Before you run

Data & scope

Required tables
SigninLogs
Time window
7 days
  • Microsoft Entra ID connector with SigninLogs available for seven days.
  • Microsoft Entra ID P1 or P2 for ingestion and access to relevant cross-tenant sign-in evidence.

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.
SigninLogs
| where TimeGenerated >= ago(7d) and TimeGenerated <= now()
| where ResultType == "0"
| where (isnotempty(CrossTenantAccessType) and CrossTenantAccessType !~ "none")
    or (isnotempty(HomeTenantId) and isnotempty(ResourceTenantId)
        and HomeTenantId != ResourceTenantId)
| extend AccessType = iff(isempty(CrossTenantAccessType),
    "Not reported; tenant IDs differ", CrossTenantAccessType)
| summarize SignInRows = count(), Users = dcount(UserId),
    FirstSeen = min(TimeGenerated), LastSeen = max(TimeGenerated),
    UserSamples = make_set(UserPrincipalName, 10), SignInSamples = make_set(Id, 10)
    by AADTenantId, HomeTenantId, ResourceTenantId, AccessType,
        AppId, AppDisplayName, ResourceDisplayName, IsInteractive
| order by SignInRows desc
| take 200

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

Use this inventory to map observed successful sign-ins that cross a directory boundary. It can support a review of external collaborators, service-provider relationships and access to AI-related administrative applications. The output is a relationship map from collected sign-in evidence, not an authorization inventory.

Preserve the different tenant roles

AADTenantId identifies the directory associated with the log. HomeTenantId and ResourceTenantId describe different sides of a cross-tenant event. Keeping all three prevents a workspace identifier or display name from becoming an assumed security boundary.

The filter includes an explicit non-none access type or a pair of populated, different home and resource tenant IDs. Rows with missing identifiers remain visible when their access type indicates a cross-tenant case. The label Not reported; tenant IDs differ explains why an otherwise unclassified row was selected.

Microsoft documents several access types, including collaboration, direct connection, service-provider and support scenarios. These have different operational meanings. Treat the recorded type as a clue to the relationship and inspect the original event before applying a single guest-access explanation to every group. Sign-in activity details.

Review the relationship

Resolve each home/resource pair to an approved business relationship and owner. Compare observed applications with the intended collaboration scope, inbound and outbound settings, and any trust accepted from the partner. The cross-tenant access overview explains the relevant configuration boundaries.

An unfamiliar relationship can be legitimate onboarding or an administrator’s support workflow. A familiar partner can still be involved in compromised activity. Validate the user and application, authentication evidence and resource-side activity independently. Successful token issuance does not show which documents or API operations were actually accessed.

Validate completeness

Test a known external collaboration, an ordinary same-tenant sign-in and an event with a missing access type but different tenant identifiers. The first and third should appear; the same-tenant none case should not. Review noninteractive collection separately where needed.

Users is approximate and cannot be added across groups without double counting. The displayed names and IDs are samples, with at most 200 aggregate groups. This documentation-checked hunt has not been executed in a tenant. It cannot prove the absence of external access when collection is incomplete, and it does not enumerate standing permissions that were unused during the seven-day window.

Verify the source

Microsoft references

  1. Microsoft Learn — SigninLogs table schema ↗
  2. Microsoft Learn — Sign-in activity details ↗
  3. Microsoft Learn — Cross-tenant access overview ↗
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 →