Elastic

Elastic (Elastic Stack)

One-liner: Open-source data analytics and SIEM platform built on Elasticsearch, Logstash, and Kibana (the ELK Stack).

🎯 What Is It?

Elastic (formerly known as ELK Stack) is a powerful, scalable platform for searching, analyzing, and visualizing large volumes of data in real-time. In cybersecurity, it's widely used as a SIEM solution for log aggregation, threat detection, and security monitoring in SOCs.

Company: Elastic (elastic.co)
License: Open Source (Apache 2.0) + Commercial features

🏽️ The ELK Stack Components

┌──────────────────────────────────┐
│       Data Sources          │
│  (Logs, Metrics, Events)   │
└────────────┬─────────────────────┘
             │
      ┌──────┴──────┐
      │   Beats /     │
      │  Logstash     │  ← Ingestion & Processing
      └──────┬──────┘
             │
      ┌──────┴──────┐
      │ Elasticsearch │  ← Storage & Search Engine
      └──────┬──────┘
             │
      ┌──────┴──────┐
      │   Kibana     │  ← Visualization & Dashboards
      └─────────────┘

1. Elasticsearch

2. Logstash

3. Kibana

4. Beats (Lightweight Shippers)

🛡️ Elastic as a SIEM

Elastic Security (Formerly Elastic SIEM)

Full-fledged SIEM solution with:

Key Features

1. Detection Rules

# Example: Detect suspicious PowerShell
rule:
  name: Suspicious PowerShell Execution
  query: |
    process.name: "powershell.exe" AND 
    process.command_line: (*-enc* OR *downloadstring*)
  severity: high
  mitre_attack: T1059.001

2. KQL (Kibana Query Language)

# Find failed SSH logins
event.action: "ssh_login" AND event.outcome: "failure"

# Detect process injection
process.name: "powershell.exe" AND 
process.command_line: *VirtualAllocEx*

# Network connections from suspicious process
network.direction: "outbound" AND 
process.parent.name: "winword.exe"

3. SIEM Timeline

4. Prebuilt Dashboards

🎯 Common Use Cases

1. Security Operations Center (SOC)

Data Sources:
  • [[Windows Event Logs]] (via Winlogbeat)
  • Sysmon logs
  • Firewall logs
  • Zeek network logs
  • Cloud logs (AWS CloudTrail, Azure AD)

Workflow:
  1. Logs → Elasticsearch
  2. Detection rules trigger alerts
  3. SOC analysts investigate in Kibana
  4. Incident Response initiated

2. Threat Hunting

# Hunt for Lateral Movement via RDP
event.code: 4624 AND winlog.event_data.LogonType: 10

# Detect [[DNS Tunneling]]
dns.question.name: *[a-f0-9]{20,}.*

3. Compliance & Audit Logging

4. Cloud Security

📈 Elastic vs Splunk

Feature Elastic Stack Splunk
Cost Open source (free tier) Expensive (per GB)
Scaling Horizontal (clusters) Vertical + horizontal
Query Language KQL, Lucene SPL (Search Processing Language)
Learning Curve Moderate Steep
Community Strong open-source Enterprise-focused
SIEM Features Elastic Security Splunk Enterprise Security
Best For Cost-conscious, cloud-native Enterprise, feature-rich

💻 Example: Setting Up Elastic SIEM

1. Install Elasticsearch

# Docker
docker run -d --name elasticsearch \
  -p 9200:9200 \
  -e "discovery.type=single-node" \
  docker.elastic.co/elasticsearch/elasticsearch:8.11.0

2. Install Kibana

docker run -d --name kibana \
  -p 5601:5601 \
  --link elasticsearch:elasticsearch \
  docker.elastic.co/kibana/kibana:8.11.0

3. Ship Windows Logs

# winlogbeat.yml
winlogbeat.event_logs:
  - name: Security
  - name: System
  - name: Application

output.elasticsearch:
  hosts: ["localhost:9200"]

4. Create Detection Rule

Kibana → Security → Rules → Create Rule

Query:
process.name: "powershell.exe" AND 
process.command_line: *-enc*

Severity: High
MITRE ATT&CK: T1059.001

🔧 Integration with Other Tools

🎤 Interview Angles

Q: What is the ELK Stack and how is it used in cybersecurity?

Q: How would you detect [[Lateral Movement]] with Elastic?

KQL Query:

event.code: 4624 AND 
winlog.event_data.LogonType: (3 OR 10) AND 
NOT source.ip: (10.0.0.0/8 OR 192.168.0.0/16)

Detects remote logons (Type 3 = network, Type 10 = RDP) from unexpected IPs.

Q: What's the difference between Elastic and Splunk?