Service Principal Sign-in Logs

OperationNameDescriptionSampleRule
anyAny record in this table with no specific result or signal bucket filter. Every record carries OperationName = "Sign-in activity"; detections pivot on field values, not a per-action discriminator.YY
SuccessRecord with ResultType 0: the service principal's client-secret or certificate sign-in completed successfully.YY
Blocked-by-CARecord with ResultType 53003 (or one of the further Conditional-Access-related block codes 53000, 53001, 53002, 50131, 50158, 50097): a Conditional Access policy returned a block decision for the service principal's sign-in. Code 50158 (external security challenge not satisfied) can accompany either a passed or a failed challenge, so on its own it is not conclusive of a block.NN
OtherRecord whose ResultType is not 0 or a Conditional-Access block code. The table's own column doc describes ResultType as Success-or-Failure; this bucket holds every other failure code, for example a credential mismatch or an unregistered application.YN
Target applicationRecord carrying AppId or ResourceDisplayName: the application identifier and the resource the service principal signed into.YY
Conditional Access statusRecord carrying ConditionalAccessStatus: the status of every Conditional Access policy related to the service principal's sign-in.YN

any: Sign-in record (AADServicePrincipalSignInLogs, any result)

#

Description

Any record in this table with no specific result or signal bucket filter. Every record carries OperationName = "Sign-in activity"; detections pivot on field values, not a per-action discriminator.

Example Sign-in Log Entry #

{
  "AADTenantId": "11111111-1111-1111-1111-111111111111",
  "Agent": {
    "agentType": "notAgentic",
    "agentSubjectType": "notAgentic"
  },
  "AppId": "7a5f4796-9012-4dad-a525-8427af2d12c5",
  "AppOwnerTenantId": "11111111-1111-1111-1111-111111111111",
  "AuthenticationContextClassReferences": [],
  "AuthenticationProcessingDetails": [
    {
      "key": "Legacy TLS (TLS 1.0, 1.1, 3DES)",
      "value": "False"
    },
    {
      "key": "Is Legacy Store Used",
      "value": "False"
    },
    {
      "key": "Is CAE Token",
      "value": "True"
    }
  ],
  "AutonomousSystemNumber": "64512",
  "Category": "ServicePrincipalSignInLogs",
  "ClientCredentialType": "clientSecret",
  "ConditionalAccessAudiences": [
    "00000002-0000-0ff1-ce00-000000000000",
    "00000003-0000-0ff1-ce00-000000000000"
  ],
  "ConditionalAccessPolicies": [],
  "ConditionalAccessPoliciesV2": "None",
  "ConditionalAccessStatus": "notApplied",
  "CorrelationId": "61f7354f-eb55-447b-816e-0f63a758cb61",
  "CreatedDateTime": "2026-07-25T16:06:55.4060019Z",
  "DurationMs": "0",
  "IPAddress": "203.0.113.10",
  "Id": "ed6df4b6-e2e8-4cc0-8fe6-5ed5bffc2100",
  "Location": "US",
  "LocationDetails": {
    "city": "Redacted",
    "state": "Redacted",
    "countryOrRegion": "US",
    "geoCoordinates": {
      "latitude": 0.0,
      "longitude": 0.0
    }
  },
  "OperationName": "Sign-in activity",
  "OperationVersion": "1.0",
  "ResourceDisplayName": "Microsoft Graph",
  "ResourceGroup": "Microsoft.aadiam",
  "ResourceIdentity": "00000003-0000-0000-c000-000000000000",
  "ResourceOwnerTenantId": "f8cdef31-a31e-4b4a-93e4-5f571e91255a",
  "ResourceServicePrincipalId": "2e5ab30e-ae89-43c2-b130-0022f3d655a7",
  "ResultSignature": "SUCCESS",
  "ResultType": "0",
  "ServicePrincipalCredentialKeyId": "3de57a95-5b1d-40af-9546-726a60205eb7",
  "ServicePrincipalId": "6950b93f-27e9-4954-9263-b76d82cbac76",
  "ServicePrincipalName": "dwh-ah-collector",
  "SessionId": "006ea83a-e365-c0f1-726a-097bd4be7dda",
  "UniqueTokenIdentifier": "tvRt7ejiwEyP5l7Vv_whAA",
  "UserAgent": "python-requests/2.34.2"
}

