Tools
T1654Elastic Security
A comprehensive guide to Elastic Security (Elastic SIEM) — deployment, detection rules, Kibana visualizations, EQL queries, and how analysts use the Elastic stack for SOC operations.
View on Graph
What Elastic Security Is and Why Analysts Use It
- Elastic Security is the SIEM module built on top of the Elastic Stack (Elasticsearch, Kibana, Logstash, Beats/Fleet). It ingests security telemetry — logs, network data, endpoint data — and provides detection, investigation, and response capabilities.
- MITRE ATT&CK maps Elastic Security’s core function to
T1654(Log Enumeration) — the SIEM is the central platform where logs from all sources are stored, indexed, and queried. - Unlike proprietary SIEMs (Splunk, Sentinel), Elastic is open-source under the Elastic License or SSPL (depending on version). The free tier includes detection rules, case management, and Kibana dashboards.
- Elastic Security integrates natively with Elastic Agent (for endpoint data), Fleet (agent management), and the Elastic Detection Rules repository (1,000+ pre-built rules mapped to MITRE ATT&CK).
Architecture — Elastic Stack for SIEM
| Component | Role | Deployment Model |
|---|---|---|
| Elasticsearch | Data store — indexes all logs and events in sharded indices | Cluster (3+ nodes recommended for production) |
| Kibana | Visualization, dashboarding, detection rule management, case management | Web UI connected to Elasticsearch |
| Elastic Agent | Unified agent — collects logs, metrics, endpoint data, and runs on Windows/Linux/macOS | Fleet-managed or standalone |
| Fleet Server | Manages Elastic Agent policies — deploys integrations, updates configs | Central server |
| Detection Engine | Runs detection rules against ingested data — alert generation, correlation | Kibana built-in |
| Endgame/Elastic Defend | EDR module — endpoint detection and prevention | Elastic Agent integration |
Minimum SIEM Deployment
# Docker Compose — single-node Elastic SIEM stack
# elasticsearch.yml
cluster.name: "wyzsec-siem"
network.host: 0.0.0.0
xpack.security.enabled: true
xpack.security.authc.api_key.enabled: true
# Start Elasticsearch and Kibana
docker compose up -d elasticsearch kibana
# Enroll an Elastic Agent from a Windows endpoint
# (download agent from Kibana → Fleet → Add Agent)
elastic-agent.exe enroll --url=https://siem.example.com:8220 \
--enrollment-token=TOKEN_FROM_FLEET
elastic-agent.exe run
Detection Rules — The Built-In Library
Elastic Security ships with 1,000+ pre-built detection rules mapped to MITRE ATT&CK tactic, technique, and sub-technique.
Rule Types
| Rule Type | Description | Performance | Example |
|---|---|---|---|
| Query | Matches a single event field against a query condition | Fastest | event.code: 4625 (failed login) |
| Threshold | Fires when a field value exceeds a count threshold | Fast | event.code: 4625 with threshold 10 (brute force) |
| EQL (Event Query Language) | Sequence-based — matches a pattern of events | Moderate | Sequence of process creation + network connection |
| Machine Learning | Anomaly detection using ML jobs | Resource intensive | Unusual process execution patterns |
| Indicator Match | Matches events against threat intelligence indicators | Moderate | File hash match against threat feed |
| Correlation | Matches multiple rules firing within a time window | Complex | Process injection rule + lateral movement rule |
Key Pre-Built Rule Families
| Rule Category | MITRE Tactics | What It Detects |
|---|---|---|
Initial Access | TA0001 | Phishing, exploitation, external service access |
Execution | TA0002 | PowerShell abuse, script execution, LOLBins |
Persistence | TA0003 | Registry Run keys, scheduled tasks, services |
Privilege Escalation | TA0004 | UAC bypass, token manipulation, sudo abuse |
Defense Evasion | TA0005 | Process injection, disable security tools, obfuscation |
Credential Access | TA0006 | LSASS access, Kerberos attacks, credential dumping (see Mimikatz) |
Discovery | TA0007 | Account enumeration, network scanning, process listing |
Lateral Movement | TA0008 | RDP, PsExec, WMI, SMB abuse |
Command & Control | TA0011 | Beaconing, DNS tunneling, non-standard ports |
Exfiltration | TA0010 | Large data transfers, archive creation |
Impact | TA0040 | Ransomware, data destruction, service stop |
EQL — Event Query Language
EQL is Elastic’s sequence-based query language — it finds patterns across events rather than matching individual events.
Core EQL Patterns
| Pattern | EQL Query | What It Detects |
|---|---|---|
| Sequence | sequence by process.pid [process where event.type == "start"] [network where event.type == "connection"] | Process creation followed by network connection |
| Join | process where event.type == "start" and process.name == "powershell.exe" and process.command_line : "* -enc *" | PowerShell with encoded command |
| Pipeline | file where event.type == "creation" and file.path : "*\\Users\\*\\AppData\\Local\\Temp\\*.exe" | File creation in Temp directory |
| Time-based | sequence with maxspan=5m [process where process.name == "winword.exe"] [network where event.type == "connection" and network.protocol == "dns"] | Network connection within 5 min of Word opening |
Example — Detect Process Injection via EQL (Sysmon provides the underlying events)
// Detection: Remote thread creation (Sysmon Event 8)
// from an unexpected source process
sequence with maxspan=10s
[process where event.type == "start" and
process.name : ("winword.exe", "excel.exe", "powerpnt.exe",
"wmiprvse.exe", "rundll32.exe")]
[process where event.type == "info" and
event.code == "8"] // Sysmon Event 8 — CreateRemoteThread
Example — Detect Lateral Movement via EQL
// Detection: Lateral movement via PsExec
// Event 4688 (process creation) + Event 5140 (SMB share access)
sequence with maxspan=1m
[file where event.type == "creation" and
file.path : "\\\\*\\ADMIN$\\*" and
file.name : ("PSEXESVC.exe", "psexec.exe")]
[process where event.type == "start" and
process.name == "PSEXESVC.exe"]
Kibana Visualization — Building SOC Dashboards
Essential Dashboards for SOC
| Dashboard | What It Shows | Key Visualizations |
|---|---|---|
| Authentication Summary | Login success/failure by source IP, user, location | Line chart (time breakdown), pie chart (logon type), table (top failure sources) |
| Network Activity | Top talkers, allowed vs blocked traffic, protocol distribution | Data table (top connections), gauge (bandwidth), heatmap (protocol x source) |
| Endpoint Activity | Process creation trends, alert volume per host, unusual parents | Treemap (parent-child), bar chart (top executables), table (new executables) |
| Threat Detection | Alert volume by rule, severity, MITRE tactic | Bar chart (alerts by rule), pie chart (severity), stacked bar (tactic trends) |
| Hunting — Anomalies | Unusual process starts, logon times, data transfers | Single metric (total anomalies), table (details per anomaly) |
Creating a Custom Lens (Example — Top Failed Logins)
Index: logs-endpoint-events-*
Metric: count
Breakdown by: source.ip
Filter: event.code: 4625
Time range: Last 24 hours
Sort: Count descending
Limit: 10
Agent Management with Fleet
Fleet is the centralized management console for all Elastic Agents.
| Fleet Feature | What It Does | How Analysts Use It |
|---|---|---|
| Agent policy | Defines what data the agent collects | Configure log collection, enable/disable integrations |
| Integration | Pre-built data collectors (Windows, Network, AWS, etc.) | One-click enable data sources |
| Upgrade | Remotely upgrade Elastic Agent versions | Keep agents current without manual intervention |
| Unenroll | Remove an agent from management | Retire old endpoints, replace agents |
| Diagnostics | Collect agent status and health data | Troubleshoot missing data, agent errors |
Sample Detection Rule — Custom Rule
{
"author": ["WYZSec"],
"description": "Detect WMIPrvSE spawning a suspicious child process (LOLBins / lateral movement)",
"false_positives": ["Legitimate WMI queries for system administration"],
"from": "now-360m",
"index": ["logs-endpoint.events.process-*"],
"language": "kuery",
"name": "Suspicious WMI Process Child",
"query": "event.category:process and event.type:start and process.parent.name:WmiPrvSE.exe and (process.name:(powershell.exe or cmd.exe or wscript.exe or cscript.exe or mshta.exe or regsvr32.exe) or process.args:("*-enc*" or "DownloadString"))",
"risk_score": 73,
"rule_id": "WYZ-0001",
"severity": "high",
"tags": ["T1047", "lateral_movement"],
"type": "query",
"version": 1
}
Related
- Azure Sentinel — detection and response for T1654 techniques
- CyberChef — detection and response for T1654 techniques
- EDR Basics — detection and response for T1059, T1003, T1055, T1204, T1562 techniques
- Log Sources Overview — covers the log sources overview concepts
- Living-off-the-Land Binaries — how living-off-the-land binaries attacks work and how to detect them
