Service Principal & App Registration Activity

Cloud & SaaSIdentity & DirectoryCloud Control PlaneSIEM / Log Aggregator

Location

Azure Portal > Entra ID > App registrations and Enterprise applications > Audit logs (or Microsoft Graph API)

Description

Audit trail for service principal and application registration changes including new app registrations, secret/certificate additions, API permission grants, redirect URI changes, and owner modifications.

Forensic Value

Service principal manipulation is a critical cloud persistence technique. Attackers add secrets or certificates to existing app registrations, creating backdoor credentials that survive password resets and MFA enforcement. New API permission grants (especially Microsoft Graph with Mail.Read, Files.ReadWrite.All) enable automated data access. Redirect URI changes can intercept OAuth flows. Monitoring for new credential additions on existing apps is essential because these changes do not require user interaction after initial compromise.

Tools Required

Azure PortalMicrosoft Graph APIPowerShell (AzureAD module)Azure CLIROADtools

Collection Commands

Graph API

GET https://graph.microsoft.com/v1.0/applications?$select=displayName,appId,passwordCredentials,keyCredentials,createdDateTime&$top=999

PowerShell

Get-AzureADApplication -All $true | ForEach-Object { [PSCustomObject]@{Name=$_.DisplayName; AppId=$_.AppId; Creds=$_.PasswordCredentials.Count; Keys=$_.KeyCredentials.Count} } | Where-Object { $_.Creds -gt 0 -or $_.Keys -gt 0 } | Export-Csv app_credentials.csv -NoTypeInformation

PowerShell

Search-UnifiedAuditLog -StartDate (Get-Date).AddDays(-90) -EndDate (Get-Date) -Operations "Add service principal credentials","Update application" -ResultSize 5000 | Export-Csv sp_credential_changes.csv -NoTypeInformation

ROADtools

roadrecon gather --access-token <token> && roadrecon gui

MITRE ATT&CK Techniques

T1098.003T1550.001T1136.003T1098T1078.004

Related Blockers

Legal Requesting Preservation Conflicts with Containment

Legal counsel has issued a preservation hold requiring that certain systems, mailboxes, or data stores remain untouched. This directly conflicts with containment actions like reimaging hosts, resetting accounts, or blocking network segments.

Unknown Scope of Credential Compromise

One or more accounts are confirmed compromised, but it is unclear how many additional credentials the attacker has obtained. Resetting only known-compromised accounts may be insufficient, while a mass reset disrupts operations.

Attacker Using VPN/Tor -- Cannot Determine True Origin

The threat actor is connecting through VPN services, Tor exit nodes, or residential proxy networks. Source IP addresses rotate frequently and do not reveal the actual origin, limiting geographic attribution and IP-based blocking.

Suspected Insider Still Has Access -- Investigation Must Be Covert

The primary suspect is a current employee or contractor who still has active credentials and system access. Overt containment actions (account lockout, visible monitoring) would tip off the suspect and risk evidence destruction or acceleration of harmful activity.

Regulatory Notification Deadline Approaching

A regulatory reporting deadline (GDPR 72-hour, SEC 4-day, state breach notification, HIPAA) is imminent and the investigation has not yet determined the full scope of data exposure. The team must balance thorough investigation against mandatory disclosure timelines.

SaaS Audit Logging Not Enabled or Not Licensed

The investigation depends on SaaS audit evidence that was never enabled, is unavailable under the current subscription tier, or requires a higher-privilege admin role than the response team currently has. This creates blind spots for identity abuse, collaboration-platform misuse, and source-code access.

Cloud or Container Logging Coverage Missing

The investigation depends on cloud-control-plane or container telemetry that was never enabled, was retained too briefly, or was routed to an unavailable destination. This creates blind spots around identity misuse, cluster administration, and workload behavior.

SaaS Audit Retention Expired Before Collection

The response started after the native retention window for Google Workspace, Okta, Slack, GitHub, or similar SaaS evidence had already passed. The necessary events are no longer available in the vendor UI or API even though the underlying accounts and content may still exist.