Common Indicators #

Field/value combinations most frequently checked by detection rules targeting this event, derived from cross-vendor predicate analysis.

FieldKindValueRulesVendors
event.outcome (elastic rule field)eqsuccess16 ruleselastic
azure_ad::user_type (elastic rule field)eqmember10 ruleselastic
EventType (elastic rule field)eqsign-in activity7 ruleselastic
azure_ad::app_id (elastic rule field)eq29d9ed98-a469-4536-ade2-f981bc1d605e5 ruleselastic
azure_ad::resource_id (elastic rule field)eq00000002-0000-0000-c000-0000000000003 ruleselastic
azure_ad::resource_id (elastic rule field)in00000003-0000-0000-c000-0000000000004 ruleselastic
security_result.action (Chronicle)eqALLOW4 ruleschronicle
azure_ad::authentication_protocol (elastic rule field)eqdevicecode3 ruleselastic
azure_ad::authentication_requirement (elastic rule field)eqsinglefactorauthentication3 ruleselastic
azure_ad::user_principal_name (elastic rule field)is_not_null3 ruleselastic
azure.activitylogs.properties.authentication_protocol (elastic rule field)eqdevicecode2 ruleselastic
azure.signinlogs.identity (elastic rule field)is_not_null2 ruleselastic
azure.signinlogs.properties.authentication_details.authentication_method (elastic rule field)eqpassword2 ruleselastic
azure.signinlogs.properties.original_transfer_method (elastic rule field)eqdevicecodeflow2 ruleselastic
azure.signinlogs.properties.token_issuer_type (elastic rule field)eqazuread2 ruleselastic

Detection Rules #

Full rule details for this event, including ATT&CK technique mappings and native queries →

Elastic #

  • M365 or Entra ID Identity Sign-in from a Suspicious Source source high: This rule correlate Entra-ID or Microsoft 365 mail successful sign-in events with network security alerts by source address. Adversaries may trigger some network security alerts such as reputation or other anomalies before accessing cloud resources.T1078
  • Entra ID Sharepoint or OneDrive Accessed by Unusual Client source medium: Identifies when an application accesses SharePoint Online or OneDrive for Business for the first time in the tenant within a specified timeframe. This detects successful OAuth phishing campaigns, illicit consent grants, or compromised third-party applications gaining initial access to file storage. Adversaries often use malicious OAuth applications or phishing techniques to gain consent from users, allowing persistent access to organizational data repositories without traditional credential theft.T1078, T1078.004, T1098, T1098.001, T1213, T1213.002
  • Entra ID OAuth Device Code Flow with Concurrent Sign-ins source high: Identifies Entra ID device code authentication flows where multiple user agents are observed within the same session. This pattern is indicative of device code phishing, where an attacker's polling client (e.g., Python script) and the victim's browser both appear in the same authentication session. In legitimate device code flows, the user authenticates via browser while the requesting application polls for tokens - when these have distinctly different user agents (e.g., Python Requests vs Chrome), it may indicate the code was phished and redeemed by an attacker.T1078, T1078.004, T1528, T1566, T1566.002

Splunk #

Kusto #

YARA-L #

