Modern enterprises rely heavily on third-party SaaS platforms, MSPs, OAuth integrations, and programmatic API keys. Every integration silently extends the enterprise boundary. When an external vendor is compromised, adversaries inherit pre-approved access into customer environments without needing exploits or triggering MFA.
To counter this, threat hunters cannot rely on isolated signature rules. Effective defense requires continuous behavioral baselining of Non-Human Identities (NHIs) across identity, cloud, and data platforms, coupled with proactive anomaly hunting around high-impact Crown Jewels.
In cloud environments, Non-Human Identities outnumber human users by 45 to 1. NHIs present five critical structural vulnerabilities:
Hunting across identity supply chains requires establishing a 30-to-90 day behavioral profile across four core pillars: (1) Network & Infrastructure Provenance (ASNs, CIDRs, VPCs, TLS fingerprints), (2) API Footprint & Method Diversity (read vs. administrative calls), (3) Velocity & Volumetric Cadence (query rates, burst dumps), and (4) Resource Scope & Blast Radius (databases, secrets vaults, mailboxes accessed).
|
Platform Tier |
NHI Entities |
Native Telemetry |
Baseline & Deviation Trigger |
|
Identity / IdP (Entra, Okta) |
Service Principals, OAuth Apps, API Tokens |
ServicePrincipalSignInLogs, AuditLogs, Okta SystemLog |
Baseline: Historical ASN/IP & daily API volume. |
|
Cloud IAM (AWS, Azure, GCP) |
IAM Roles, Service Accounts, Workload Identity |
AWS CloudTrail, GCP Audit Logs, Azure Activity |
Baseline: Expected source VPC & regular API set. |
|
CI/CD (GitHub, GitLab) |
Runner Tokens, Deploy Keys, Machine Users |
GitHub Audit Log, Pipeline Execution Logs |
Baseline: Runner IP CIDR & repo scope. |
|
Data Stores (Snowflake, S3) |
ETL Service Users, Integration DB Roles |
Snowflake ACCESS_HISTORY, S3 Server Access |
Baseline: Queried schemas & average byte volume. |
|
Vector |
Exploitation Mechanism |
Key Telemetry Source |
|
1. MSP / DAP Hijacking |
Compromising MSP platforms or technician credentials to push scripts to downstream customer tenants. |
Cloud IAM & Tenant Audit Logs (elevated role assignments) |
|
2. Illicit OAuth Apps |
Tricking admins/users into granting high-privilege scopes (Mail.ReadWrite, User.ReadWrite.All) to a rogue multi-tenant app. |
IdP Audit Logs (ConsentToApplication, Add delegated grant) |
|
3. Service Principal Theft |
Stealing hardcoded client secrets or bearer tokens to query customer APIs directly from foreign infrastructure. |
API Gateway Logs (caller identity & IP anomaly) |
|
4. Support HAR Scraping |
Breaching vendor support portals to harvest unexpired session cookies and tokens from customer-uploaded HAR archives. |
IdP Sign-in Logs (session token reuse from new ASN) |
|
5. SAML Token Forgery |
Stealing IdP token-signing certificates to mint arbitrary SAML assertions and impersonate any user (Golden SAML). |
Security Token Service Logs (signing key ID & issuer check) |
Lab Simulation 01: Illicit Multi-Tenant OAuth App Registration & High-Privilege Consent Grant
Vector 2 | T1098.005 / T1199: Adversary registers a multi-tenant app and tricks an administrator into granting tenant-wide Mail.ReadWrite and Directory.ReadWrite.All permissions.
Listing 1: Rogue OAuth App Registration Manifest
// Malicious Application Manifest Snippet (manifest.json)
{
"id": "e2f4a1c0-8d5b-4c9e-bf33-999a0e123456",
"appDisplayName": "Enterprise Cloud Document Sync Pro",
"signInAudience": "AzureADMultipleOrgs",
"requiredResourceAccess": [{
"resourceAppId": "00000003-0000-0000-c000-000000000000",
"resourceAccess": [
{ "id": "e2a3a72e-5f90-4ffe-a74d-0808064a3814", "type": "Role", "comment": "Mail.ReadWrite (Application)" },
{ "id": "19dbc75e-c2e2-444c-a770-ec69d8559fc7", "type": "Role", "comment": "Directory.ReadWrite.All (Application)" }
]
}]
}
Captured Native Audit Log Schema Evidence (Entra ID AuditLogs):
|
Native Log Field |
Captured Event Value |
Security Significance |
|
ActivityDisplayName |
Consent to application |
HIGH FIDELITY: Administrator consented to an external application registration. |
|
Actor.UserPrincipalName |
admin.identity@enterprise-corp.com |
Identifies the targeted administrator account authorizing the grant. |
|
TargetResources[0].DisplayName |
Enterprise Cloud Document Sync Pro |
Rogue application display name. |
|
TargetResources[0].ModifiedProperties |
ConsentType: AllPrincipals |
CRITICAL: High-risk permission scopes granted tenant-wide without user boundary. |
|
InitiatedBy.App.AppId |
e2f4a1c0-8d5b-4c9e-bf33-999a0e123456 |
Unique application ID linked to the attacker's external tenant. |
|
IPAddress |
198.51.100.203 |
Source IP of the administrator when the consent was granted. |
Vector 3 | T1078.004 / T1552.004: Adversary uses stolen vendor client credentials to authenticate non-interactively and exfiltrate executive email messages via Microsoft Graph API.
Listing 2: Cross-Tenant Authentication & API Exfiltration
# 1. Authenticate with Stolen Vendor Client ID & Secret
curl -X POST https://login.microsoftonline.com/{target-tenant-id}/oauth2/v2.0/token \
-d
"client_id=e2f4a1c0-8d5b-4c9e-bf33-999a0e123456&client_secret=xR7~9K_stolen_secret&scope=https://graph.microsoft.com/.default&grant_type=client_credentials"
# 2. Query Executive Mailbox via Graph API from Attacker Server
curl -X GET "https://graph.microsoft.com/v1.0/users/ceo@enterprise-corp.com/messages" \
-H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJ..."
Captured Native Cloud Sign-In & Service Principal Telemetry:
|
Telemetry Source |
Native Schema Field |
Captured Value |
Security Significance |
|
ServicePrincipalSignInLogs |
servicePrincipalName |
Vendor-SaaS-Connector |
Service principal used to authenticate non-interactively. |
|
ServicePrincipalSignInLogs |
ipAddress |
185.220.101.5 |
HIGH ANOMALY: Authentication originates from Tor/VPN exit node instead of vendor CIDR. |
|
ServicePrincipalSignInLogs |
authenticationProcessingDetails |
AppOnly |
Confirms non-human identity authentication using client credentials. |
|
Microsoft Graph Activity API |
uri |
/v1.0/users/ceo@enterprise-corp.com/messages |
CRITICAL: Service principal accessing targeted executive inbox contents. |
|
AuditLogs |
ActivityDisplayName |
Add service principal credentials |
Attacker attempting to establish secondary persistence by adding an extra secret key. |
Effective threat hunting combines Tier 1 Multi-Platform Behavioral Drift with Tier 2 Crown Jewel Asset Deviations:
[TIER 1: MULTI-PLATFORM BEHAVIORAL BASELINE DEVIATIONS]
[TIER 2: CROWN JEWEL / HIGH-IMPACT ASSET DEVIATIONS]
Don't let inherited trust become your biggest vulnerability. Eliminate NHI and cross-tenant API blind spots at machine speed with Netenrich.
Identity is the perimeter, and third-party integrations are its most vulnerable gates. Trust cannot be an operational assumption—it must be continuously baselined, tightly bounded around Crown Jewels, and rigorously audited.
NEXT IN THIS SERIES: DISTRIBUTION & UPDATE INFRASTRUCTURE