Detection Intermediate Identity / Cloud / Zero Trust

Microsoft Entra ID � Identity Security

A practical guide to Microsoft Entra ID for security analysts � sign-in log investigation, Conditional Access, Identity Protection, risky users, PIM, and detecting identity-based attacks.

17 min read Identity & Access Blue Team / SOC

// What is Entra ID?

Microsoft Entra ID (formerly Azure Active Directory / Azure AD) is Microsoft's cloud-based identity and access management platform. It provides authentication and authorisation for Microsoft 365, Azure resources, and thousands of third-party SaaS applications.

From a security perspective, Entra ID is one of the most targeted components of a Microsoft environment � compromising an account gives an attacker access to email, files, cloud resources, and potentially the entire tenant. Understanding how to investigate it is essential for any blue team analyst working in a Microsoft shop.

Entra ID is distinct from on-premises Active Directory (AD DS). Entra ID is cloud-native � it uses OAuth 2.0 and OpenID Connect, not Kerberos. Many organisations run hybrid identity � syncing on-prem AD to Entra ID using Microsoft Entra Connect. Attacks can pivot between the two.

// Tenant Architecture

Tenant

A dedicated Entra ID instance for an organisation. Each tenant has a unique Tenant ID (GUID). All users, groups, apps, and policies live inside a tenant.

Domain

Tenants have one or more verified domains (e.g. company.com). The default domain follows the pattern tenantname.onmicrosoft.com.

App Registrations

Applications registered to authenticate against Entra ID � each gets a Client ID. Compromised app credentials can grant persistent access without user interaction.

Service Principals

The runtime identity of an app registration within the tenant. Attacks targeting service principal credentials (client secrets, certificates) are equivalent to compromising an account.

// Users, Groups & Roles

User types

TypeDescription
MemberInternal user homed in the tenant � employees, service accounts
GuestExternal user invited via B2B collaboration � often from partner organisations
Service AccountNon-interactive accounts for apps or automation � should have no MFA exemptions

High-value Entra roles to monitor

RolePermissionsRisk
Global AdministratorFull control of the tenant � can reset any password, manage all settingsCritical � equivalent to Domain Admin
Privileged Role AdministratorCan assign any Entra ID role, including Global AdminCritical � can elevate to Global Admin
Application AdministratorCan manage app registrations and service principal credentialsHigh � can create persistent backdoor apps
User AdministratorCan create and manage users, reset passwordsHigh � can create rogue accounts
Security AdministratorManage security policies, read sign-in logsMedium � read access to all security data

// Sign-in Logs

Sign-in logs record every authentication attempt in the tenant. They are one of the most valuable sources for detecting account compromise, password spraying, and unusual access patterns.

Access via Entra admin centre ? Monitoring ? Sign-in logs or via Microsoft Sentinel (SigninLogs table).

Key fields

FieldDescriptionWhat to look for
UserPrincipalNameThe account that attempted sign-inAccounts that don't normally sign in; disabled accounts
IPAddressSource IP of the sign-in attemptVPN, Tor, datacenter IPs; impossible travel
LocationCountry/city derived from IPUnusual countries; multiple countries in short window
ResultType0 = Success; non-zero = failure (specific error code)Bulk failures from one IP � spray; success after failures � breach
ClientAppUsedThe app or protocol usedLegacy auth (IMAP, SMTP, MAPI) � bypasses MFA
ConditionalAccessStatussuccess / failure / notAppliednotApplied = no CA policy matched � worth investigating
AuthenticationRequirementsingleFactorAuthentication vs multiFactorAuthenticationMFA bypassed � legacy auth or excluded user
DeviceDetailOS, browser, device compliance stateUnmanaged or non-compliant devices accessing sensitive apps

// Conditional Access

Conditional Access (CA) policies are Entra ID's Zero Trust enforcement engine. They evaluate signals at sign-in time � user, device, location, app, risk level � and decide whether to allow, block, or require additional verification.

Assignments (Conditions)

Who and what the policy applies to � users/groups, cloud apps, device platforms, locations, sign-in risk level.

Access Controls (Grant)

What the policy enforces � require MFA, require compliant device, require hybrid-joined device, block access.

Session Controls

Controls applied during the session � sign-in frequency, browser persistent sessions, app enforced restrictions.

Report-only mode

Evaluates policy without enforcing it � useful for testing impact before enabling. Check sign-in logs for what-if results.

CA exclusions are a common attack target. Attackers who compromise a Global Admin will add themselves (or a new account) to CA policy exclusions � bypassing MFA for their sessions. Audit CA exclusions regularly and alert on any changes.

// MFA & Authentication

MFA methods (strongest to weakest)

