SentinelIQ is a Security Information and Event Management system built entirely from scratch β no Elastic, no Splunk, no pre-built detection libraries. It captures live network traffic, ingests Linux system logs from remote machines, runs everything through a trained LSTM model and a 31-rule correlation engine, enriches every alert with MITRE ATT&CK mappings and real-time threat intelligence, and automatically blocks attackers on both the local Windows firewall and a remote Linux host over SSH.
When ransomware is confirmed, it can network-isolate or shut down the victim machine before encryption spreads.
NETWORK PATH LOG PATH
ββββββββββββββββββββββββββββ ββββββββββββββββββββββββββββββββββββββ
tshark captures live traffic ubuntu_forwarder.py tails log files
β /var/log/auth.log Β· nginx Β· syslog
βΌ β HTTP POST batches
flow_extractor.py βΌ
PCAP β 80-feature flow vectors log_collector.py
β AuthLogParser Β· NginxLogParser
βΌ SyslogParser Β· UA fingerprinting
predictor.py (LSTM) β
PyTorch Β· 2 layers Β· hidden=64 β
CICIDS2017 Β· 15 attack classes β
β (predicted_label, confidence) β
β β
βΌ βΌ
NetworkFlowNormalizer raw event β UnifiedLog
wraps prediction into UnifiedLog { event_type, src_ip, message }
{ predicted_label, confidence, no ML label β rule fires on count
event_type, src_ip, dst_ip } β
β β
ββββββββββββββββ¬βββββββββββββββββββββββββββ
βΌ
UnifiedLog (common schema for all sources)
β
βΌ
Correlation Engine (31 rules)
sliding-window counts per (event_type, src_ip)
ML confidence check β count threshold check β alert
per-class thresholds Β· 60s alert suppressor
β
βΌ
Threat Intel enrichment (async, non-blocking)
ip-api.com geolocation Β· AbuseIPDB reputation Β· 1h cache
β
βββββββ΄βββββββ
βΌ βΌ
PostgreSQL Active Response
7 tables Windows Firewall (PowerShell)
SSH β iptables / ufw (Linux)
Kill Switch (isolate / shutdown)
β
βΌ
React Dashboard
Live alerts Β· Threat Globe Β· MITRE heatmap Β· Log stream
A two-layer LSTM (hidden_dim=64, seq_len=5 flows) trained on the Canadian Institute for Cybersecurity 2017 dataset. Classifies network flows into 15 attack categories in real-time. Each class has its own minimum confidence threshold to suppress false positives on inherently noisy traffic patterns β DDoS requires 0.85 confidence, brute force 0.72. A post-processing layer applies hard constraints the model cannot learn from flow statistics alone: FTP brute force must target port 21, UDP traffic cannot be a SlowHTTP attack, short web flows are directory scanning not DoS.
Classes: DoS Slowloris Β· DoS Hulk Β· DoS GoldenEye Β· DoS Slowhttptest Β· DDoS Β· SSH-Patator Β· FTP-Patator Β· PortScan Β· Heartbleed Β· Web AttackβBrute Force Β· Web AttackβXSS Β· Web AttackβSQL Injection Β· Infiltration Β· Bot
A sliding-window event counter that groups events by source IP against time-windowed thresholds, with prefix-matching rule families and a per-(IP, rule) suppressor to prevent alert storms.
| Severity | Count | Examples |
|---|---|---|
| CRITICAL | 10 | SQL injection, Heartbleed, DDoS, root login, ransomware VSS deletion, mass encryption |
| HIGH | 10 | SSH/FTP brute force, web scanner UA, privilege escalation via sudo, path traversal |
| MEDIUM | 7 | Port scan, XSS, 4xx flood (directory probe), SSH invalid user |
| LOW | 4 | First SSH failure, first invalid username β early-warning reconnaissance signals |
Rules R030 and R031 (ransomware detection) arm the Kill Switch in addition to generating an alert.
Every alert is automatically tagged with tactic, technique ID, technique name, and kill chain stage across 9 MITRE tactics. The dashboard renders a kill chain coverage heatmap.
| Tactic | Techniques |
|---|---|
| Reconnaissance | T1046 Network Service Discovery |
| Initial Access | T1189 Drive-by Β· T1190 Exploit Public App |
| Credential Access | T1110 Brute Force Β· T1552.004 Heartbleed |
| Privilege Escalation | T1548.003 Sudo abuse |
| Discovery | T1083 File/Directory (path traversal) |
| Lateral Movement | T1210 Remote Services exploitation |
| Command & Control | T1071.001 Application Layer Protocol |
| Defense Evasion | T1562 Impair Defenses |
| Impact | T1499 DoS Β· T1498 DDoS Β· T1486 Ransomware Β· T1490 VSS deletion |
ubuntu_forwarder.py runs on any Linux host, tails four log sources in real-time, batches every 2 seconds, and ships to the SIEM over HTTP. Handles log rotation, syslog noise pre-filtering, and PCAP upload via tcpdump. Zero external dependencies β standard library only.
| Source | What it catches |
|---|---|
/var/log/auth.log |
SSH failures, invalid users, root login attempts, sudo commands |
/var/log/nginx/access.log |
SQL injection, XSS, path traversal, scanner User-Agents, 4xx floods |
/var/log/apache2/access.log |
Same as nginx |
/var/log/syslog |
UFW blocks, service failures, OOM killer, iptables events (keyword pre-filtered) |
Detection triggers enforcement immediately through registered callbacks:
- Windows Firewall β
New-NetFirewallRulevia PowerShell blocks attacker IPs on the SIEM machine - Remote Linux firewall β SSH to victim machine, executes
iptables -I INPUT -s {ip} -j DROPorufw insert 1 deny from {ip} - SSH circuit breaker β opens after 3 consecutive SSH failures, auto-resets after 120 seconds; prevents 20-second thread hangs when victim VM is offline
- HTTP rate limiting β 150 requests per 30s triggers auto-ban; 16 attack-tool User-Agents (sqlmap, nikto, hydra, metasploit, nucleiβ¦) are auto-banned on first request
- Analyst controls β manual ban/unban per IP, flush all blocks by device, live ban list in dashboard
Ransomware detection (Volume Shadow Copy deletion or mass file encryption) triggers an SSH response that runs in a daemon thread β never blocking the alert pipeline:
- Isolate β drops all iptables traffic except the analyst's SSH port; machine stays up for memory forensics and disk imaging
- Shutdown β
shutdown -h nowβ stops encryption spread immediately
Every action is written to an in-process audit log with timestamp, action, host, reason, and success/failure status.
Every alert's source IP is asynchronously enriched after alert persistence (never blocking):
- Geolocation via ip-api.com β country, city, ISP, VPN/proxy flag (free, no key)
- Reputation via AbuseIPDB β confidence score 0β100, total community reports, TOR exit node flag
- Caching β in-memory, 1-hour TTL, 2000-entry FIFO limit to cap memory on high-volume deployments
- Private/RFC1918 IPs are skipped automatically
| Layer | Technology |
|---|---|
| Machine Learning | PyTorch Β· scikit-learn Β· CICIDS2017 |
| Backend API | Python 3.11 Β· FastAPI Β· uvicorn Β· asyncio |
| Database | PostgreSQL Β· SQLAlchemy async Β· asyncpg |
| Packet capture | tshark (Windows) Β· tcpdump (Linux) |
| Frontend | React 18 Β· Tailwind CSS Β· lucide-react |
| Authentication | JWT Β· bcrypt |
| Threat Intel | aiohttp Β· ip-api.com Β· AbuseIPDB |
| Remote response | OpenSSH Β· iptables Β· ufw Β· PowerShell |
sentineliq/
βββ backend/
β βββ src/
β β βββ main.py # FastAPI app β 40+ endpoints, capture loop, response orchestration
β β βββ lstm_model.py # PyTorch LSTM architecture
β β βββ predictor.py # Inference pipeline with per-class confidence filtering
β β βββ flow_extractor.py # PCAP β network flow feature vectors
β β βββ traffic_filter.py # Pre-inference noise filter + post-process business rules
β βββ core/
β β βββ correlation.py # 31-rule sliding-window engine, thread-safe
β β βββ ingestion.py # Log parsers + UnifiedLog schema
β β βββ log_collector.py # Advanced auth/nginx/syslog parsers, UA fingerprinting
β β βββ mitre.py # MITRE ATT&CK mappings β all 15 CICIDS classes + 18 event types
β β βββ threat_intel.py # Async IP enrichment with in-memory cache
β β βββ active_defense.py # In-memory bans, rate limiting, firewall callbacks
β β βββ kill_switch.py # Ransomware response β isolate or shutdown via SSH
β β βββ auth.py # JWT authentication
β βββ database.py # 7-table ORM schema
β βββ config.py # Pydantic settings loaded from .env
βββ frontend/src/
β βββ App.jsx # Main dashboard β live alert stream, filtering, stats
β βββ components/
β βββ AlertDetail.jsx # Alert detail β MITRE, threat intel, timeline, response actions
β βββ ThreatGlobe.jsx # Geographic attack source visualization
β βββ LogExplorer.jsx # Real-time normalized log stream
β βββ ConfigPanel.jsx # Live threshold and capture interface controls
βββ ubuntu_forwarder.py # Standalone Linux agent β zero dependencies
ββββββββββββββββββββββββ 192.168.56.0/24 ββββββββββββββββββββββββ
β Windows 10 Host ββββββββββββββββββββββββΊβ Ubuntu 22.04 VM β
β SIEM + ML Server β β Victim / Target β
β 192.168.56.1 β β 192.168.56.200 β
β ββββ log batches βββββββββ β
β tshark (capture) ββββ PCAP windows ββββββββ ubuntu_forwarder β
β FastAPI backend βββββ SSH iptables βββββββΊβ tcpdump Β· auth.log β
β React dashboard β β nginx Β· syslog β
ββββββββββββββββββββββββ ββββββββββββββββββββββββ
β²
ββββββββββββ΄ββββββββββ
β Kali Linux VM β
β 192.168.56.101 β
β Attack source β
ββββββββββββββββββββββ
Getting a model to fire on attacks is straightforward. Keeping it quiet on legitimate traffic is the engineering challenge. SentinelIQ handles this at three independent layers:
Pre-inference filter β drops DNS, DHCP, NTP, mDNS, SSDP, LLMNR, multicast, subnet broadcasts (*.255), and CDN prefixes (Google, Cloudflare, AWS, GitHub, Microsoft, Fastly) before data reaches the model.
Per-class confidence thresholds β DDoS requires 0.85, DoS variants 0.70β0.82, brute force 0.72. Classes the model finds ambiguous get higher bars.
Business-rule post-processing β hard constraints the model cannot infer from flow statistics:
- UDP flows cannot be Slowhttp attacks
- FTP brute force must target port 21; web attacks must target 80/443/8080/8443
- Router IPs need 0.98 confidence before any DoS alert fires
- Flows with fewer than 15 packets labeled as DoS/DDoS are re-labeled BENIGN (these are directory brute-force connections, not flood attacks)
- Python 3.11+, Node.js 18+, PostgreSQL
- Wireshark / tshark (Windows) or tcpdump (Linux)
cd backend
pip install -r requirements.txt
cp .env.example .env
# Set DB credentials, ABUSEIPDB_API_KEY, SMTP settings, REMOTE_RESPONSE_HOST
uvicorn src.main:app --host 0.0.0.0 --port 8000cd frontend
npm install
npm start
# β http://localhost:3000 (default: admin / admin)# Run on the Linux host to monitor
sudo python3 ubuntu_forwarder.py \
--siem http://<SIEM_IP>:8000 \
--device-id production-servercd backend/src
python log_simulator.py # Auth log attack sequences
python attack_simulator_multi_ip.py # Multi-source network attacks| Variable | Purpose | Default |
|---|---|---|
DB_HOST/PORT/NAME/USER/PASSWORD |
PostgreSQL | localhost / sentineliq |
SECRET_KEY |
JWT signing | change in production |
ABUSEIPDB_API_KEY |
IP reputation | empty |
SMTP_USER / SMTP_PASSWORD |
Email alerts | empty |
REMOTE_RESPONSE_ENABLED |
SSHβLinux firewall | false |
REMOTE_RESPONSE_HOST |
Linux host IP to protect | β |
REMOTE_RESPONSE_BACKEND |
iptables or ufw |
iptables |
KILL_SWITCH_ENABLED |
Arm ransomware kill switch | false |
KILL_SWITCH_ACTION |
isolate or shutdown |
isolate |
SENTINELIQ_CAPTURE_INTERFACE |
tshark interface index | 4 |
Oussama Aouass β Final Year Cybersecurity Engineering Project
Every component built from scratch. No managed detection libraries. No pre-built SIEM engines.