Docker-based security monitoring solution using Elasticsearch, Logstash, and Kibana (ELK Stack). Includes ready-to-use telemetry scripts for Linux, Windows, and macOS systems to monitor authentication events, network activity, and suspicious behavior.
π Complete Tutorial: For detailed explanations, security baseline interpretation, and advanced SIEM concepts, see our ELK Stack Security Monitoring Tutorial
- What is a SIEM?
- Quick Start
- Security Metrics Monitored
- Telemetry Scripts
- Kibana Setup
- Troubleshooting
- Automation
- Stack Management
- Resources
A Security Information and Event Management (SIEM) system aggregates and analyzes security logs from multiple sources to detect threats in real-time. This project provides a hands-on ELK Stack SIEM for:
- Learning security monitoring and threat detection concepts
- Building a home lab or proof-of-concept environment
- Understanding log aggregation, parsing, and visualization
- Practicing SOC analyst skills
Why ELK? Open-source, cost-free alternative to commercial solutions like Splunk, with the same core capabilities for learning and small-scale deployments.
- Docker Desktop installed and running
- Basic command line familiarity
git clone <repository-url>
cd ELK-Docker# Launch all containers
docker compose up -d
# Verify Elasticsearch is running
curl localhost:9200Access Points:
- Elasticsearch: http://localhost:9200
- Kibana: http://localhost:5601
Linux:
./scripts/telemetry/linux_telemetry.sh [HOST] [PORT]
# Example: ./scripts/telemetry/linux_telemetry.sh localhost 514macOS:
./scripts/telemetry/cyber_security_mvp.sh [HOST] [PORT]Windows (PowerShell as Administrator):
.\scripts\telemetry\windows_telemetry.ps1 [-TargetHost "HOST"] [-Port PORT]| Metric | Description | Baseline Range |
|---|---|---|
| Failed Logins | Authentication failures | 0-2/hour normal, >10/hour suspicious |
| Active Connections | Established TCP connections | 10-50 typical workstation |
| Network Processes | Processes with network activity | 5-20 baseline |
| Temp Files | New files in /tmp or %TEMP% | 0-5/hour normal |
| System Load | CPU load average | <1.0 baseline, >3.0 investigate |
- Authentication Events: Login failures, SSH sessions, sudo usage
- Network Activity: TCP connections, listening ports, active processes
- File Changes: New temporary files (malware staging indicator)
- System Performance: Load averages, CPU usage
Supports Ubuntu/Debian, RHEL/CentOS, and systemd-based distributions.
Usage:
./scripts/telemetry/linux_telemetry.sh [HOST] [PORT]Default: localhost:514
Collects: Failed logins, network connections, processes, /tmp files, load average, SSH sessions, sudo usage, listening ports
Uses macOS Unified Logging system.
Usage:
./scripts/telemetry/cyber_security_mvp.sh [HOST] [PORT]Collects: Failed auth, TCP connections, network processes, /tmp files, load average
Requires Administrator privileges.
Usage:
.\scripts\telemetry\windows_telemetry.ps1 -TargetHost "HOST" -Port PORTCollects: Failed logins (Event ID 4625), TCP connections, network processes, temp files, CPU usage
Test Syslog: scripts/setup/syslog_alert.sh - Sends test messages to verify connectivity
Standalone ES: scripts/setup/run-elasticsearch.sh - Run only Elasticsearch for testing
- Open Kibana: http://localhost:5601
- Go to Stack Management β Data Views
- Create new view:
- Pattern:
syslog-* - Timestamp:
@timestamp
- Pattern:
# Authentication events
syslog_program:"auth-monitor"
# High network activity (>50 connections)
syslog_program:"network-monitor" AND message:>50
# Files in temp directories
syslog_program:"file-monitor" AND NOT message:"0"
# High system load
syslog_program:"load-monitor" AND message:>2.0# Check indices
curl "localhost:9200/_cat/indices/syslog-*?v"
# Verify Logstash is listening
docker exec logstash01 netstat -tlun | grep 514
# Send test message
echo "<34>$(date '+%b %d %H:%M:%S') test myapp: Test" | nc -u localhost 514Ports <1024 require root/sudo:
sudo ./scripts/telemetry/linux_telemetry.shOr edit docker-compose.yml to use port 5140 instead.
# View logs
docker logs logstash01
docker logs es01
docker logs kibana01
# Restart services
docker compose restartπ Detailed Troubleshooting: See our complete troubleshooting guide for advanced debugging steps.
crontab -e
# Run every 5 minutes
*/5 * * * * /path/to/scripts/telemetry/linux_telemetry.sh localhost 514 >> /var/log/elk.log 2>&1- Create Basic Task
- Trigger: Daily, repeat every 5 minutes
- Action: Start program
- Program:
powershell.exe - Arguments:
-ExecutionPolicy Bypass -File "C:\path\to\windows_telemetry.ps1"
- Program:
# Start/Stop
docker compose up -d # Start all
docker compose down # Stop all
docker compose restart # Restart all
# View Logs
docker logs -f logstash01
docker logs -f es01
docker logs -f kibana01
# Clean Up (removes all data)
docker compose down -v# Cluster health
curl "localhost:9200/_cluster/health?pretty"
# List indices
curl "localhost:9200/_cat/indices?v"
# Search today's logs
curl "localhost:9200/syslog-$(date '+%Y.%m.%d')/_search?pretty&size=5"| Service | Port | Purpose |
|---|---|---|
| Elasticsearch | 9200 | Data storage and search |
| Kibana | 5601 | Visualization and dashboards |
| Logstash | 514 (TCP/UDP) | Syslog ingestion and parsing |
βββ docker-compose.yml # ELK stack configuration
βββ logstash/
β βββ pipeline/
β βββ logstash.conf # Grok patterns and parsing rules
βββ scripts/
β βββ telemetry/
β β βββ linux_telemetry.sh # Linux monitoring
β β βββ cyber_security_mvp.sh # macOS monitoring
β β βββ syslog_mac.sh # macOS (alternative)
β β βββ windows_telemetry.ps1 # Windows monitoring
β βββ setup/
β βββ run-elasticsearch.sh # Standalone ES
β βββ syslog_alert.sh # Test utility
βββ README.md
This hands-on project teaches:
- SIEM Fundamentals: Log aggregation, correlation, and analysis
- ELK Stack Architecture: How Elasticsearch, Logstash, and Kibana integrate
- Security Monitoring: Detecting authentication failures, network anomalies, suspicious activity
- Log Parsing: Syslog protocol and Grok patterns
- Data Visualization: Building dashboards with KQL queries
- Cross-Platform Scripting: Bash and PowerShell for security telemetry
Relevant for: SOC analyst training, Security+ certification labs, cybersecurity education, SIEM skill development
- ELK Stack Security Monitoring Tutorial - Complete guide with security baselines, advanced queries, and production deployment
- Elastic Stack Documentation
- Docker Compose Reference
Stack Version: Elasticsearch 9.1.3, Logstash 9.1.3, Kibana 9.1.3 License: Educational use Maintained by: Cyber Desserts