Analytics Rule Types

Earn 25 points (50 with Pro) in two steps

  1. ① Read through the lesson — each section gets a ✓ as you scroll through it.
  2. ② When every section has a ✓, tap Complete lesson.

0 of 12 read · keep scrolling

✦ See fewer ads and earn double points — 50 a lesson instead of 25 — with Pro

Analytics Rule Types in Microsoft Sentinel

Introduction: The Heart of Security Operations

In the modern landscape of cybersecurity, the sheer volume of data generated by enterprise networks, cloud services, and endpoint devices is overwhelming. A Security Operations Center (SOC) analyst cannot possibly manually inspect every log entry to identify malicious activity. This is where Microsoft Sentinel, a cloud-native Security Information and Event Management (SIEM) system, becomes indispensable. At the core of Sentinel’s ability to turn raw telemetry into actionable intelligence are Analytics Rules.

Analytics rules are the engines that scan your data, apply logic, and generate incidents when suspicious patterns are identified. Without these rules, Sentinel is merely a storage repository for logs. By mastering the different types of analytics rules, you transition from a passive log observer to an active hunter of threats. Understanding these rule types allows you to tailor your detection strategy, minimize false positives, and ensure that your team focuses on the alerts that actually matter.

This lesson explores the various analytics rule types available in Microsoft Sentinel, how to implement them, and the best practices for maintaining a healthy detection environment. We will look at Kusto Query Language (KQL) logic, the distinction between static and dynamic thresholds, and the importance of mapping your detections to the MITRE ATT&CK framework.


Not read yet

The Landscape of Analytics Rules

Microsoft Sentinel provides several distinct ways to define how threats are detected. While KQL is the common language used across almost all of them, the structure and intent of the rules differ based on the use case. Generally, we categorize these rules into Scheduled, Microsoft Security, and Fusion/Machine Learning-based detections.

1. Scheduled Analytics Rules

Scheduled rules are the bread and butter of most SOC teams. They run a KQL query on a predefined schedule—ranging from every minute to once a day—to look for specific patterns in your data. If the query returns a result (a "hit"), the rule triggers an incident.

2. Microsoft Security Rules

These rules are pre-configured to ingest alerts from other Microsoft security services, such as Microsoft Defender for Endpoint, Defender for Cloud, or Microsoft Entra ID Protection. Unlike scheduled rules, you do not write the detection logic for these; instead, you manage the incident creation settings.

3. Fusion Rules

Fusion is a proprietary engine provided by Microsoft that uses advanced multi-stage attack detection. It correlates low-fidelity alerts from various products to identify sophisticated, multi-stage attacks that might otherwise be missed.

4. Machine Learning Behavioral Analytics (MLBA)

These rules are designed to detect anomalies in user behavior, such as unusual sign-in locations or atypical file access patterns. They rely on Sentinel’s built-in machine learning models rather than static queries.


Not read yet

Deep Dive: Scheduled Analytics Rules

Scheduled rules are the most flexible and commonly used type of detection. To create one, you define a query, set the scheduling parameters, and configure the incident settings.

Anatomy of a Scheduled Rule

When you build a scheduled rule, you are essentially writing a KQL query that looks for a "bad" condition. For example, you might want to detect when an account is added to a highly privileged group, such as the Domain Admins group.

Practical Example: Detecting Privilege Escalation

Imagine you want to detect if a user is added to a critical group in your environment. You would write a query similar to this:

// Look for security events where a member was added to a security-enabled group
SecurityEvent
| where EventID == 4728
| where TargetUserName == "Domain Admins"
| project TimeGenerated, MemberName, TargetUserName, SubjectUserName, Computer

This query scans the SecurityEvent table for Event ID 4728, which corresponds to "A member was added to a security-enabled global group." By filtering for "Domain Admins," you isolate a high-risk event.

