$ show aau-network-security/haaukins
Haaukins is a cybersecurity training and Capture The Flag (CTF) platform developed at Aalborg University. It orchestrates isolated lab environments for teams, combining Docker containers and VirtualBox VMs to deliver challenges. The system is built as a set of gRPC microservices: a central daemon manages event lifecycle, team assignments, and challenge verification; a store service provides persistence; and an exercise service defines challenge configurations. Participants access labs via a web frontend (Amigo) using browser-based RDP (Guacamole) or WireGuard VPN. The daemon also handles DNS/DHCP per lab subnet, real-time scoreboards via WebSocket, and keylogging for monitoring. The CLI client (hkn) allows administrators to manage events, teams, and exercises. The architecture is modular with clean interfaces for virtualization (Docker/VirtualBox) and storage (in-memory with hooks or gRPC backend), though some components show tight coupling and aging dependencies.
The LLM identified 4 files worth highlighting for reuse:
Implements a parser for the Guacamole wire protocol, decoding instructions and frames. Supports chaining filters (e.g., keylogger) to intercept and process protocol events. This is a self-contained, reusable component for any project needing to parse or proxy the Guacamole protocol, demonstrating non-obvious skill in binary protocol handling.
Defines the `Instance` interface (Create, Start, Suspend, Stop, Close) and related types for virtual machine management. This clean abstraction decouples the lab orchestration from concrete hypervisors (Docker, VirtualBox). It is a textbook example of the strategy pattern and can be reused in any project requiring polymorphic VM/container lifecycle management.
Provides an in-memory event store with hooks for persistence (e.g., YAML file save). The store pattern (NewEventStore) uses maps and callback functions to allow flexible backend switching without changing business logic. This is a reusable, testable storage pattern applicable to any Go service needing lightweight, configurable persistence.
Creates per-file zerolog loggers with automatic directory creation and file rotation. The `NewLogger` function encapsulates log configuration (level, output, caller info) in a reusable helper. This component can be extracted into any Go project requiring structured logging with minimal boilerplate.