Panther #

  • Azure Device Code Authentication with Broker Client source medium: Detects device code authentication using the Microsoft Broker Client application, which may indicate Primary Refresh Token (PRT) abuse. Device code flow allows adversaries to trick users into entering codes on attacker-controlled applications. When combined with Microsoft Broker Client (app ID 29d9ed98-a469-4536-ade2-f981bc1d605e), this may indicate PRT theft or replay attacks that bypass MFA and Conditional Access policies.T1078, T1078.004, T1550, T1550.001, T1566, T1566.002
  • Azure Excessive Account Lockouts source high: Detects high volumes of failed Microsoft Entra ID sign-in attempts resulting in account lockouts, indicating potential brute-force credential attacks such as password spraying, password guessing, or credential stuffing. When adversaries repeatedly attempt authentication with incorrect credentials, Entra ID Smart Lockout policies trigger account lockouts (error code 50053).T1110, T1110.001, T1110.003, T1110.004
  • Azure Many Failed SignIns source medium: This detection looks for a number of failed sign-ins for the same ServicePrincipalName or UserPrincipalNameT1078, T1110

Success: Successful sign-in

#

Description

Record with ResultType 0: the service principal's client-secret or certificate sign-in completed successfully.

Example Sign-in Log Entry #

{
  "AADTenantId": "11111111-1111-1111-1111-111111111111",
  "Agent": {
    "agentType": "notAgentic",
    "agentSubjectType": "notAgentic"
  },
  "AppId": "7a5f4796-9012-4dad-a525-8427af2d12c5",
  "AppOwnerTenantId": "11111111-1111-1111-1111-111111111111",
  "AuthenticationContextClassReferences": [],
  "AuthenticationProcessingDetails": [
    {
      "key": "Legacy TLS (TLS 1.0, 1.1, 3DES)",
      "value": "False"
    },
    {
      "key": "Is Legacy Store Used",
      "value": "False"
    },
    {
      "key": "Is CAE Token",
      "value": "True"
    }
  ],
  "AutonomousSystemNumber": "64512",
  "Category": "ServicePrincipalSignInLogs",
  "ClientCredentialType": "clientSecret",
  "ConditionalAccessAudiences": [
    "00000002-0000-0ff1-ce00-000000000000",
    "00000003-0000-0ff1-ce00-000000000000"
  ],
  "ConditionalAccessPolicies": [],
  "ConditionalAccessPoliciesV2": "None",
  "ConditionalAccessStatus": "notApplied",
  "CorrelationId": "61f7354f-eb55-447b-816e-0f63a758cb61",
  "CreatedDateTime": "2026-07-25T16:06:55.4060019Z",
  "DurationMs": "0",
  "IPAddress": "203.0.113.10",
  "Id": "ed6df4b6-e2e8-4cc0-8fe6-5ed5bffc2100",
  "Location": "US",
  "LocationDetails": {
    "city": "Redacted",
    "state": "Redacted",
    "countryOrRegion": "US",
    "geoCoordinates": {
      "latitude": 0.0,
      "longitude": 0.0
    }
  },
  "OperationName": "Sign-in activity",
  "OperationVersion": "1.0",
  "ResourceDisplayName": "Microsoft Graph",
  "ResourceGroup": "Microsoft.aadiam",
  "ResourceIdentity": "00000003-0000-0000-c000-000000000000",
  "ResourceOwnerTenantId": "f8cdef31-a31e-4b4a-93e4-5f571e91255a",
  "ResourceServicePrincipalId": "2e5ab30e-ae89-43c2-b130-0022f3d655a7",
  "ResultSignature": "SUCCESS",
  "ResultType": "0",
  "ServicePrincipalCredentialKeyId": "3de57a95-5b1d-40af-9546-726a60205eb7",
  "ServicePrincipalId": "6950b93f-27e9-4954-9263-b76d82cbac76",
  "ServicePrincipalName": "dwh-ah-collector",
  "SessionId": "006ea83a-e365-c0f1-726a-097bd4be7dda",
  "UniqueTokenIdentifier": "tvRt7ejiwEyP5l7Vv_whAA",
  "UserAgent": "python-requests/2.34.2"
}

Common Indicators #

Field/value combinations most frequently checked by detection rules targeting this event, derived from cross-vendor predicate analysis.

FieldKindValueRulesVendors
azure_ad::result_type (elastic rule field)eq02 ruleselastic
azure_ad::signin_category (elastic rule field)eqserviceprincipalsigninlogs1 ruleelastic

