Modern IT environments generate millions of log events every day from firewalls, servers, cloud consoles, and endpoint detection agents. Reviewing these logs individually is impossible, while leaving them unmonitored guarantees that attackers can operate inside your perimeter undetected. A Security Information and Event Management (SIEM) platform solves this challenge by centralizing data, standardizing formats, and monitoring for suspicious activity.
Understanding how a SIEM processes data is the first step toward effective security operations. In this guide, you will learn the core mechanics of a SIEM and walk through the process of writing, testing, and deploying your first automated detection rule.
What Does a SIEM Actually Do?
At its core, a SIEM aggregates security telemetry across your entire infrastructure to give analysts a single pane of glass for monitoring and incident response. Rather than functioning as a passive archive, an active SIEM converts unstructured raw text into structured, queryable data. Its operational pipeline consists of five key stages:
- Ingestion: The SIEM collects logs via lightweight agents, syslog forwarders, API integrations, and event streaming protocols.
- Parsing and Normalization: Raw log messages arrive in hundreds of distinct formats. The SIEM strips extraneous formatting and maps common values to standard field names (for example, mapping Windows
TargetUserNameand Linuxuserto a universaluser.namefield). - Indexing and Storage: Parsed records are stored in high-performance databases, allowing analysts to search months of historical activity in seconds.
- Correlation and Detection: Automated engines run continuous queries against incoming streams to match known indicators of compromise (IOCs) or patterns of suspicious behavior.
- Alerting: When a detection rule triggers, the SIEM generates an alert, assigning a severity score and routing the case to a security analyst for triage.
The Anatomy of a Detection Rule
A detection rule is an automated query configured to run on a scheduled interval or against a streaming event bus. Rather than searching for single files or generic error messages, robust detection rules target specific attacker behaviors documented in frameworks such as MITRE ATT&CK.
Every effective detection rule contains three critical elements:
- Log Source Definition: Specifies where the data originates, such as operating system authentication logs, DNS query logs, or cloud audit trails.
- Detection Logic: The conditional statements, regular expressions, and threshold counters that distinguish malicious activity from benign operational noise.
- Metadata and Triage Context: Information that helps the responding analyst understand the alert, including the MITRE ATT&CK technique ID, severity level, description, and initial containment steps.
Writing Your First Rule: Detecting Local Account Enumeration
To make detection rules portable across platforms, industry practitioners use Sigma. Sigma is an open-source, vendor-agnostic signature format written in YAML. You can convert a single Sigma rule into queries for Splunk, Elastic, Microsoft Sentinel, or raw SQL.
In this example, we will write a detection rule to catch an adversary attempting discovery via the Windows command line. Attackers often run the built-in utility net.exe or net1.exe with the arguments user or localgroup to list local accounts immediately after compromising a system (MITRE ATT&CK Technique T1087.001).
Step 1: Define Metadata and Data Sources
Start by naming your rule, defining its purpose, and pointing it to the relevant data source. For process creation monitoring on Windows, security teams rely on Windows Security Event ID 4688 or Sysmon Event ID 1.
title: Local User Enumeration via Net Utility
id: 7b2a9c34-8d21-4f40-b6a3-2c1a4e9b8f10
status: stable
description: Detects execution of net.exe or net1.exe to list local user accounts
author: SOC Analyst
references:
- https://attack.mitre.org/techniques/T1087/001/
tags:
- attack.discovery
- attack.t1087.001
logsource:
category: process_creation
product: windowsStep 2: Construct the Detection Logic
Next, define the criteria that must match. You need to identify the executable name and inspect the command-line arguments. Attackers may call net.exe or net1.exe, so your selection must account for both process names and verify that the command contains the argument user.
detection:
selection_process:
Image|endswith:
- '\net.exe'
- '\net1.exe'
selection_argument:
CommandLine|contains:
- ' user'
condition: selection_process and selection_argument
falsepositives:
- Administrative scripts executing system inventories
- Third-party deployment software auditing workstation state
level: lowStep 3: Convert the Rule for Your Target SIEM
Because Sigma is standard YAML, you can convert it into your SIEM's proprietary query language using tools like sigma-cli. For instance, translating the above rule into Splunk's Search Processing Language (SPL) yields a search similar to the following:
index=windows (Image="*\\net.exe" OR Image="*\\net1.exe") CommandLine="* user*"For Microsoft Sentinel (KQL), the equivalent logic translates to:
SecurityEvent
| where EventID == 4688
| where Process endswith "\\net.exe" or Process endswith "\\net1.exe"
| where CommandLine has "user"Testing, Tuning, and Avoiding False Positives
Never deploy a new detection rule directly into an active paging queue. Poorly vetted rules flood analysts with notifications, producing alert fatigue that leads to missed incidents. Use this validation cycle instead:
- Historical Backtesting: Run the query against 30 to 60 days of historical logs. If the query returns thousands of matches, it is too broad for an alert and requires refinement.
- Filter Legitimate Noise: Identify recurring administrative tools or automated management scripts that trigger the rule. Add explicit exclusions targeting specific parent processes, signed hashes, or service accounts.
- Controlled Execution: In an isolated lab or during scheduled testing, run the exact command string you want to catch. Confirm that the SIEM receives the event and correctly triggers the alert within your expected latency window.
- Silent Staging: Deploy the rule to your production SIEM in "silent" or "test" mode for one week. Review matches daily to evaluate fidelity before enabling active ticket creation.
Common Mistakes in SIEM Management
Teams building out detection pipelines frequently encounter three operational pitfalls:
- Collecting logs without a use case: Ingesting massive data streams without active detection rules wastes storage budgets and slows search performance. Prioritize telemetry that directly supports high-risk detection scenarios.
- Relying entirely on out-of-the-box rules: Pre-built vendor rules provide a baseline, but they cannot account for your organization's custom software, naming conventions, or risk profile. Every environment requires tuning.
- Creating alerts without runbooks: An alert without triage instructions causes confusion. Document where the host is located, what artifacts to verify next, and when an analyst should isolate the endpoint.
Implementation Checklist
Use this workflow to implement and maintain new SIEM detections:
- Verify that target systems forward required event IDs with command-line auditing enabled.
- Map the targeted malicious activity to a specific MITRE ATT&CK technique.
- Write vendor-neutral logic in Sigma format to document your detection criteria.
- Backtest the query against historical log retention to assess event volume.
- Filter authorized administration tools, service accounts, and benign scripts.
- Add an alert description and a step-by-step triage runbook for the response team.
- Review and validate rule performance on a quarterly schedule.





