When it is written
Microsoft's leaked credentials service collects credentials from GitHub, the dark web, paste sites and other sources and checks them against the current valid credentials in Microsoft Entra ID; a detection means a valid match. A typical cause Microsoft names is a credential checked into a public code artifact on GitHub. It is calculated offline.
The application is in ServicePrincipalDisplayName and AppId. KeyIds holds the ID of the key credential Microsoft associates with the detection. Microsoft does not say in so many words that it is the leaked one, nor how a leaked client secret is shown, so look the ID up among the keyId values of both the certificates (keyCredentials) and the client secrets (passwordCredentials) of the application and of the service principal.
A workload identity cannot perform multifactor authentication, so the leaked credential is enough to sign in as the application, unless a risk-based Conditional Access policy for workload identities blocks it (it needs Workload Identities Premium and applies only to single-tenant service principals registered in the tenant).
How to turn it on
Microsoft Entra ID Protection workload identity risk detections records leakedCredentials calls to Microsoft Entra ID Protection workload identity risk detections without any setup. Vendor documentation
ID Protection detects risk on workload identities, the service principals of single-tenant, non-Microsoft SaaS and multitenant applications; managed identities are not in scope. The detections are listed in the admin center (ID Protection > Risky workload identities, and the Workload identity detections tab of Risk detections) for Security Reader and above. To keep them and send them to a SIEM, create a Microsoft Entra diagnostic setting with the ServicePrincipalRiskEvents category (and RiskyServicePrincipals for the risk state of each service principal), sent to a Log Analytics workspace (table AADServicePrincipalRiskEvents, the one Microsoft Sentinel reads), a storage account or an event hub.
- Licence. Tenants without Workload Identities Premium still receive every detection, with limited reporting details: the risk level and risk detail read
hidden. (Microsoft Graph's reference ties the two values to Workload Identities Premium; the AADServicePrincipalRiskEvents table reference says they are only available to Microsoft Entra ID P2 customers.) The Microsoft GraphservicePrincipalRiskDetectionsAPI and risk-based Conditional Access for workload identities need the licence. Microsoft's pages differ on the reports in the admin center: Securing workload identities asks only for one of the roles to use them, while the licence table of ID Protection says that viewing the Risky workload identities report and the Workload identity detections tab needs Workload Identities Premium. In a tenant without the licence, check in the admin center which of the two applies. - The detections on these pages are all calculated offline, so they arrive after the activity they describe.
- Data starts to flow about 15 minutes after the setting is saved and only covers detections from then on.
- Risky workload identities are not deleted until their risk is remediated. Microsoft's remediation steps are to inventory the identity's credentials, add a new one (x509 certificates are recommended), remove the compromised ones, and rotate the Key Vault secrets the service principal can reach.
(Invoke-AzRestMethod -Method GET -Path "/providers/microsoft.aadiam/diagnosticSettings?api-version=2017-04-01").ContentGet-MgServicePrincipalRiskDetection -Top 5 | Format-Table RiskEventType, RiskLevel, ServicePrincipalDisplayName, AppId, DetectedDateTimeGet-MgServicePrincipalRiskDetection -Filter "riskEventType eq 'leakedCredentials'" -Top 5 | Format-ListFields
The operation’s own fields first, then the fields every Microsoft Entra ID Protection workload identity risk detections record has. Field names are the JSON paths of the record as the vendor documents it.
| Field | What it holds |
|---|---|
Activity | The activity the risk is linked to; Microsoft's example detection shows servicePrincipal. |
DetectionTimingType | When the detection was computed; offline for this detection. |
RiskLevel | Level of the risk (low, medium, high); hidden in a tenant without the licence the details need (Workload Identities Premium in Microsoft Graph's reference, Microsoft Entra ID P2 in the table reference). |
RiskDetail | The reason behind the risk state, for example adminDismissedAllRiskForServicePrincipal or adminConfirmedServicePrincipalCompromised; none means no details are available, and hidden appears in a tenant without the licence the details need (Workload Identities Premium in Microsoft Graph's reference, Microsoft Entra ID P2 in the table reference). |
Source | Where the detection came from; Microsoft's example shows IdentityProtection. |
Fields every Microsoft Entra ID Protection workload identity risk detections record has (15)
| Field | What it holds |
|---|---|
TimeGenerated | When the record was written to the workspace, in UTC. |
Id | Unique ID of the risk detection. |
RiskEventTypeRead by 1 rule | The type of risk detected (for example leakedCredentials). The operation this page is about. |
ActivityDateTime | When the risky activity happened, in UTC. |
DetectedDateTime | When ID Protection detected the risk, in UTC. |
LastUpdatedDateTime | When the detection was last updated, in UTC. |
ServicePrincipalId | Object ID of the service principal the detection is about. |
ServicePrincipalDisplayName | Display name of the service principal. |
AppId | Application (client) ID of the application the service principal belongs to. |
KeyIds | The ID (GUID) of the key credential Microsoft associates with the detection. Microsoft's own example, a threat intelligence detection, carries one; Microsoft does not say which credential it is for each detection type. |
IpAddress | The client address the risky activity came from, when the detection has one. |
Location | Location of the sign-in, as Microsoft describes the column. |
RiskState | State of the risk for the service principal or sign-in, atRisk, confirmedCompromised, dismissed or none. |
CorrelationId | Correlation ID of the sign-in the detection is tied to; empty when it is not tied to one. |
RequestId | Request ID of the sign-in the detection is tied to; empty when it is not tied to one. |
Values to know
RiskState
| Value | Meaning | Signal |
|---|---|---|
atRisk | The detection is open; the credential still works until it is removedThe detection rule reports every record of this type, whatever its state. Remove the leaked credential (look up the ID in KeyIds). | Attack signal |
confirmedCompromised | An administrator confirmed the service principal compromised | Attack signal |
dismissed | An administrator dismissed the riskCheck that the leaked credential was removed before the risk was dismissed. | Worth knowing |
Volume and noise
Very low: every record is a match with a current valid credential. The work is finding where it leaked and whether it was used.
Keeping it manageable
- Follow Microsoft's remediation order: inventory the credentials of the service principal and of its application object, add a new one (Microsoft recommends a certificate), remove the leaked one (Microsoft recommends removing all existing ones if you believe the account is at risk), and rotate the Key Vault secrets the service principal can reach.
- Look at the service principal's sign-ins since the leak for addresses the application does not use; the hypotheses on this attack do that and look for credentials added after the leak.
- Find where the secret leaked (repositories, pipelines, configuration files) so the new one does not follow it.
Sample event
A Microsoft Entra ID Protection workload identity risk detections record in the vendor’s format, with made-up values.
{
"TimeGenerated": "2026-11-18T10:04:51.000Z",
"Id": "2b4d6f8a0c1e3a5c7e9b1d3f5a7c9e1b3d5f7a9c1e3b5d7f9a",
"RiskEventType": "leakedCredentials",
"ActivityDateTime": "2026-11-18T00:00:00.000Z",
"DetectedDateTime": "2026-11-18T00:00:00.000Z",
"LastUpdatedDateTime": "2026-11-18T09:58:13.000Z",
"ServicePrincipalId": "00000000-0000-0000-0000-0000000005e1",
"ServicePrincipalDisplayName": "corp-billing-sync",
"AppId": "00000000-0000-0000-0000-0000000a9901",
"KeyIds": [
"00000000-0000-0000-0000-00000000c4e7"
],
"IpAddress": null,
"Location": null,
"RiskState": "atRisk",
"CorrelationId": null,
"RequestId": null,
"Activity": "servicePrincipal",
"DetectionTimingType": "offline",
"RiskLevel": "high",
"RiskDetail": "none",
"Source": "IdentityProtection"
}Attacks this event reveals
Detection rules that read this event:
References
- Securing workload identities, workload identity risk detections (Microsoft)
- servicePrincipalRiskDetection resource type, Microsoft Graph (Microsoft)
- AADServicePrincipalRiskEvents table reference (Microsoft)
- riskDetail enum type, Microsoft Graph (Microsoft)
- keyCredential resource type, Microsoft Graph (Microsoft)
- passwordCredential resource type, Microsoft Graph (Microsoft)