Detection
How the honeypot system detects and identifies adversaries
Detection runs entirely inside the request path. Each non-static request is analysed by pure Lua rules, scored, and either forwarded to production or diverted to the session's honeypot pool. The same rules also produce the structured reasons used for logging and AbuseIPDB reporting.
Detection Pipeline Overview
The honeypot detection pipeline ingests adversary traffic and produces actionable detection signals through a layered chain, implemented as a series of pure Lua modules (no ngx.* dependency, unit-testable under a plain Lua interpreter) driving an adapter half that performs I/O:
- Traffic Capture — Nginx reverse proxy forwards HTTP requests;
pattern_analyzer.analyze_request()runs once per non-static request. - Lua Pattern Matching —
pattern_rules.luaandvulnerability_rules.luamatch request URIs, headers, and arguments against seeded CVE exploit patterns. - Suricata Correlation —
suricata_rules.luaparseseve.jsonalerts into structured records and converts them into risk-score deltas. - Risk Scoring —
pattern_analyzer.luaaccumulates scores;router.luaaccumulates onto a decaying session base. - Routing Decision —
router.lua's 12-stage decision pipeline diverts high-risk requests to isolated honeypot pool instances. - Reporting —
abuseipdb_rules.luagates external AbuseIPDB reporting and enriches comments with matched CVEs.
Explore Detection
Coverage Areas
Detection Stages
| Stage | Analyser | WSTG | Score Impact |
|---|---|---|---|
| 1 | URI pattern analysis | WSTG-INPV, CONF, INFO | +15 base per generic; +5..+80 per specific |
| 2 | Header analysis | WSTG-ATHN, AUTHZ | +50 flagged UA; +50 CVE header; +10 missing UA |
| 3 | CVE pattern matching | WSTG-AUTHZ, INPV | +40 per CVE matched |
| 4 | IP reputation + rate | — | +variable (threat_intel); +20 high rate |
| 5 | Request method | WSTG-INPV | +10 OPTIONS/TRACE; +15 override |
| 6 | Automation detection | WSTG-INFO, ATHN | +5..+30 per tool; +15 rapid streak |
| 6b | AJAX upload analysis | WSTG-INPV-10 | Variable (upload_rules) |
| 7 | Prompt-injection probe | — | +filter risk/2 |
Thresholds & Scaling
- Honeypot threshold: 80 (raised from 50 to reduce false positives)
- Max risk score: 100 (hard cap)
- IP reputation cap: 10 per request on shared (NAT) addresses
- Decay half-life: 300s, scaled by offense count via
decay_policy.lua - Permaflag: After 5 offenses or a single request scoring 100
Honest Assessment
Strengths: Multi-layered detection (12 routing stages), explainable scoring, severity-graded Suricata integration, decay system prevents permanent poisoning, NAT protection, sophistication classification.
Limitations: Same-host Suricata testing gap (unverified against genuine external traffic), threshold tuning needed for legitimate API clients, generic pattern false positives (historical), decay complexity (4 tunable params), honeytoken coverage (only 5 types), no ML, Suricata rule maintenance (70+ SIDs).