Detection Rules #

Full rule details for this event, including ATT&CK technique mappings and native queries →

Elastic #

  • Azure Service Principal Sign-In Followed by Arc Cluster Credential Access source medium: Detects when a service principal authenticates to Microsoft Entra ID and then lists credentials for an Azure Arc-connected Kubernetes cluster within a short time window. The listClusterUserCredential action retrieves tokens that enable kubectl access through the Arc Cluster Connect proxy. This sequence (service principal sign-in followed by Arc credential retrieval), represents the exact attack chain used by adversaries with stolen service principal secrets to establish a proxy tunnel into Kubernetes clusters. Service principals that authenticate externally (as opposed to managed identities) and immediately access Arc cluster credentials warrant investigation, particularly when the sign-in originates from an unexpected location or ASN.T1078, T1078.004, T1528, T1552, T1552.007
  • Entra ID Service Principal with Unusual Source ASN source medium: Identifies Entra ID service principal sign-ins where the workload identity and source autonomous system number (ASN) together have not appeared in recent history. Attackers who obtain application secrets or tokens often authenticate from unfamiliar hosting providers, residential or VPN egress, or networks outside normal automation footprints, which can precede data access, lateral movement, or ransomware activity in the tenant. The detection emphasizes first-seen network context for non-interactive workload identities.T1078, T1078.004

Blocked-by-CA: Sign-in blocked by Conditional Access

#

Description

Record with ResultType 53003 (or one of the further Conditional-Access-related block codes 53000, 53001, 53002, 50131, 50158, 50097): a Conditional Access policy returned a block decision for the service principal's sign-in. Code 50158 (external security challenge not satisfied) can accompany either a passed or a failed challenge, so on its own it is not conclusive of a block.

Other: Sign-in with another recorded result

#

Description

Record whose ResultType is not 0 or a Conditional-Access block code. The table's own column doc describes ResultType as Success-or-Failure; this bucket holds every other failure code, for example a credential mismatch or an unregistered application.

Example Sign-in Log Entry #

{
  "AADTenantId": "11111111-1111-1111-1111-111111111111",
  "Agent": {
    "agentType": "notAgentic",
    "agentSubjectType": "notAgentic"
  },
  "AppId": "da91c3ca-c5f2-4538-a970-83ee10968120",
  "AppOwnerTenantId": "11111111-1111-1111-1111-111111111111",
  "AuthenticationContextClassReferences": [],
  "AuthenticationProcessingDetails": [
    {
      "key": "Legacy TLS (TLS 1.0, 1.1, 3DES)",
      "value": "False"
    },
    {
      "key": "Is Legacy Store Used",
      "value": "False"
    },
    {
      "key": "Is CAE Token",
      "value": "False"
    }
  ],
  "AutonomousSystemNumber": "64512",
  "Category": "ServicePrincipalSignInLogs",
  "ClientCredentialType": "none",
  "ConditionalAccessAudiences": [],
  "ConditionalAccessPolicies": [],
  "ConditionalAccessPoliciesV2": "None",
  "ConditionalAccessStatus": "notApplied",
  "CorrelationId": "65b7c0d7-7f29-4a44-be12-bb841705d05a",
  "CreatedDateTime": "2026-07-25T16:03:38.0772751Z",
  "DurationMs": "0",
  "IPAddress": "203.0.113.10",
  "Id": "87978318-f2dd-4d78-9756-7b4c601f0d00",
  "Location": "US",
  "LocationDetails": {
    "city": "Redacted",
    "state": "Redacted",
    "countryOrRegion": "US",
    "geoCoordinates": {
      "latitude": 0.0,
      "longitude": 0.0
    }
  },
  "OperationName": "Sign-in activity",
  "OperationVersion": "1.0",
  "ResourceDisplayName": "Microsoft Graph",
  "ResourceGroup": "Microsoft.aadiam",
  "ResourceIdentity": "00000003-0000-0000-c000-000000000000",
  "ResourceOwnerTenantId": "f8cdef31-a31e-4b4a-93e4-5f571e91255a",
  "ResourceServicePrincipalId": "2e5ab30e-ae89-43c2-b130-0022f3d655a7",
  "ResultDescription": "Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app '{identifier}'.",
  "ResultSignature": "FAILURE",
  "ResultType": "7000215",
  "ServicePrincipalId": "cbcffa29-76e0-4573-baab-68503745a452",
  "ServicePrincipalName": "dw-signin-probe",
  "UniqueTokenIdentifier": "GIOXh93yeE2XVntMYB8NAA",
  "UserAgent": "Python-urllib/3.11"
}

