# meghanab1909/capstone architecture

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

- Interactive diagram: https://gitdiagram.com/meghanab1909/capstone
- Repository: https://github.com/meghanab1909/capstone

## Overview

This repository is an IoT security demonstration combining a traffic gateway, anomaly-detection code, configurable honeypots, and monitoring interfaces. The principal workflow is an incoming request reaching the gateway, which classifies benign versus suspicious traffic; suspicious activity can be investigated through honeypot session analysis and surfaced in the dashboard. The tree and excerpts also show Beelzebub’s protocol-based traps and optional LLM integration. Several links between services are not shown in the excerpts, so they are omitted or marked unverified rather than treated as established runtime calls.

Main entry points: [`honeypot/beelzebub/protocols/protocol_manager.go`](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/protocol_manager.go) (Protocol Manager), [`honeypot/beelzebub/main.go`](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/main.go) (Beelzebub Runtime), [`ai_engine/hybrid_ai.py`](https://github.com/meghanab1909/capstone/blob/main/ai_engine/hybrid_ai.py) (Hybrid Classifier), [`dashboard/app.py`](https://github.com/meghanab1909/capstone/blob/main/dashboard/app.py) (Security Dashboard)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_traffic["Traffic Handling"]
  node_gateway["Traffic Gateway<br/>[gateway.py]"]
  node_traffic_log[("Traffic Records<br/>[traffic.csv]")]
  node_device["IoT Device Portal<br/>[device.py]"]
end

subgraph group_detection["Detection and Models"]
  node_hybrid["Hybrid Classifier<br/>[hybrid_ai.py]"]
  node_detect["Flow Detection<br/>[detect.py]"]
  node_if_eval["Anomaly Evaluation<br/>[if_eval.py]"]
  node_model_train["Model Training<br/>[model_train.py]"]
  node_train_rf["Forest Training<br/>[train_rf.py]"]
  node_models["Trained Models<br/>[random_forest.pkl]"]
end

subgraph group_traps["Honeypot Services"]
  node_beelzebub_main["Beelzebub Runtime<br/>[main.go]"]
  node_config_parser["Config Parser"]
  node_builder["Service Builder<br/>[builder.go]"]
  node_protocol_manager["Protocol Manager"]
  node_http_trap["HTTP Trap<br/>[http.go]"]
  node_ssh_trap["SSH Trap<br/>[ssh.go]"]
  node_tcp_trap["TCP Trap<br/>[tcp.go]"]
  node_mcp_trap["MCP Trap<br/>[mcp.go]"]
  node_tracer["Event Tracing<br/>[tracer.go]"]
  node_llm_plugin["LLM Plugin<br/>[llm-integration.go]"]
  node_cloud_plugin["Cloud Plugin<br/>[beelzebub-cloud.go]"]
end

subgraph group_monitoring["Analysis and UI"]
  node_portal["Honeypot Portal<br/>[honeypot.py]"]
  node_analyser["Session Analyser"]
  node_report["Honeypot Report"]
  node_dashboard["Security Dashboard<br/>[app.py]"]
end

node_attacker(("Network Client"))

node_attacker -.->|"sends requests"| node_gateway
node_gateway -.->|"records flows"| node_traffic_log
node_hybrid -->|"reads flows"| node_traffic_log
node_hybrid -->|"loads model"| node_models
node_beelzebub_main -->|"reads configuration"| node_config_parser
node_beelzebub_main -->|"builds services"| node_builder
node_protocol_manager -->|"creates tracer"| node_tracer
node_protocol_manager -.->|"initializes strategy"| node_http_trap
node_protocol_manager -.->|"initializes strategy"| node_ssh_trap
node_protocol_manager -.->|"initializes strategy"| node_tcp_trap
node_protocol_manager -.->|"initializes strategy"| node_mcp_trap
node_dashboard -->|"uses analysis"| node_analyser
node_dashboard -->|"reads report"| node_report
node_portal -.->|"inspects runtime"| node_beelzebub_main
node_analyser -->|"writes report"| node_report

click node_gateway "https://github.com/meghanab1909/capstone/blob/main/gateway/gateway.py"
click node_traffic_log "https://github.com/meghanab1909/capstone/blob/main/logs/traffic.csv"
click node_hybrid "https://github.com/meghanab1909/capstone/blob/main/ai_engine/hybrid_ai.py"
click node_detect "https://github.com/meghanab1909/capstone/blob/main/ai_engine/detect.py"
click node_if_eval "https://github.com/meghanab1909/capstone/blob/main/ai_engine/if_eval.py"
click node_model_train "https://github.com/meghanab1909/capstone/blob/main/ai_engine/model_train.py"
click node_train_rf "https://github.com/meghanab1909/capstone/blob/main/ai_engine/train_rf.py"
click node_models "https://github.com/meghanab1909/capstone/blob/main/ai_engine/models/random_forest.pkl"
click node_device "https://github.com/meghanab1909/capstone/blob/main/iot_device/device.py"
click node_beelzebub_main "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/main.go"
click node_config_parser "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/parser/configurations_parser.go"
click node_builder "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/builder/builder.go"
click node_protocol_manager "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/protocol_manager.go"
click node_http_trap "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/strategies/HTTP/http.go"
click node_ssh_trap "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/strategies/SSH/ssh.go"
click node_tcp_trap "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/strategies/TCP/tcp.go"
click node_mcp_trap "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/strategies/MCP/mcp.go"
click node_tracer "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/tracer/tracer.go"
click node_llm_plugin "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/plugins/llm-integration.go"
click node_cloud_plugin "https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/plugins/beelzebub-cloud.go"
click node_portal "https://github.com/meghanab1909/capstone/blob/main/honeypot/honeypot.py"
click node_analyser "https://github.com/meghanab1909/capstone/blob/main/honeypot_analyser.py"
click node_report "https://github.com/meghanab1909/capstone/blob/main/logs/honeypot_report.json"
click node_dashboard "https://github.com/meghanab1909/capstone/blob/main/dashboard/app.py"

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_gateway,node_traffic_log,node_device,node_attacker toneBlue
class node_hybrid,node_detect,node_if_eval,node_model_train,node_train_rf,node_models toneAmber
class node_beelzebub_main,node_config_parser,node_builder,node_protocol_manager,node_http_trap,node_ssh_trap,node_tcp_trap,node_mcp_trap,node_tracer,node_llm_plugin,node_cloud_plugin toneMint
class node_portal,node_analyser,node_report,node_dashboard toneRose
```

## Components

### Traffic Handling

- [Traffic Gateway](https://github.com/meghanab1909/capstone/blob/main/gateway/gateway.py): `gateway/gateway.py`
- [Traffic Records](https://github.com/meghanab1909/capstone/blob/main/logs/traffic.csv): `logs/traffic.csv`
- [IoT Device Portal](https://github.com/meghanab1909/capstone/blob/main/iot_device/device.py): `iot_device/device.py`

### Detection and Models

- [Hybrid Classifier](https://github.com/meghanab1909/capstone/blob/main/ai_engine/hybrid_ai.py): `ai_engine/hybrid_ai.py`
- [Flow Detection](https://github.com/meghanab1909/capstone/blob/main/ai_engine/detect.py): `ai_engine/detect.py`
- [Anomaly Evaluation](https://github.com/meghanab1909/capstone/blob/main/ai_engine/if_eval.py): `ai_engine/if_eval.py`
- [Model Training](https://github.com/meghanab1909/capstone/blob/main/ai_engine/model_train.py): `ai_engine/model_train.py`
- [Forest Training](https://github.com/meghanab1909/capstone/blob/main/ai_engine/train_rf.py): `ai_engine/train_rf.py`
- [Trained Models](https://github.com/meghanab1909/capstone/blob/main/ai_engine/models/random_forest.pkl): `ai_engine/models/random_forest.pkl`

### Honeypot Services

- [Beelzebub Runtime](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/main.go): `honeypot/beelzebub/main.go`
- [Config Parser](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/parser/configurations_parser.go): `honeypot/beelzebub/parser/configurations_parser.go`
- [Service Builder](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/builder/builder.go): `honeypot/beelzebub/builder/builder.go`
- [Protocol Manager](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/protocol_manager.go): `honeypot/beelzebub/protocols/protocol_manager.go`
- [HTTP Trap](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/strategies/HTTP/http.go): `honeypot/beelzebub/protocols/strategies/HTTP/http.go`
- [SSH Trap](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/strategies/SSH/ssh.go): `honeypot/beelzebub/protocols/strategies/SSH/ssh.go`
- [TCP Trap](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/strategies/TCP/tcp.go): `honeypot/beelzebub/protocols/strategies/TCP/tcp.go`
- [MCP Trap](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/protocols/strategies/MCP/mcp.go): `honeypot/beelzebub/protocols/strategies/MCP/mcp.go`
- [Event Tracing](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/tracer/tracer.go): `honeypot/beelzebub/tracer/tracer.go`
- [LLM Plugin](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/plugins/llm-integration.go): `honeypot/beelzebub/plugins/llm-integration.go`
- [Cloud Plugin](https://github.com/meghanab1909/capstone/blob/main/honeypot/beelzebub/plugins/beelzebub-cloud.go): `honeypot/beelzebub/plugins/beelzebub-cloud.go`

### Analysis and UI

- [Honeypot Portal](https://github.com/meghanab1909/capstone/blob/main/honeypot/honeypot.py): `honeypot/honeypot.py`
- [Session Analyser](https://github.com/meghanab1909/capstone/blob/main/honeypot_analyser.py): `honeypot_analyser.py`
- [Honeypot Report](https://github.com/meghanab1909/capstone/blob/main/logs/honeypot_report.json): `logs/honeypot_report.json`
- [Security Dashboard](https://github.com/meghanab1909/capstone/blob/main/dashboard/app.py): `dashboard/app.py`

### Other components

- **Network Client**

## Connections

- Network Client → Traffic Gateway: sends requests
- Traffic Gateway → Traffic Records: records flows
- Hybrid Classifier → Traffic Records: reads flows (evidence: `ai_engine/hybrid_ai.py`)
- Hybrid Classifier → Trained Models: loads model (evidence: `ai_engine/hybrid_ai.py`)
- Beelzebub Runtime → Config Parser: reads configuration (evidence: `honeypot/beelzebub/main.go`)
- Beelzebub Runtime → Service Builder: builds services (evidence: `honeypot/beelzebub/main.go`)
- Protocol Manager → Event Tracing: creates tracer (evidence: `honeypot/beelzebub/protocols/protocol_manager.go`)
- Protocol Manager → HTTP Trap: initializes strategy
- Protocol Manager → SSH Trap: initializes strategy
- Protocol Manager → TCP Trap: initializes strategy
- Protocol Manager → MCP Trap: initializes strategy
- Security Dashboard → Session Analyser: uses analysis (evidence: `dashboard/app.py`)
- Security Dashboard → Honeypot Report: reads report (evidence: `dashboard/app.py`)
- Honeypot Portal → Beelzebub Runtime: inspects runtime
- Session Analyser → Honeypot Report: writes report (evidence: `honeypot_analyser.py`)
