The Certificate Was Valid — But Nobody Knew Who Was Using It
The sign-in succeeded.
The certificate was valid. The application had permission to access Microsoft Graph. Nothing in the authentication result looked particularly dramatic.
There was just one problem.
Nobody on the security team recognised the application.
“The certificate is valid,” the analyst said.
“Lovely,” Agent Foskett replied. “And who authorised it?”
“We haven't found anyone.”
“Then I suggest we stop congratulating the certificate.”

Case file: Authentication success is not authorisation
A fictional, evidence-led investigation into an unfamiliar application identity, certificate credentials, service principal sign-ins, app role assignments and the limits of what identity telemetry can prove.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
// Microsoft Sentinel / Log Analytics — requires OfficeActivity ingestion
let StartUtc = datetime(2026-10-13T15:30:00Z);
let EndUtc = datetime(2026-10-13T17:30:00Z);
OfficeActivity
| where TimeGenerated between (StartUtc .. EndUtc)
| where Operation has_any ("Retention", "CompliancePolicy", "ComplianceRule")
or tostring(Parameters) has_any ("Retention", "CompliancePolicy")
| project TimeGenerated, OfficeWorkload, Operation, UserId,
ClientIP, OfficeObjectId, Parameters
| order by TimeGenerated asc- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
// Microsoft Sentinel — requires Entra SigninLogs ingestion
let TargetAdmin = "compliance.admin@contoso.com";
let StartUtc = datetime(2026-10-13T15:30:00Z);
let EndUtc = datetime(2026-10-13T17:30:00Z);
SigninLogs
| where TimeGenerated between (StartUtc .. EndUtc)
| where UserPrincipalName =~ TargetAdmin
| project TimeGenerated, UserPrincipalName, AppDisplayName,
IPAddress, ResultType, ConditionalAccessStatus,
AuthenticationRequirement, DeviceDetail, LocationDetails
| order by TimeGenerated asc- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
// Microsoft Sentinel — requires Entra AuditLogs ingestion
let StartUtc = datetime(2026-10-13T14:00:00Z);
let EndUtc = datetime(2026-10-13T18:00:00Z);
AuditLogs
| where TimeGenerated between (StartUtc .. EndUtc)
| where Category in~ ("RoleManagement", "UserManagement", "ApplicationManagement")
| project TimeGenerated, Category, OperationName, Result,
InitiatedBy, TargetResources, CorrelationId
| order by TimeGenerated ascAn application nobody could explain
The team did not immediately label the activity malicious. An old but legitimate integration, a renamed application or an undocumented deployment could produce similar evidence. The investigation began with the identity itself.
First, identify the right object
Use the Entra admin centre or Microsoft Graph with appropriately authorised read permissions to capture the current configuration. Preserve the evidence before making changes. A certificate thumbprint identifies a certificate, but does not establish who possesses its private key.
Find the workload identity sign-ins
AADServicePrincipalSignInLogs table in a Microsoft Sentinel / Log Analytics workspace. It works only when the relevant Entra diagnostic logs are routed to that workspace and retained. It does not run unchanged in Microsoft Defender XDR Advanced Hunting.In this illustrative case, replace the example application ID and dates with the values from your own investigation. Review both successful and failed sign-ins; successful authentication is the starting point, not the conclusion.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
// Microsoft Sentinel / Log Analytics — requires service principal sign-in logs
let TargetAppId = "11111111-2222-3333-4444-555555555555";
let StartUtc = datetime(2026-10-19T00:00:00Z);
let EndUtc = datetime(2026-10-21T00:00:00Z);
AADServicePrincipalSignInLogs
| where TimeGenerated between (StartUtc .. EndUtc)
| where AppId =~ TargetAppId
| project TimeGenerated, AppId, ServicePrincipalId,
ServicePrincipalName, ResourceDisplayName,
IPAddress, ResultType, ResultDescription,
CorrelationId, CredentialKeyId
| order by TimeGenerated ascWhere did the authentication originate?
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
// Microsoft Sentinel / Log Analytics — same data prerequisite
let TargetAppId = "11111111-2222-3333-4444-555555555555";
AADServicePrincipalSignInLogs
| where TimeGenerated > ago(14d)
| where AppId =~ TargetAppId
| summarize SignIns=count(),
FirstSeen=min(TimeGenerated),
LastSeen=max(TimeGenerated),
Results=make_set(ResultType, 10)
by IPAddress, ResourceDisplayName
| order by LastSeen descWas the certificate recently added or replaced?
TargetResources can vary, so inspect the original event rather than treating a text match as definitive proof that a certificate was added.The example query is a broad triage search. Validate candidate events against the complete audit record, object IDs and credential metadata.
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
// Microsoft Sentinel — requires Entra AuditLogs ingestion
let TargetAppId = "11111111-2222-3333-4444-555555555555";
AuditLogs
| where TimeGenerated > ago(30d)
| where Category in~ ("ApplicationManagement", "RoleManagement")
| extend Targets=tostring(TargetResources)
| where Targets has TargetAppId
or OperationName has_any ("application", "service principal", "app role")
| project TimeGenerated, OperationName, Category,
Result, InitiatedBy, TargetResources,
CorrelationId
| order by TimeGenerated ascWhat could the application actually do?
Permissions describe potential access, not confirmed data retrieval. An investigator should not claim that mailboxes were read or files exported merely because a permission exists. Resource-specific telemetry and audit evidence are needed to establish what was accessed.
Reconstruct the directory change timeline
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
// Microsoft Sentinel — requires Entra AuditLogs ingestion
let StartUtc = datetime(2026-10-19T00:00:00Z);
let EndUtc = datetime(2026-10-21T00:00:00Z);
AuditLogs
| where TimeGenerated between (StartUtc .. EndUtc)
| where Category =~ "ApplicationManagement"
| project TimeGenerated, OperationName, Result,
InitiatedBy, TargetResources, CorrelationId
| order by TimeGenerated ascThe investigation timeline
The finding: valid does not mean approved
The organisation classified the workload identity as unapproved and potentially exposed, preserved sign-in and audit records, reviewed dependent services, and followed its change-controlled response process to disable or replace the credential where appropriate. The team also investigated where the private key had been stored and whether any legitimate automation depended on it.
Practical defensive lessons
Evidence rule: A successful service principal sign-in establishes that Entra ID accepted an authentication attempt. It does not, by itself, establish human identity, business authorisation or downstream data access.
Final thought
“Yes,” Agent Foskett replied.
“And the sign-in succeeded?”
“Also yes.”
“Then what’s the problem?”
Agent Foskett looked at the application inventory. There was a long silence.
“Apparently, we have given a perfectly valid set of keys to a visitor nobody remembers inviting.”
He closed the case notes.
“The Logs Already Knew!” 🔎