Callout: Scheduled Rule Configuration When setting up a scheduled rule, you must define the "Query Frequency" and "Lookback Period." The Query Frequency dictates how often the rule runs (e.g., every 5 minutes). The Lookback Period dictates how far back in time the query looks for data. A best practice is to ensure your Lookback Period is at least as long as your Query Frequency to prevent missing logs that arrive with slight latency.

Step-by-Step: Creating a Scheduled Rule

  1. Navigate to the Configuration section in Sentinel and select Analytics.
  2. Click Create and choose Scheduled query rule.
  3. Provide a meaningful name and description. Use the MITRE ATT&CK framework to map the rule to specific tactics like "Persistence" or "Privilege Escalation."
  4. In the Set rule logic tab, paste your KQL query. Use the Result simulator to verify that your query returns data before saving.
  5. Configure Alert thresholding. If you expect a high volume of events, you can set a threshold so an incident is only created if, for example, more than 5 events occur in 10 minutes.
  6. Set the Incident creation settings. This determines whether every single hit results in an incident or if multiple hits are grouped into a single incident based on specific entities (like IP address or username).

Not read yet

Handling False Positives and Tuning

A common pitfall for new Sentinel users is "alert fatigue." If your rules are too broad, you will be overwhelmed by noise. Tuning your rules is a continuous process.

The Power of Suppression

Sometimes, a specific activity is technically malicious but expected in your environment. For instance, a system administrator might legitimately add users to a group during a scheduled maintenance window. Instead of deleting the rule or ignoring the alert, use the Suppression feature.

Suppression allows you to define a query that filters out known good behavior. If the suppression query returns a result, the main alert will not be generated.

Using Thresholds

Thresholds are your best defense against noisy logs. If you are monitoring for failed sign-ins, you shouldn't alert on a single failure, as users often mistype their passwords. Instead, set a threshold:

SigninLogs
| where ResultType != 0
| summarize FailureCount = count() by UserPrincipalName, bin(TimeGenerated, 5m)
| where FailureCount > 10

In this example, the rule only triggers if a single user experiences more than 10 failed sign-ins within a 5-minute window. This filters out accidental typos while capturing potential brute-force attacks.

Tip: The "Threshold" Strategy Always start with a conservative threshold and monitor for a week. If you find the rule is still producing too many false positives, increase the threshold or refine the query filters. Never disable a rule entirely if you can simply tune its sensitivity.


Not read yet

Microsoft Security Rules: Integrating External Signals

While scheduled rules rely on your own logic, Microsoft Security Rules leverage the intelligence built into the broader Microsoft ecosystem. These are essential for organizations that use Defender for Endpoint or Defender for Cloud.

Why Use These Instead of Scheduled Rules?

Microsoft security products are already tuned to detect complex threats. When you ingest these alerts into Sentinel, you are effectively "lifting" the intelligence of these products into your central monitoring dashboard.

Implementation Steps

  1. In the Analytics blade, click Create and select Microsoft security rule.
  2. Select the relevant product (e.g., Microsoft Defender for Endpoint).
  3. The rule will automatically import all alerts generated by that service.
  4. You can filter these alerts by severity or specific provider names if you only want to ingest high-priority items.

This approach is highly efficient because it reduces the need to write custom KQL for threats that Microsoft has already identified as malicious. It also ensures that the incident context—such as the severity level and MITRE mapping—is preserved from the source product.


Not read yet

Fusion Rules: The Advanced Detection Engine

Fusion is the "secret sauce" of Microsoft Sentinel. It is not a rule you write; it is a feature you enable. Fusion uses graph-based machine learning to connect dots that seem unrelated.

How Fusion Works

Consider a scenario where an attacker performs three different actions:

  1. They perform a series of failed logins from an unknown IP address.
  2. They successfully sign into an account.
  3. They perform a suspicious PowerShell command to download a script.

Individually, these might not trigger a high-severity alert. However, when combined, they represent a clear attack chain. Fusion identifies this pattern and bundles the low-fidelity alerts into a single, high-severity incident, significantly reducing the work required for an analyst to piece together the narrative.

