mirror of
https://github.com/andreicscs/HoneyWire
synced 2026-06-26 12:39:53 +00:00
4.8 KiB
4.8 KiB
Contributing to HoneyWire
Welcome to HoneyWire! We are building a centralized, high-fidelity security and deception ecosystem for homelabs and SMBs.
Whether you want to build a new decoy sensor, improve the Vue.js frontend, or optimize the Go backend, your contributions are highly welcome.
Project Structure
To help you navigate the repository, here is a high-level overview of the architecture:
honeywire/
├── .github/ # CI/CD workflows
├── Docs/ # Documentation (API.md)
├── Hub/ # Central brain (Go backend + Vue frontend)
│ ├── cmd/hub/ # Main Go entrypoint (main.go)
│ ├── internal/ # Go packages (api, auth, config, models, notify, store)
│ ├── ui/ # Vue 3 Frontend (src, public, tailwind config)
│ ├── docker-compose.yml
│ └── Dockerfile
├── SDKs/ # Libraries for writing custom sensors
└── Sensors/ # Decoy nodes (Official and Community)
Contributing to the Hub (Core)
The Hub is a unified monolith containing both the Go API and the embedded Vue 3 frontend.
Frontend (Vue 3 + TailwindCSS)
- Navigate to the
Hub/ui/directory. - Run
npm installto install dependencies. - Run
npm run devto start the Vite development server.- Note: You will need the Go backend running concurrently to serve the
/api/v1routes.
- Note: You will need the Go backend running concurrently to serve the
- When your UI changes are complete, run
npm run build. This compiles the assets intoHub/ui/dist/, which the Go binary automatically embeds at compile time.
Backend (Go 1.25 + SQLite)
- Navigate to the
Hub/directory. - The backend uses
modernc.org/sqlite(a pure Go port of SQLite) to ensure the binary remains statically linked and cross-platform without requiring CGO. - Run
go run cmd/hub/main.goto start the Hub. - Database Migrations: If you need to alter the database schema, do not modify the
baselineSchemastring inHub/internal/store/store.go. Instead, append yourALTER TABLESQL command to themigrationsarray within that file. The Hub will safely backup the database and apply the migration automatically on boot.
Contributing a New Sensor
To keep the ecosystem stable, all community-submitted sensors must adhere to a strict set of DevSecOps rules. We treat sensors as isolated, unprivileged microservices.
The Golden Rules of Sensors
- Strict Sandboxing (Docker Only): Every sensor must include a
Dockerfile. We strongly enforce the use of minimal, hardened base images (like Distroless) running as non-root users (UID 65532) with all Linux kernel capabilities dropped (cap_drop: ALL). - Zero Blast Radius: Your sensor must not crash or overwhelm the main Hub. All communication must happen asynchronously via HTTP POST requests containing JSON.
- No Hardcoding: All configurations (Ports, Node keys, file paths, thresholds) must be handled dynamically via environment variables.
How to Submit
- Use the Official Template: Copy the
Sensors/templates/go-sensor-template/folder and rename it to your sensor's name inside theSensors/community/directory. While you can technically build a custom sensor in any language, pure Go is the official standard for HoneyWire due to its minimal footprint, concurrency models, and ability to compile statically. - Follow the JSON Contract: Your sensor must POST a payload to the Hub matching the schema outlined in the main
README.md. (The official HoneyWire Go SDK handles this formatting for you). - Implement Test Mode: To ensure your code works before merging, our GitHub Actions will pass
HW_TEST_MODE=trueto your container. Your sensor must immediately send a synthetic payload to the Hub and exit gracefully. - Documentation: Provide a
README.mdwithin your sensor directory containing:- Technical Overview: Purpose of the sensor.
- Environment Reference: A table of all
HW_configuration variables. - Deployment Example: A secure
docker-compose.ymlsnippet. - Security Architecture: An explicit breakdown of the capability drops and isolation techniques utilized.
Review Process
Once you open a Pull Request:
- Automated Security Scanning: GitHub Actions will run Trivy to scan your Docker image for vulnerabilities, and CodeQL to perform static code analysis for memory leaks.
- Functional Testing: GitHub Actions will automatically build your Docker container and test it against a Mock Hub using
HW_TEST_MODE=true. - Manual Review: A core maintainer will manually review the code, specifically checking for malicious intent and proper capability stripping.