How burpheart/hachimi works
Main Components
• Honeypot (POT) nodes: These are deployed across the network to listen for various protocols using elements in pkg/emulation. They simulate responses for protocols such as HTTP (including plugin support via yaegi), TLS, SSH, and REDIS.
• Message Queue (NSQ): Acts as the intermediary hub that receives logs and traffic data from the honeypot nodes and forwards them to the analysis (hunter) nodes.
• Analysis Nodes (hunter): These nodes process the received data, perform protocol-specific analysis (leveraging pkg/analysis, pkg/rules, etc.), and prepare it for storage.
• Management Platform (BeeKeeper): Provides an interface for monitoring and management of the honeypot network.
• Data Storage (Clickhouse): Stores analyzed data for later visualization and further analysis.
• Ancillary Services: Additional components like configuration management (pkg/config), ingress/transparent proxy handling (pkg/ingress), plugins (pkg/plugin), and distributed session handling/emulation modules.
File Structure for Architectural Insights
• The cmd/ directory hosts the main executables:
– cmd/beekeeper: The management UI for overseeing the honeypot network.
– cmd/honeypot: The executable for the honeypot nodes.
– cmd/hunter: The executable for analysis nodes.
• The pkg/ directory is structured into modules such as analysis, config, emulation (divided by protocols like HTTP, TLS, SSH, REDIS, etc.), ingress, logger, mq, plugin, and rules. This indicates a modular design where discrete functionalities are encapsulated by protocol or role.
• There are also helper tools and testing directories that support development and deployment, with deployment documentation in docs/deploy.md.
• NSQ (Message Queue): Place a central intermediary component to route data between nodes.
• BeeKeeper (Management Platform): Position as an orchestration and monitoring console.
• Clickhouse (Database): Represent the data storage service.
• External Plugin System & Emulation Modules: Optionally add annotations to the POT nodes to indicate integrated plugin support and protocol-specific emulation (HTTP, TLS, etc.).
– Data flows from multiple POT nodes to the NSQ queue.
– NSQ forwards data to one or multiple hunter nodes.
– Processed results are then stored to Clickhouse.
– BeeKeeper interacts with Clickhouse for data visualization and system management.
• External elements or notes to indicate integration with additional deployment scripts (e.g., iptables.sh from tool) and configuration management through TOML files (e.g., config.toml, hunter.toml).
Architectural Patterns and Design Principles
• Modular Design: The separation into packages (emulation, analysis, ingress, logger, etc.) hints at a clean, modular design that separates concerns.
• Distributed Architecture: The system is designed to operate in a distributed manner across multiple nodes (POT, hunter) with a central messaging system (NSQ).
• Extensibility: The use of a plugin system (via yaegi) enables dynamic extension of HTTP functionalities without restarting the services.
• Protocol-agnostic Handling: By modularizing protocol handling (each protocol has its own emulation and logging modules), the system can be easily extended to support additional protocols in the future.