# rudrakadel/honeypie architecture

> Architecture diagram of the GitHub repository rudrakadel/honeypie, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-06-07). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rudrakadel/honeypie
- Repository: https://github.com/rudrakadel/honeypie

## Overview

##### Project type and purpose
- HoneyPie is a Python-based honeypot suite—a security research tool that emulates vulnerable SSH and HTTP services, captures attacker behavior, and optionally presents a web dashboard for analyzing logs.

##### File structure
- Top-level scripts:
- honeypy.py      – CLI entry point; launches SSH and/or HTTP honeypots based on flags
- ssh_honeypot.py – Paramiko-based fake SSH server
- web_honeypot.py – Flask-based fake WordPress admin panel
- Templates directory:
- templates/wp-admin.html – HTML for the fake login page
- log_files directory:
- Stores JSON/plain-text logs of credentials, commands, IPs
- Config/build scripts:
- requirements.txt – dependency list
- .gitignore
- Documentation:
- readme.md, HoneyPie.pdf, Web_Based_Honeypot.pdf

##### README for insights
- Key components: SSH honeypot, HTTP honeypot, logging & analysis, optional web dashboard
- Technologies: Paramiko (SSH), Flask (HTTP + dashboard), JSON files for storage, basic HTML for dashboard

##### Main components in the system design
a. External Threat Actors – the “users” (attackers/bots) generating SSH and HTTP traffic
b. SSH Honeypot Service
- Built on Paramiko
- Listens on a configurable port (e.g., 2222)
- Logs authentication attempts and commands to log_files/
c. HTTP Honeypot Service
- Flask app serving wp-admin.html
- Captures POSTed credentials and logs to log_files/
- Implements a tarpitting mechanism to slow attackers
d. Log Storage
- log_files/ (JSON/plain-text)
- Creds logs, HTTP audit logs, funnel logs, command logs
e. Web Dashboard (Optional)
- A separate Flask app (web_honeypot.py or web_app.py per README)
- Reads log_files/ and renders analytics pages (charts, tables)
f. Dev / Ops Environment
- Virtual environment (venv)
- SSH key generation (static/server.key)

##### Relationships & Interactions
- Attacker → [SSH Honeypot] → Logs directory
- Attacker → [HTTP Honeypot] → Logs directory
- Dashboard → Reads logs → Displays metrics
- CLI (honeypy.py) orchestrates launching SSH and/or HTTP honeypot services

##### Architectural patterns & design principles
- Modular services: SSH and HTTP honeypots are separate modules
- Single-host microservices style—each service listens on its own port
- File-based persistence (simple JSON/log files) for portability
- Tarpit pattern: intentionally slow responses to waste attacker resources

##### Final checklist
- Labels for ports (e.g., SSH:2222, HTTP:5000) if desired
- Annotations for tarpit, Paramiko, Flask, JSON logs

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% External entity
    Internet(["🌐 Cloud: Attackers"]):::cloud

    %% CLI Orchestration
    CLI["CLI Orchestration\nhoneypy.py"]:::cli
    click CLI "https://github.com/rudrakadel/honeypie/blob/main/honeypy.py"

    %% Honeypot Services
    SSH["SSH Honeypot Service\nParamiko\nPort: 2222"]:::service
    click SSH "https://github.com/rudrakadel/honeypie/blob/main/ssh_honeypot.py"

    HTTP["HTTP Honeypot Service\nFlask + HTML\nPort: 5000\nTarpit"]:::service
    click HTTP "https://github.com/rudrakadel/honeypie/blob/main/web_honeypot.py"

    %% Template under HTTP
    Template["wp-admin.html"]:::template
    click Template "https://github.com/rudrakadel/honeypie/blob/main/templates/wp-admin.html"

    %% Log Storage
    Logs[(Log Storage\nJSON / .log files)]:::storage

    subgraph "log_files/"
        CredsLog["creds_audit.log"]:::logfile
        click CredsLog "https://github.com/rudrakadel/honeypie/blob/main/log_files/creds_audit.log"
        HTTPLog["http_audit.log"]:::logfile
        click HTTPLog "https://github.com/rudrakadel/honeypie/blob/main/log_files/http_audit.log"
        FunnelLog["funnel.log\nfunnel_audit.log"]:::logfile
        click FunnelLog "https://github.com/rudrakadel/honeypie/blob/main/log_files/funnel.log"
    end

    %% Web Dashboard (Optional)
    Dashboard["Web Dashboard\nFlask\n(Optional)"]:::dashboard
    click Dashboard "https://github.com/rudrakadel/honeypie/blob/main/web_honeypot.py"

    %% Config & Documentation
    subgraph "Configuration & Docs"
        Req["requirements.txt"]:::docs
        click Req "https://github.com/rudrakadel/honeypie/blob/main/requirements.txt"
        GitIgnore[".gitignore"]:::docs
        click GitIgnore "https://github.com/rudrakadel/honeypie/blob/main/.gitignore"
        Readme["readme.md"]:::docs
        click Readme "https://github.com/rudrakadel/honeypie/blob/main/readme.md"
        DesignDoc["HoneyPie.pdf"]:::docs
        click DesignDoc "https://github.com/rudrakadel/honeypie/blob/main/HoneyPie.pdf"
        Paper["Web_Based_Honeypot.pdf"]:::docs
        click Paper "https://github.com/rudrakadel/honeypie/blob/main/Web_Based_Honeypot.pdf"
    end

    %% Relationships
    Internet --> CLI
    CLI --> SSH
    CLI --> HTTP
    SSH --> Logs
    HTTP --> Logs
    Logs --> CredsLog
    Logs --> HTTPLog
    Logs --> FunnelLog
    Dashboard --> Logs

    %% Styles
    classDef cloud fill:#99CCFF,stroke:#3399FF,color:#000;
    classDef service fill:#CCFFCC,stroke:#33CC33,color:#000;
    classDef cli fill:#CCFFCC,stroke:#33CC33,color:#000;
    classDef storage fill:#FFCC99,stroke:#FF9933,color:#000;
    classDef logfile fill:#FFD699,stroke:#FF9933,color:#000;
    classDef dashboard fill:#E0B3FF,stroke:#B266FF,color:#000,stroke-dasharray: 5 5;
    classDef template fill:#FFFFCC,stroke:#CCCC33,color:#000;
    classDef docs fill:#F2F2F2,stroke:#999999,color:#000;
```
