# monicanr/hunny-honeypot architecture

> Architecture diagram of the GitHub repository monicanr/hunny-honeypot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/monicanr/hunny-honeypot
- Repository: https://github.com/monicanr/hunny-honeypot

## Overview

Hunny Do combines a functioning, authenticated PHP to-do and community app with a multi-layer web honeypot and host-level decoys. The main user flow is registration/login into the to-do app, with separate maze, leaderboard, chat, profile, and chatbot capabilities. Attack traffic is baited through advertised paths and decoy admin/trap pages, logged, and processed by an alert daemon. The README documents deployment and integrations beyond the sampled source; those relationships are cited to it, while unsampled implementation details are not inferred.

Main entry points: [`code/www/config.php`](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/config.php) (App services and logging), [`code/www/hundred-acre-admin/index.php`](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/hundred-acre-admin/index.php) (Layer 2 login), [`code/www/admin/index.php`](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/admin/index.php) (Layer 1 fake admin), [`config/opt/honeypot-alerts/honeypot_alerts.py`](https://github.com/monicanr/hunny-honeypot/blob/main/config/opt/honeypot-alerts/honeypot_alerts.py) (Alert processor)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["User application"]
  node_auth["Registration and login<br/>[register.php]"]
  node_todos["To-do list<br/>[index.php]"]
  node_maze["Maze game<br/>[maze.php]"]
  node_scores["Leaderboard<br/>[leaderboard.php]"]
  node_chat["Community chat<br/>[chat.php]"]
  node_bot["Pooh chatbot<br/>[pooh-bot.php]"]
  node_profile["Profile and uploads<br/>[profile.php]"]
  node_layout["Shared page layout<br/>[layout.php]"]
  node_config["App services and logging<br/>[config.php]"]
  node_jwt["JWT authentication<br/>[jwt.php]"]
end

subgraph group_traps["Honeypot layers"]
  node_robots["Discovery bait<br/>[robots.txt]"]
  node_fakeenv["Credential bait<br/>[.env]"]
  node_fakeadmin["Layer 1 fake admin<br/>[index.php]"]
  node_deepadmin["Layer 2 login<br/>[index.php]"]
  node_dashboard["Fake admin dashboard<br/>[dashboard.php]"]
  node_beacon["Interaction beacon<br/>[beacon.php]"]
  node_attackform["Attack classification traps<br/>[mad-hatter.php]"]
  node_trap["Deep trap page<br/>[trap.php]"]
end

subgraph group_ops["Detection and alerts"]
  node_app_log["Application and honeypot logs<br/>[config.php]"]
  node_alert_config["Alert configuration<br/>[config.py]"]
  node_alerts["Alert processor<br/>[honeypot_alerts.py]"]
end

subgraph group_hosting["Host services"]
  node_nginx["Nginx and ModSecurity<br/>[nginx.conf]"]
  node_canary["OpenCanary services<br/>[opencanary.conf]"]
  node_tarpit["SSH tarpit<br/>[endlessh.service]"]
  node_filebeat["Log shipping<br/>[filebeat.yml]"]
end

node_visitor(("Visitor"))
node_mysql[("MySQL database")]
node_gemini["Gemini API"]
node_email["Email service"]
node_telegram["Telegram"]
node_elastic[("Elasticsearch and Kibana")]

node_visitor -->|"registers or logs in"| node_auth
node_visitor -->|"manages tasks"| node_todos
node_visitor -->|"plays"| node_maze
node_visitor -->|"joins"| node_chat
node_visitor -->|"manages profile"| node_profile
node_auth -->|"uses app services"| node_config
node_todos -->|"reads and writes"| node_config
node_todos -->|"stores tasks"| node_mysql
node_maze -->|"uses app services"| node_config
node_maze -->|"links to scores"| node_scores
node_scores -->|"uses app services"| node_config
node_chat -->|"uses app services"| node_config
node_bot -->|"uses app services"| node_config
node_bot -->|"sends prompts"| node_gemini
node_profile -->|"uses app services"| node_config
node_layout -->|"uses app services"| node_config
node_config -->|"connects to"| node_mysql
node_config -->|"loads helper"| node_jwt
node_visitor -->|"discovers paths"| node_robots
node_visitor -->|"finds bait credentials"| node_fakeenv
node_robots -->|"advertises"| node_fakeadmin
node_fakeenv -->|"reveals panel path"| node_deepadmin
node_visitor -->|"probes credentials"| node_fakeadmin
node_fakeadmin -->|"leads deeper"| node_deepadmin
node_visitor -->|"attempts login"| node_deepadmin
node_deepadmin -->|"redirects after login"| node_dashboard
node_dashboard -.->|"records interaction"| node_beacon
node_visitor -->|"submits attack probes"| node_attackform
node_visitor -->|"visits trap"| node_trap
node_fakeadmin -->|"logs activity"| node_config
node_deepadmin -->|"logs attempts"| node_config
node_dashboard -->|"uses app services"| node_config
node_beacon -->|"logs interaction"| node_config
node_attackform -->|"uses app services"| node_config
node_trap -->|"uses app services"| node_config
node_config -->|"writes events"| node_app_log
node_alert_config -->|"provides credentials"| node_alerts
node_app_log -->|"supplies monitored events"| node_alerts
node_alerts -->|"sends alerts"| node_email
node_alerts -->|"sends alerts"| node_telegram
node_visitor -->|"sends web requests"| node_nginx
node_nginx -.->|"forwards app requests"| node_mysql
node_visitor -->|"probes fake services"| node_canary
node_visitor -->|"connects to SSH decoy"| node_tarpit
node_filebeat -->|"ships logs"| node_elastic

click node_auth "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/register.php"
click node_todos "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/index.php"
click node_maze "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/maze.php"
click node_scores "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/leaderboard.php"
click node_chat "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/chat.php"
click node_bot "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/pooh-bot.php"
click node_profile "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/profile.php"
click node_layout "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/layout.php"
click node_config "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/config.php"
click node_jwt "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/includes/jwt.php"
click node_robots "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/robots.txt"
click node_fakeenv "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/.env"
click node_fakeadmin "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/admin/index.php"
click node_deepadmin "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/hundred-acre-admin/index.php"
click node_dashboard "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/hundred-acre-admin/dashboard.php"
click node_beacon "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/hundred-acre-admin/beacon.php"
click node_attackform "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/mad-hatter.php"
click node_trap "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/trap.php"
click node_app_log "https://github.com/monicanr/hunny-honeypot/blob/main/code/www/config.php"
click node_alert_config "https://github.com/monicanr/hunny-honeypot/blob/main/config/opt/honeypot-alerts/config.py"
click node_alerts "https://github.com/monicanr/hunny-honeypot/blob/main/config/opt/honeypot-alerts/honeypot_alerts.py"
click node_nginx "https://github.com/monicanr/hunny-honeypot/blob/main/config/etc/nginx/nginx.conf"
click node_canary "https://github.com/monicanr/hunny-honeypot/blob/main/config/etc/opencanaryd/opencanary.conf"
click node_tarpit "https://github.com/monicanr/hunny-honeypot/blob/main/config/lib/systemd/system/endlessh.service"
click node_filebeat "https://github.com/monicanr/hunny-honeypot/blob/main/config/etc/filebeat/filebeat.yml"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_auth,node_todos,node_maze,node_scores,node_chat,node_bot,node_profile,node_layout,node_config,node_jwt toneBlue
class node_robots,node_fakeenv,node_fakeadmin,node_deepadmin,node_dashboard,node_beacon,node_attackform,node_trap,node_mysql,node_elastic toneAmber
class node_app_log,node_alert_config,node_alerts,node_gemini toneMint
class node_nginx,node_canary,node_tarpit,node_filebeat toneRose
class node_visitor,node_email,node_telegram toneIndigo
```

## Components

### User application

- [Registration and login](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/register.php): `code/www/register.php`
- [To-do list](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/index.php): `code/www/index.php`
- [Maze game](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/maze.php): `code/www/maze.php`
- [Leaderboard](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/leaderboard.php): `code/www/leaderboard.php`
- [Community chat](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/chat.php): `code/www/chat.php`
- [Pooh chatbot](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/pooh-bot.php): `code/www/pooh-bot.php`
- [Profile and uploads](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/profile.php): `code/www/profile.php`
- [Shared page layout](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/layout.php): `code/www/layout.php`
- [App services and logging](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/config.php): `code/www/config.php`
- [JWT authentication](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/includes/jwt.php): `code/www/includes/jwt.php`

### Honeypot layers

- [Discovery bait](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/robots.txt): `code/www/robots.txt`
- [Credential bait](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/.env): `code/www/.env`
- [Layer 1 fake admin](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/admin/index.php): `code/www/admin/index.php`
- [Layer 2 login](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/hundred-acre-admin/index.php): `code/www/hundred-acre-admin/index.php`
- [Fake admin dashboard](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/hundred-acre-admin/dashboard.php): `code/www/hundred-acre-admin/dashboard.php`
- [Interaction beacon](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/hundred-acre-admin/beacon.php): `code/www/hundred-acre-admin/beacon.php`
- [Attack classification traps](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/mad-hatter.php): `code/www/mad-hatter.php`
- [Deep trap page](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/trap.php): `code/www/trap.php`

### Detection and alerts

- [Application and honeypot logs](https://github.com/monicanr/hunny-honeypot/blob/main/code/www/config.php): `code/www/config.php`
- [Alert configuration](https://github.com/monicanr/hunny-honeypot/blob/main/config/opt/honeypot-alerts/config.py): `config/opt/honeypot-alerts/config.py`
- [Alert processor](https://github.com/monicanr/hunny-honeypot/blob/main/config/opt/honeypot-alerts/honeypot_alerts.py): `config/opt/honeypot-alerts/honeypot_alerts.py`

### Host services

- [Nginx and ModSecurity](https://github.com/monicanr/hunny-honeypot/blob/main/config/etc/nginx/nginx.conf): `config/etc/nginx/nginx.conf`
- [OpenCanary services](https://github.com/monicanr/hunny-honeypot/blob/main/config/etc/opencanaryd/opencanary.conf): `config/etc/opencanaryd/opencanary.conf`
- [SSH tarpit](https://github.com/monicanr/hunny-honeypot/blob/main/config/lib/systemd/system/endlessh.service): `config/lib/systemd/system/endlessh.service`
- [Log shipping](https://github.com/monicanr/hunny-honeypot/blob/main/config/etc/filebeat/filebeat.yml): `config/etc/filebeat/filebeat.yml`

### Other components

- **Visitor**
- **MySQL database**
- **Gemini API**
- **Email service**
- **Telegram**
- **Elasticsearch and Kibana**

## Connections

- Visitor → Registration and login: registers or logs in (evidence: `README.md`)
- Visitor → To-do list: manages tasks (evidence: `README.md`)
- Visitor → Maze game: plays (evidence: `README.md`)
- Visitor → Community chat: joins (evidence: `README.md`)
- Visitor → Profile and uploads: manages profile (evidence: `README.md`)
- Registration and login → App services and logging: uses app services (evidence: `code/www/register.php`)
- To-do list → App services and logging: reads and writes (evidence: `code/www/index.php`)
- To-do list → MySQL database: stores tasks (evidence: `code/www/index.php`)
- Maze game → App services and logging: uses app services (evidence: `code/www/maze.php`)
- Maze game → Leaderboard: links to scores (evidence: `code/www/maze.php`)
- Leaderboard → App services and logging: uses app services (evidence: `code/www/leaderboard.php`)
- Community chat → App services and logging: uses app services (evidence: `code/www/chat.php`)
- Pooh chatbot → App services and logging: uses app services (evidence: `code/www/pooh-bot.php`)
- Pooh chatbot → Gemini API: sends prompts (evidence: `README.md`)
- Profile and uploads → App services and logging: uses app services (evidence: `code/www/profile.php`)
- Shared page layout → App services and logging: uses app services (evidence: `code/www/layout.php`)
- App services and logging → MySQL database: connects to (evidence: `code/www/config.php`)
- App services and logging → JWT authentication: loads helper (evidence: `code/www/config.php`)
- Visitor → Discovery bait: discovers paths (evidence: `README.md`)
- Visitor → Credential bait: finds bait credentials (evidence: `README.md`)
- Discovery bait → Layer 1 fake admin: advertises (evidence: `README.md`)
- Credential bait → Layer 2 login: reveals panel path (evidence: `README.md`)
- Visitor → Layer 1 fake admin: probes credentials (evidence: `code/www/admin/index.php`)
- Layer 1 fake admin → Layer 2 login: leads deeper (evidence: `README.md`)
- Visitor → Layer 2 login: attempts login (evidence: `code/www/hundred-acre-admin/index.php`)
- Layer 2 login → Fake admin dashboard: redirects after login (evidence: `code/www/hundred-acre-admin/index.php`)
- Fake admin dashboard → Interaction beacon: records interaction
- Visitor → Attack classification traps: submits attack probes (evidence: `README.md`)
- Visitor → Deep trap page: visits trap (evidence: `README.md`)
- Layer 1 fake admin → App services and logging: logs activity (evidence: `code/www/admin/index.php`)
- Layer 2 login → App services and logging: logs attempts (evidence: `code/www/hundred-acre-admin/index.php`)
- Fake admin dashboard → App services and logging: uses app services (evidence: `code/www/hundred-acre-admin/dashboard.php`)
- Interaction beacon → App services and logging: logs interaction (evidence: `code/www/hundred-acre-admin/beacon.php`)
- Attack classification traps → App services and logging: uses app services (evidence: `code/www/mad-hatter.php`)
- Deep trap page → App services and logging: uses app services (evidence: `code/www/trap.php`)
- App services and logging → Application and honeypot logs: writes events (evidence: `code/www/config.php`)
- Alert configuration → Alert processor: provides credentials (evidence: `config/opt/honeypot-alerts/honeypot_alerts.py`)
- Application and honeypot logs → Alert processor: supplies monitored events (evidence: `config/opt/honeypot-alerts/honeypot_alerts.py`)
- Alert processor → Email service: sends alerts (evidence: `README.md`)
- Alert processor → Telegram: sends alerts (evidence: `README.md`)
- Visitor → Nginx and ModSecurity: sends web requests (evidence: `README.md`)
- Nginx and ModSecurity → MySQL database: forwards app requests
- Visitor → OpenCanary services: probes fake services (evidence: `README.md`)
- Visitor → SSH tarpit: connects to SSH decoy (evidence: `README.md`)
- Log shipping → Elasticsearch and Kibana: ships logs (evidence: `README.md`)