Warning: Fusion Requirements Fusion requires you to ingest data from specific sources, such as Microsoft Entra ID Protection, Microsoft Defender for Endpoint, and Azure Activity logs. If you do not have these data connectors enabled, the Fusion engine will not have enough information to form a complete picture of an attack.


Not read yet

Machine Learning Behavioral Analytics (MLBA)

MLBA rules are designed to detect "low and slow" attacks or insider threats that don't follow a simple pattern. These rules learn the baseline behavior of your users and alert when something deviates from that baseline.

Key Use Cases for MLBA

  • Impossible Travel: A user logs in from New York and then from London 30 minutes later.
  • Atypical Resource Access: A user who usually accesses HR files suddenly starts downloading large volumes of data from the Engineering file share.
  • New Device Usage: A user logs in from a device they have never used before, particularly if that device is flagged as risky.

To use these effectively, you must ensure that your logs are properly mapped to the Common Event Format (CEF) or the appropriate Sentinel schemas. The quality of the machine learning output is directly proportional to the quality and history of the data you provide.


Not read yet

Comparison of Rule Types

Rule Type Complexity Customization Primary Use Case
Scheduled High High Custom logic, specific environment threats
Microsoft Security Low Low Ingesting alerts from Defender, Entra, etc.
Fusion Low None Detecting multi-stage, complex attacks
MLBA Medium Medium Anomaly detection, user behavior analysis

Best Practices for Rule Management

Managing analytics rules is a task that evolves as your environment changes. A rule that works perfectly today might become obsolete tomorrow as your infrastructure shifts to the cloud or as your applications change.

1. Maintain a Version Control System

Do not treat your KQL queries as disposable text. Store your queries in a Git repository (like Azure DevOps or GitHub). This allows you to track changes, roll back if a rule causes issues, and collaborate with your team on improvements.

2. Map to MITRE ATT&CK

Every rule you create should be mapped to the MITRE ATT&CK framework. This provides a visual representation of your security coverage. If your dashboard shows that you have zero detections for "Lateral Movement," you know exactly where to focus your next development sprint.

3. Regular Audits

Review your rules on a quarterly basis. Ask the following questions:

  • Is this rule still generating incidents?
  • Are the incidents generated by this rule actually being investigated?
  • Can we merge this rule with another one to reduce noise?
  • Are there any "stale" rules that haven't triggered in months?

4. Use Naming Conventions

Use a consistent naming convention for your rules. A good format includes the tactic, the threat type, and the platform. For example: [Persistence] - Unusual Scheduled Task Creation - Windows Server. This makes it much easier to sort and manage your analytics library.


Not read yet

Common Mistakes to Avoid

Even experienced SOC analysts fall into traps when writing detections. Here are some of the most common pitfalls:

The "Over-Filtering" Trap

It is tempting to filter out every possible edge case to reduce false positives. However, if you filter too much, you might inadvertently whitelist malicious activity. Always ensure that your suppression logic is narrow and specific to known-good behavior, rather than broad and generic.

Ignoring Data Latency

Logs don't always arrive in real-time. If you set your lookback period too short, you might miss logs that were delayed by network congestion or ingestion bottlenecks. A good rule of thumb is to set the lookback period slightly longer than the query frequency.

Hardcoding Values

Avoid hardcoding usernames, IP addresses, or hostnames directly into your KQL queries. Instead, use variables or reference external data sources (like Watchlists). If an attacker changes their IP address, a hardcoded rule becomes useless immediately.

Callout: Using Watchlists Watchlists are a powerful feature in Sentinel that allow you to upload lists of data (like a list of privileged service accounts) and use them in your queries. By using _GetWatchlist('PrivilegedAccounts'), your rules become dynamic and easier to maintain.


Not read yet

Designing for Scale: The Role of KQL Optimization

As your log volume grows, inefficient KQL queries can lead to slow incident generation and, in extreme cases, query timeouts. Writing "performant" KQL is a skill that separates junior analysts from experts.

