A context-aware, lightweight security monitoring system for resource-constrained, single-operator environments (personal NAS, home labs, small-infrastructure setups).
Gamtinel collects logs from a few hosts, filters out noise, groups related events into attack sessions, and uses a local LLM to analyze each session in context and produce a Korean-language threat report. It is designed to run in the background on an ordinary laptop without a dedicated SOC or an enterprise SIEM.
Status: personal research / hobby project. Not production-hardened.
Enterprise SIEM/SOAR stacks assume large budgets, high-spec dedicated infrastructure, and a staffed security team to tune rules. A single operator running a NAS or a home lab has none of those, and ends up relying on default rule sets that produce heavy false positives. Gamtinel explores whether a local LLM can take over the context-reading part of a human analyst's job — reading a 10-minute window of events and judging whether it is normal operation, automated noise, or a real attack — cheaply enough to run alongside everything else on one machine.
logs (NAS / Ubuntu / honeypot)
│
▼
Scanner ──► Parser ──► PreFilter ──► SessionBuilder ──► local LLM ──► Markdown report
(noise cut, (groups events (Ollama) + SQLite record
WAF aggregate) into sessions,
kill-chain checks)
- Scanner — picks up new log files from a sync folder (catch-up on start, then every 5 minutes).
- Parser — normalizes NAS/Ubuntu syslog, auth, eBPF, and nginx-WAF JSON logs, plus Cowrie honeypot logs.
- PreFilter — drops routine daemon noise and aggregates high-volume WAF logs; flags WAF bypass and fuzzing patterns.
- SessionBuilder — groups events by source into time-bounded sessions and runs kill-chain cross-checks (e.g. WAF pass-through followed by a web-daemon shell command).
- LLM analysis — a local Ollama model classifies each expired session (tactical 10-minute view) or subnet (24-hour strategic view) and writes a report.
- Storage — SQLite with WAL mode; short-term raw events, threat alerts, and processing state. A web dashboard (
Dashboard.py) reads from it.
- Python 3.9+
- Ollama running locally with a model pulled (default:
llama3.1) - Python packages:
requests,psutil,plyer(optional, for desktop notifications)
pip install requests psutil plyer
ollama pull llama3.1Gamtinel reads configuration from environment variables. All are optional.
| Variable | Default | Purpose |
|---|---|---|
GAMTINEL_SYNC_ROOT |
~/Gamtinel_Sync |
Root folder where host logs are synced |
GAMTINEL_WORK_DIR |
~/Project_Gamtinel |
Working dir for DB, reports, temp files |
GAMTINEL_LLM_URL |
http://localhost:11434 |
Ollama endpoint |
GAMTINEL_LLM_MODEL |
llama3.1 |
Model name |
GAMTINEL_ADMIN_NAME |
Operator |
Operator name used in the LLM prompt context |
Expected sync-folder layout (see the comments at the bottom of Gamtinel.py):
<SYNC_ROOT>/NAS_Logs/YYYY-MM-DD/{system,conn}_hhmm.log
<SYNC_ROOT>/Ubuntu_Logs/YYYY-MM-DD/{syslog,auth,ebpf,nginx_waf}_hhmm.log
<SYNC_ROOT>/Honeypot_Logs/cowrie_backup_YYYYMMDD_0830.tar.gz
# 1. create your rule set from the example
cp rules.txt.example rules.txt # Windows: copy rules.txt.example rules.txt
# 2. run
python Gamtinel.pyOn start it runs a one-time catch-up pass over pending logs, then switches to a
passive mode that re-scans every 5 minutes. Press Enter during the startup delay to
skip the wait. Reports are written to <WORK_DIR>/reports/ as Markdown.
For safety, operational data is excluded via .gitignore and must never be committed:
gamtinel.dband WAL/SHM files — contain real attacker/host IPs and captured payloadsrules.txt— the live detection rule set (onlyrules.txt.exampleis published)reports/— generated reports with real IPs and attack content- any
*.log, honeypot archives, or synced log folders
If you clone and run this, keep your own rules.txt and data local.
- The
msvcrt-based startup key check is Windows-only; on other platforms remove or guard that block. - Detection thresholds (WAF bypass, fuzzing, kill-chain timing) are tuned for a low-traffic single-host setup and will need adjustment elsewhere.
- LLM output quality depends entirely on the local model you run.
No license yet. If you intend others to reuse this, add one (e.g. MIT).