Target application: Sign-in naming a target application

#

Description

Record carrying AppId or ResourceDisplayName: the application identifier and the resource the service principal signed into.

Example Sign-in Log Entry #

{
  "AADTenantId": "11111111-1111-1111-1111-111111111111",
  "Agent": {
    "agentType": "notAgentic",
    "agentSubjectType": "notAgentic"
  },
  "AppId": "7a5f4796-9012-4dad-a525-8427af2d12c5",
  "AppOwnerTenantId": "11111111-1111-1111-1111-111111111111",
  "AuthenticationContextClassReferences": [],
  "AuthenticationProcessingDetails": [
    {
      "key": "Legacy TLS (TLS 1.0, 1.1, 3DES)",
      "value": "False"
    },
    {
      "key": "Is Legacy Store Used",
      "value": "False"
    },
    {
      "key": "Is CAE Token",
      "value": "True"
    }
  ],
  "AutonomousSystemNumber": "64512",
  "Category": "ServicePrincipalSignInLogs",
  "ClientCredentialType": "clientSecret",
  "ConditionalAccessAudiences": [
    "00000002-0000-0ff1-ce00-000000000000",
    "00000003-0000-0ff1-ce00-000000000000"
  ],
  "ConditionalAccessPolicies": [],
  "ConditionalAccessPoliciesV2": "None",
  "ConditionalAccessStatus": "notApplied",
  "CorrelationId": "61f7354f-eb55-447b-816e-0f63a758cb61",
  "CreatedDateTime": "2026-07-25T16:06:55.4060019Z",
  "DurationMs": "0",
  "IPAddress": "203.0.113.10",
  "Id": "ed6df4b6-e2e8-4cc0-8fe6-5ed5bffc2100",
  "Location": "US",
  "LocationDetails": {
    "city": "Redacted",
    "state": "Redacted",
    "countryOrRegion": "US",
    "geoCoordinates": {
      "latitude": 0.0,
      "longitude": 0.0
    }
  },
  "OperationName": "Sign-in activity",
  "OperationVersion": "1.0",
  "ResourceDisplayName": "Microsoft Graph",
  "ResourceGroup": "Microsoft.aadiam",
  "ResourceIdentity": "00000003-0000-0000-c000-000000000000",
  "ResourceOwnerTenantId": "f8cdef31-a31e-4b4a-93e4-5f571e91255a",
  "ResourceServicePrincipalId": "2e5ab30e-ae89-43c2-b130-0022f3d655a7",
  "ResultSignature": "SUCCESS",
  "ResultType": "0",
  "ServicePrincipalCredentialKeyId": "3de57a95-5b1d-40af-9546-726a60205eb7",
  "ServicePrincipalId": "6950b93f-27e9-4954-9263-b76d82cbac76",
  "ServicePrincipalName": "dwh-ah-collector",
  "SessionId": "006ea83a-e365-c0f1-726a-097bd4be7dda",
  "UniqueTokenIdentifier": "tvRt7ejiwEyP5l7Vv_whAA",
  "UserAgent": "python-requests/2.34.2"
}

Common Indicators #

Field/value combinations most frequently checked by detection rules targeting this event, derived from cross-vendor predicate analysis.