Tips for Efficient KQL:

  • Filter Early: Always place your where clauses at the beginning of the query. By filtering rows early, you reduce the amount of data the engine needs to process for subsequent operations like join or summarize.
  • Select Specific Columns: Don't use * (select all). Only select the columns you actually need for your alert. This reduces the memory footprint of your query.
  • Use summarize Wisely: Summarizing large datasets can be resource-intensive. If you only need to check for a specific event, try to filter it down to the smallest possible time window before summarizing.

Example of an inefficient vs. efficient query:

Inefficient:

SecurityEvent
| extend Account = strcat(AccountDomain, "\\", Account)
| where Account == "ADMIN"

Efficient:

SecurityEvent
| where Account == "ADMIN"
| extend Account = strcat(AccountDomain, "\\", Account)

By filtering for the account name before performing the string concatenation, you avoid performing that operation on every single row in the table.


Not read yet

Integrating Threat Intelligence

Your analytics rules should not operate in a vacuum. By integrating Threat Intelligence (TI) feeds, you can automatically compare your logs against known malicious indicators (IOCs).

Sentinel allows you to ingest TI data from various sources (STIX/TAXII feeds, Microsoft, or third-party providers). You can then write rules that look for matches between your internal logs and these indicators.

// Look for network traffic to known malicious IPs
DeviceNetworkEvents
| where RemoteIP in (ThreatIntelligenceIndicator)
| project TimeGenerated, DeviceName, RemoteIP, IndicatorId

This approach is highly effective because it leverages global threat intelligence to protect your local environment. It is often the fastest way to identify "low-hanging fruit" attacks where the attacker is using publicly known infrastructure.


Putting It All Together: The SOC Workflow

To truly succeed with Sentinel, you must integrate these rule types into a cohesive workflow. A well-functioning SOC follows this cycle:

  1. Detection: An analytics rule (Scheduled, Security, Fusion, or MLBA) identifies a potential threat.
  2. Triaging: The incident is created, and an analyst reviews the evidence.
  3. Investigation: The analyst uses the investigation graph to see how the incident connects to other entities (users, devices, IPs).
  4. Remediation: The analyst takes action—blocking an IP, disabling a user, or isolating a device.
  5. Feedback: The analyst updates the analytics rule or adds a suppression to prevent similar false positives in the future.

This loop ensures that your detection strategy is always improving. If you are not feeding the results of your investigations back into the tuning of your rules, you are missing out on the most powerful feature of a SIEM: continuous improvement.


Not read yet

Key Takeaways

  • Diversity of Detection: Use a mix of Scheduled, Microsoft Security, Fusion, and MLBA rules to cover different stages of the attack lifecycle. Relying on only one type of rule will leave gaps in your coverage.
  • KQL is Essential: Investing time in learning and optimizing KQL is the single most important action for an analyst. Efficient queries lead to faster, more reliable detections.
  • Iterative Tuning: No rule is perfect on day one. Expect to tune, suppress, and adjust your rules based on real-world feedback. Use thresholds to manage noise.
  • Context is King: Always map your rules to the MITRE ATT&CK framework. This allows you to communicate your security posture effectively to stakeholders and identifies gaps in your coverage.
  • Automate where possible: Use Watchlists and Threat Intelligence to keep your rules dynamic. Hardcoding values makes your rules fragile and difficult to maintain.
  • Collaborate and Version: Treat your detection rules as code. Store them in version control and document the intent behind each rule so that other analysts understand why it exists.
  • Focus on the Lifecycle: Remember that detection is only one part of the process. The real value comes from the investigation and the subsequent feedback loop that improves your security posture over time.

By embracing these principles, you will move beyond simple alerts and build a proactive, intelligent defense system that scales with your organization's needs. Microsoft Sentinel provides the tools, but your strategic approach to analytics rules determines the efficacy of your security operations.

Not read yet

Each section gets a ✓ as you scroll through it. Tap the button to jump to the next one.