MethodPhishable?Notes
FIDO2 / PasskeysNoGold standard � hardware key or device biometric, cryptographically bound to the site
Windows Hello for BusinessNoDevice-bound biometric/PIN � not transferable
Microsoft Authenticator (number matching)ResistantRequires user to enter a number from sign-in screen � defeats blind push approval attacks
TOTP (Authenticator app code)YesCan be phished via AiTM proxy in real time
SMS / Voice callYesVulnerable to SIM swapping and SS7 attacks � weakest MFA option

Legacy authentication

Legacy authentication protocols (Basic Auth over IMAP, SMTP, MAPI, POP3, ActiveSync) do not support modern authentication or MFA. They are a common target for credential stuffing and password spraying � an attacker can authenticate with just a password even if MFA is enabled. Block legacy authentication with a Conditional Access policy.

// Identity Protection

Microsoft Entra ID Protection uses machine learning to detect risky sign-ins and risky users. It assigns risk levels (Low / Medium / High) based on behavioural signals.

DetectionWhat triggers it
Atypical travelSign-in from two geographically distant locations in an impossible timeframe
Anonymous IP addressSign-in from Tor exit node or known anonymising proxy
Unfamiliar sign-in propertiesNew device, location, or ASN not seen for this user before
Password sprayPattern matching credential stuffing or low-and-slow spray
Leaked credentialsUser's credentials found in breach database
Malware-linked IPSign-in from IP associated with a botnet or malware C2
Suspicious inbox manipulationForwarding rules added or emails moved � post-compromise data collection

// Privileged Identity Management

Privileged Identity Management (PIM) implements just-in-time privileged access. Instead of permanently assigning high-privilege roles (like Global Administrator), PIM lets users be eligible for a role and activate it on demand for a limited time with justification.

Assignment typeBehaviour
EligibleUser must activate the role, provide justification, and go through approval/MFA � activation is time-limited (e.g. 1 hour)
ActiveRole is permanently assigned � no activation needed. Should be minimised for high-privilege roles.

Alert on PIM activations. Any Global Administrator or Privileged Role Administrator activation outside of a change window is worth investigating. Attackers who compromise an eligible account will activate the role before taking action.

// Common Attack Vectors

AttackDescriptionDetection signal
Password SprayLow-and-slow attempts across many accounts with common passwordsMany 50126 errors across different UserPrincipalNames from same IP
AiTM PhishingAdversary-in-the-middle proxy captures session token � bypasses MFASuccessful sign-in after suspicious link click; token used from different IP than user
MFA FatigueFlood user with push notifications until they accidentally approveMultiple MFA denial events followed by approval from same user
Consent PhishingVictim grants OAuth permissions to attacker-controlled app � gives persistent access without credentialsNew app granted high-privilege consent; app not in approved list
Token TheftSteal a valid access/refresh token and replay it from attacker infrastructureSession from a new IP/ASN not matching user's normal pattern immediately after sign-in
Legacy Auth SprayUse legacy protocols that bypass MFAIMAP or SMTP authentication without MFA; many failures then success

// KQL Hunting Queries

These queries run in Microsoft Sentinel against the SigninLogs and AuditLogs tables.

Password spray detection

KQL
SigninLogs
| where TimeGenerated > ago(1h)
| where ResultType != 0
| summarize FailedAttempts = count(), TargetAccounts = dcount(UserPrincipalName) by IPAddress
| where TargetAccounts > 10
| sort by FailedAttempts desc

Successful login after multiple failures

KQL
let failures = SigninLogs
    | where TimeGenerated > ago(1h) and ResultType != 0
    | summarize FailCount = count() by UserPrincipalName, IPAddress;
SigninLogs
| where TimeGenerated > ago(1h) and ResultType == 0
| join kind=inner failures on UserPrincipalName, IPAddress
| where FailCount > 5
| project TimeGenerated, UserPrincipalName, IPAddress, Location, FailCount

Legacy authentication sign-ins

KQL
SigninLogs
| where TimeGenerated > ago(24h)
| where ClientAppUsed in ("IMAP", "POP3", "SMTP", "Exchange ActiveSync", "Exchange Online PowerShell", "MAPI over HTTP")
| where ResultType == 0
| project TimeGenerated, UserPrincipalName, ClientAppUsed, IPAddress, Location

Global Admin role assigned

KQL
AuditLogs
| where TimeGenerated > ago(24h)
| where OperationName == "Add member to role"
| where TargetResources has "Global Administrator"
| project TimeGenerated, InitiatedBy = tostring(InitiatedBy.user.userPrincipalName),
    TargetUser = tostring(TargetResources[0].userPrincipalName)