FieldKindValueRulesVendors
azure_ad::app_id (elastic rule field)is_not_null1 ruleelastic
azure_ad::signin_category (elastic rule field)eqserviceprincipalsigninlogs1 ruleelastic

Detection Rules #

Full rule details for this event, including ATT&CK technique mappings and native queries →

Elastic #

  • Entra ID Service Principal Federated Credential Authentication by Unusual Client source high: Identifies when a service principal authenticates using a federated identity credential for the first time in the historical window. This indicates that Entra ID validated a JWT token potentially against an external OIDC identity provider and issued an access token. While legitimate for CI/CD workflows (GitHub Actions, Azure DevOps), adversaries may abuse this by configuring rogue identity providers (BYOIDP) to authenticate as compromised applications. First-time federated credential usage for a service principal warrants investigation to determine if the external identity provider is legitimate.T1078, T1078.004, T1098, T1098.001, T1550, T1550.001

Conditional Access status: Sign-in recording a Conditional Access status

#

Description

Record carrying ConditionalAccessStatus: the status of every Conditional Access policy related to the service principal's sign-in.

Example Sign-in Log Entry #

{
  "AADTenantId": "11111111-1111-1111-1111-111111111111",
  "Agent": {
    "agentType": "notAgentic",
    "agentSubjectType": "notAgentic"
  },
  "AppId": "7a5f4796-9012-4dad-a525-8427af2d12c5",
  "AppOwnerTenantId": "11111111-1111-1111-1111-111111111111",
  "AuthenticationContextClassReferences": [],
  "AuthenticationProcessingDetails": [
    {
      "key": "Legacy TLS (TLS 1.0, 1.1, 3DES)",
      "value": "False"
    },
    {
      "key": "Is Legacy Store Used",
      "value": "False"
    },
    {
      "key": "Is CAE Token",
      "value": "True"
    }
  ],
  "AutonomousSystemNumber": "64512",
  "Category": "ServicePrincipalSignInLogs",
  "ClientCredentialType": "clientSecret",
  "ConditionalAccessAudiences": [
    "00000002-0000-0ff1-ce00-000000000000",
    "00000003-0000-0ff1-ce00-000000000000"
  ],
  "ConditionalAccessPolicies": [],
  "ConditionalAccessPoliciesV2": "None",
  "ConditionalAccessStatus": "notApplied",
  "CorrelationId": "61f7354f-eb55-447b-816e-0f63a758cb61",
  "CreatedDateTime": "2026-07-25T16:06:55.4060019Z",
  "DurationMs": "0",
  "IPAddress": "203.0.113.10",
  "Id": "ed6df4b6-e2e8-4cc0-8fe6-5ed5bffc2100",
  "Location": "US",
  "LocationDetails": {
    "city": "Redacted",
    "state": "Redacted",
    "countryOrRegion": "US",
    "geoCoordinates": {
      "latitude": 0.0,
      "longitude": 0.0
    }
  },
  "OperationName": "Sign-in activity",
  "OperationVersion": "1.0",
  "ResourceDisplayName": "Microsoft Graph",
  "ResourceGroup": "Microsoft.aadiam",
  "ResourceIdentity": "00000003-0000-0000-c000-000000000000",
  "ResourceOwnerTenantId": "f8cdef31-a31e-4b4a-93e4-5f571e91255a",
  "ResourceServicePrincipalId": "2e5ab30e-ae89-43c2-b130-0022f3d655a7",
  "ResultSignature": "SUCCESS",
  "ResultType": "0",
  "ServicePrincipalCredentialKeyId": "3de57a95-5b1d-40af-9546-726a60205eb7",
  "ServicePrincipalId": "6950b93f-27e9-4954-9263-b76d82cbac76",
  "ServicePrincipalName": "dwh-ah-collector",
  "SessionId": "006ea83a-e365-c0f1-726a-097bd4be7dda",
  "UniqueTokenIdentifier": "tvRt7ejiwEyP5l7Vv_whAA",
  "UserAgent": "python-requests/2.34.2"
}

References #