12.2 Azure Security Operations with Microsoft Sentinel
Key Takeaways
- Microsoft Sentinel is a cloud-native SIEM and SOAR platform built upon Azure Log Analytics workspaces, delivering petabyte-scale telemetry ingestion, AI-driven correlation, and automated incident response.
- Microsoft Entra ID provides critical identity telemetry across interactive SigninLogs, NonInteractiveUserSignInLogs, directory AuditLogs, and Identity Protection risk feeds (AADRiskyUsers, AADUserRiskEvents), forming the foundation of cloud identity threat detection.
- The Azure Monitor Agent (AMA) replaces legacy monitoring agents, utilizing centralized Data Collection Rules (DCRs) to filter Windows Security Event IDs, Syslog, and CEF logs at the host level prior to ingestion, reducing bandwidth and Log Analytics storage costs.
- Kusto Query Language (KQL) is Microsoft Sentinel’s tabular query language; operators such as where, project, extend, summarize, join, and mv-expand support detection and investigation, with performance dependent on query and data design.
- Sentinel analytics can create incidents and automation rules can invoke Logic App playbooks, but high-impact containment needs permissions, failure handling, auditability, and risk-appropriate approval.
The Microsoft Cloud Security Ecosystem: Identity, Workloads, and SIEM
Microsoft's cloud security architecture unifies identity governance, workload protection, and security analytics into an integrated ecosystem. For the enterprise SOC, navigating this environment requires understanding the relationship among three core platforms: Microsoft Entra ID (formerly Azure Active Directory), the Microsoft Defender XDR family, and Microsoft Sentinel.
[Microsoft Enterprise Security Architecture]
┌────────────────────────────────────────────────────────────────────────┐
│ Microsoft Sentinel (SIEM & SOAR) │
│ - Log Analytics Workspace - Scheduled / NRT Analytic Rules │
│ - Data Connectors (Native / AMA) - Automation Rules & Playbooks │
└──────────────────────────────────▲─────────────────────────────────────┘
│ Ingestion (Events, Logs, Alerts)
┌──────────────────────────┴──────────────────────────┐
│ │
┌───────┴────────────────────────┐ ┌────────────────────┴────────────────┐
│ Microsoft Entra ID │ │ Microsoft Defender XDR │
│ - Interactive SigninLogs │ │ - Defender for Endpoint (MDE) │
│ - NonInteractiveUserSignInLogs│ │ - Defender for Identity (MDI) │
│ - Directory AuditLogs │ │ - Defender for Cloud Apps (MDA) │
│ - AADRiskyUsers / Risk Events │ │ - Defender for Cloud (CWPP / CSPM) │
└────────────────────────────────┘ └─────────────────────────────────────┘
1. Microsoft Entra ID: Identity Telemetry Streams
Because identity is the primary control boundary in Azure, Microsoft Entra ID generates high-fidelity telemetry that serves as the foundation for modern SOC monitoring. Entra ID logs are routed to Sentinel via native diagnostic settings and populate several distinct tables in the Log Analytics workspace:
SigninLogs(Interactive User Sign-Ins): Captures user authentications where a human enters credentials (password, FIDO2 key, Microsoft Authenticator push) through a browser or client application. Critical fields includeUserPrincipalName,IPAddress,Location(city/country),ConditionalAccessStatus,AuthenticationRequirement(single vs. multi-factor), andResultType(where0indicates success, and specific codes like50126represent invalid credentials or50074represent failed MFA challenges).NonInteractiveUserSignInLogs: Captures background authentications executed on behalf of a user without direct human interaction—such as mobile email clients refreshing OAuth refresh tokens or desktop applications maintaining persistent sessions. Because non-interactive volume often exceeds interactive logins by a factor of ten, isolating anomalies here is essential for catching session hijacking.AADServicePrincipalSignInLogs: Records authentications performed by non-human identities, such as applications and service principals utilizing client credentials (app IDs and secret certificates) to access Azure resources or Microsoft Graph APIs.AuditLogs: Records directory-level changes and their actors. Retention and tamper resistance depend on licensing, export, access controls, and storage design; the table should not be assumed immutable. Important supported events include user provisioning, group membership changes, app registrations, conditional-access changes, and privileged-role assignments. Analysts should verify event coverage, licensing, latency, and export configuration for the activity under investigation.AADRiskyUsersandAADUserRiskEvents: Populated by Entra ID Identity Protection using real-time and offline machine learning algorithms. Flags anomalous events such asunfamiliarFeatures,leakedCredentials,anonymousIPAddress(Tor/VPN exit nodes),impossibleTravel, andmaliciousIPAddress.
2. Microsoft Defender for Cloud and Defender XDR
- Microsoft Defender for Cloud: Serves as the cloud-native CSPM and CWPP engine for Azure, AWS, and GCP. It audits compliance against the Microsoft Cloud Security Benchmark (MCSB) and generates actionable alerts for server workloads (Defender for Servers), containerized clusters (Defender for Containers), and storage assets (Defender for Storage).
- Microsoft Defender XDR: Unifies telemetry across end-user environments, correlating alerts from endpoints (Defender for Endpoint), on-premises Active Directory domain controllers (Defender for Identity), cloud applications (Defender for Cloud Apps), and email infrastructure (Defender for Office 365) into centralized, multi-stage attack incidents.
Microsoft Sentinel Architecture & Data Ingestion Pipeline
Microsoft Sentinel is a cloud-native Security Information and Event Management (SIEM) and Security Orchestration, Automation, and Response (SOAR) platform. Sentinel operates on top of an Azure Log Analytics Workspace (LAW), which provides the underlying data store, indexing engine, and query execution fabric.
Ingestion Mechanisms & The Azure Monitor Agent (AMA)
Sentinel ingests data across diverse environments utilizing three primary mechanisms:
- Service-to-Service Native Connectors: Direct, API-based integrations that ingest logs from Microsoft Entra ID, Microsoft 365, Azure Activity, and Microsoft Defender XDR with single-click activation and zero infrastructure overhead.
- Azure Monitor Agent (AMA) with Data Collection Rules (DCR): Replaces the legacy Log Analytics Agent (MMA/OMS). The AMA is deployed across Windows and Linux virtual machines (in Azure, on-premises via Azure Arc, or in other clouds). Ingestion behavior is centrally configured using Data Collection Rules (DCRs), which define precisely which Windows Security Event IDs, Syslog facilities, or Common Event Format (CEF) log streams are filtered at the host level before transmission, drastically reducing bandwidth and log ingestion costs.
- Codeless Connector Framework (CCF) & REST APIs: Facilitates custom log ingestion from third-party SaaS vendors, network appliances, and external threat intelligence feeds using Azure Functions, Logic Apps, or direct REST API posts.
Data Storage Tiers in Log Analytics
To optimize security monitoring costs, Sentinel supports multiple log storage tiers:
- Analytics Logs: High-performance, fully indexed tier supporting real-time alerting, scheduled analytic rules, and interactive KQL hunting. Standard retention ranges from 30 to 730 days.
- Basic table plan: Discounted ingestion for troubleshooting and incident-response data, with 30 days of interactive single-table querying under the current Azure Monitor Logs model.
- Long-term/Data Lake retention: Lower-cost retention beyond the interactive period. Current Microsoft Sentinel data-lake options can extend total retention up to 12 years; access method, features, and cost differ from the Analytics tier. Archived data can be restored or queried via search jobs.
Kusto Query Language (KQL) for SOC Analysts
Kusto Query Language (KQL) is the specialized, read-only query language utilized by Microsoft Sentinel, Azure Monitor, and Defender XDR. KQL structures data flow using a Unix-style pipe syntax (|), where the output of one operator becomes the input to the next operator. Designed for big data analytics, KQL executes complex correlations across billions of records in sub-second timeframes.
KQL Operator Reference Matrix
| KQL Operator | Purpose & Functional Description | Syntax Example | Operational SOC Triage Tip |
|---|---|---|---|
where | Filters tabular data based on boolean predicates | SigninLogs | where ResultType != 0 and IPAddress !startswith "10." | Place where TimeGenerated >= ago(...) as the very first line to minimize data scanned. |
project | Selects specific columns to include in the output | SigninLogs | project TimeGenerated, UserPrincipalName, IPAddress | Eliminates unneeded columns early to accelerate downstream query performance. |
extend | Computes dynamic calculated columns | extend Domain = tostring(split(UserPrincipalName, "@")[1]) | Use to parse raw strings, calculate elapsed times, or unpack sub-fields. |
summarize | Aggregates data into calculated metrics | summarize FailedLogons = count() by UserPrincipalName, bin(TimeGenerated, 1h) | The bin() function groups continuous timestamps into discrete chronological buckets. |
join | Merges rows from two tables on a common key | TableA | join kind=inner (TableB) on $left.UserID == $right.AccountID | Always filter both tables aggressively before the join to avoid memory exhaustion. |
mv-expand | Flattens dynamic multi-value JSON arrays | AuditLogs | mv-expand TargetResources | Essential for parsing Entra ID directory audit events containing nested arrays. |
parse_json() | Interprets a string as a JSON object | extend Props = parse_json(ExtendedProperties) | Allows direct dot-notation access into complex nested event payloads (Props.ClientIP). |
render | Visualizes query results as charts | summarize count() by bin(TimeGenerated, 1d) | render timechart | Used in Sentinel Workbooks to display visual trend lines and anomaly spikes. |
Production-Grade KQL Detection Rules & Triage
To understand how SOC engineers translate threat intelligence and adversary tactics into actionable detections, examine two concrete, production-grade KQL analytic rules.
Detection Rule 1: Privileged Entra ID Role Assignment (Global Administrator Abuse)
Adversaries who compromise a cloud environment frequently seek persistence and complete administrative dominion by granting themselves the Global Administrator or Privileged Role Administrator role.
// Detection Rule: New Privileged Entra ID Role Assigned
AuditLogs
| where TimeGenerated >= ago(1h)
| where OperationName =~ "Add member to role"
| where Result =~ "success"
| mv-expand TargetResources
| extend RoleName = tostring(TargetResources.modifiedProperties[1].newValue)
| where RoleName in~ ("Global Administrator", "Privileged Role Administrator", "Security Administrator")
| extend TargetUserUPN = tostring(TargetResources.userPrincipalName)
| extend InitiatedByUPN = tostring(parse_json(tostring(InitiatedBy.user)).userPrincipalName)
| extend InitiatedByIP = tostring(parse_json(tostring(InitiatedBy.user)).ipAddress)
| project TimeGenerated, OperationName, RoleName, TargetUserUPN, InitiatedByUPN, InitiatedByIP, CorrelationId
Line-by-Line Technical Breakdown:
AuditLogs | where TimeGenerated >= ago(1h): Scopes the query to directory audit events logged within the preceding 60 minutes.where OperationName =~ "Add member to role": Filters specifically for directory role membership additions (=~denotes case-insensitive matching).where Result =~ "success": Discards failed or rejected role assignment attempts.mv-expand TargetResources: Expands the dynamic JSON array of targeted assets, turning each targeted resource into an individual row for tabular inspection.extend RoleName = ...: Extracts the assigned role name from the nestedmodifiedPropertiesJSON structure.where RoleName in~ (...): Restricts alerts to tier-0 privileged roles capable of enterprise-wide compromise.extend TargetUserUPN ... InitiatedByUPN ...: Extracts the identity receiving the privilege and the administrative identity that authorized the transaction.project ...: Formats the final output table, presenting only relevant forensic artifacts (target, actor, source IP, correlation ID) for the Tier 1 triage analyst.
Detection Rule 2: Brute-Force Password Spray Followed by Successful Authentication
A common adversary pattern involves executing multiple failed login attempts against an account (or spraying a common password across thousands of accounts) followed by a successful authentication from the same IP address.
// Detection Rule: Multiple Failed Logins Followed by Successful Interactive Sign-In
let LookbackPeriod = 2h;
let FailureThreshold = 10;
let FailedAttempts =
SigninLogs
| where TimeGenerated >= ago(LookbackPeriod)
| where ResultType in (50126, 50053, 50055) // Invalid password, account locked, expired password
| summarize FailedCount = count(), FirstFailure = min(TimeGenerated), LastFailure = max(TimeGenerated)
by IPAddress, UserPrincipalName
| where FailedCount >= FailureThreshold;
let SuccessfulLogins =
SigninLogs
| where TimeGenerated >= ago(LookbackPeriod)
| where ResultType == 0 // Successful authentication
| project SuccessTime = TimeGenerated, UserPrincipalName, IPAddress, AppDisplayName, Location, ClientAppUsed;
FailedAttempts
| join kind=inner (SuccessfulLogins) on IPAddress, UserPrincipalName
| where SuccessTime > LastFailure
| extend CompromiseWindowMinutes = datetime_diff('minute', SuccessTime, LastFailure)
| project FirstFailure, LastFailure, SuccessTime, CompromiseWindowMinutes, UserPrincipalName, IPAddress, FailedCount, AppDisplayName, Location
Line-by-Line Technical Breakdown:
let LookbackPeriod = 2h; let FailureThreshold = 10;: Declares reusable variables defining time boundaries and sensitivity thresholds.FailedAttempts = SigninLogs ...: Isolates failed authentication error codes (such as50126for incorrect credentials) and aggregates failed attempts by source IP and user principal name.SuccessfulLogins = SigninLogs ...: Creates a secondary virtual table isolating successful sign-in events (ResultType == 0) occurring across the same window.FailedAttempts | join kind=inner (SuccessfulLogins) on IPAddress, UserPrincipalName: Merges both datasets where both the source IP and target user match exactly.where SuccessTime > LastFailure: Ensures the successful login occurred chronologically after the brute-force flurry, eliminating benign logons that preceded the attack.extend CompromiseWindowMinutes = ...: Calculates the operational delay between the final brute-force attempt and the successful breach.
Sentinel Incident Management & SOAR Automation Rules
When an Analytic Rule detects a threat, Microsoft Sentinel automatically generates an Incident. An incident correlates multiple alerts containing overlapping entities (e.g., matching IP addresses, user accounts, or hostnames) into a single operational dossier, preventing alert fatigue in the SOC queue.
Incident Triage & The Investigation Graph
During triage, analysts utilize Sentinel's Investigation Graph, an interactive visual interface that maps relationships between entities. Analysts can expand entities (e.g., pivoting on a compromised user account to reveal all IP addresses utilized over the last 48 hours) without writing manual queries.
Automation Rules vs. Playbooks (Azure Logic Apps)
Sentinel differentiates between lightweight triage automation and complex orchestration workflows:
- Automation Rules: The primary triage automation engine. Evaluated immediately upon incident creation or update. Operates without code to assign incidents to specific SOC tiers, append analytical tags (e.g.,
MitreATT&CK:T1078), alter severity ratings, or automatically close known false positives. - Playbooks: Built upon Azure Logic Apps, playbooks deliver enterprise-grade SOAR capabilities. A playbook contains pre-configured connectors and conditional logic to execute automated, cross-platform containment workflows:
- Identity Containment: Calling Microsoft Graph
POST /users/{id}/revokeSignInSessionsinvalidates Entra refresh tokens and Entra browser session cookies after propagation. Already issued access tokens and application-owned sessions require additional controls. - Network Containment: Modifying an Azure Network Security Group (NSG) rule to block a malicious external IP address or quarantine a compromised virtual machine.
- ITSM Synchronization: Opening a critical incident ticket in ServiceNow SecOps, updating notes in real time, and notifying the on-call Tier 2 incident responder via a Microsoft Teams webhook.
- Identity Containment: Calling Microsoft Graph
A SOC Tier 1 analyst is investigating a suspected credential compromise involving automated application access in Microsoft Entra ID. The alert indicates that an attacker may have stolen client credentials (app ID and secret) belonging to an automated backup integration. In which Microsoft Entra ID log stream within the Log Analytics workspace should the analyst search to examine the authentication events and token acquisitions executed by this service principal?
During a Microsoft Entra ID account compromise, which Sentinel-playbook action invalidates Entra refresh tokens and Entra browser session cookies without deleting the user object?
A detection engineer is authoring a KQL query in Microsoft Sentinel to parse Microsoft Entra ID directory modifications in the AuditLogs table. The TargetResources column stores a dynamic JSON array containing multiple affected objects and modified property pairs. Which KQL operator must the engineer utilize to flatten this JSON array so that each individual target resource record expands into its own separate row for filtering and aggregation?
A SOC analyst is authoring a custom KQL detection rule in Microsoft Sentinel to correlate external firewall threat events recorded in CommonSecurityLog with successful cloud sign-ins in SigninLogs. The firewall connector normalizes a C2 classification into Activity == "CommandAndControl". The goal is to identify users who successfully logged into Entra ID from the event SourceIP after that firewall event and no more than 2 hours later. Which KQL query structure correctly performs this correlation?