7.0 KiB
7.0 KiB
VaultMesh Command Center Architecture
Overview
The VaultMesh Command Center is a minimal control plane for monitoring and managing VaultMesh nodes. It consists of two components:
- Command Center (CC) - Central Rust/Axum web server
- Node Agent - Lightweight daemon running on each VaultMesh node
Communication Model
┌─────────────────┐ HTTPS (Cloudflare Tunnel) ┌─────────────────┐
│ Node Agent │ ─────────────────────────────────▶│ Command Center │
│ (ArchVault) │ POST /api/agent/heartbeat │ (Axum) │
└─────────────────┘ └─────────────────┘
│
┌─────────────────┐ HTTPS (Cloudflare Tunnel) │
│ Node Agent │ ─────────────────────────────────────────┘
│ (DebianVault) │ POST /api/agent/heartbeat
└─────────────────┘
┌─────────────────────────────────┐
│ Cloudflare Access │
│ (Zero Trust Authentication) │
└─────────────────────────────────┘
│
▼
┌─────────────────────────────────┐
│ Admin Browser │
│ GET / (Dashboard) │
└─────────────────────────────────┘
Security Model
Outbound-Only from Nodes
Nodes only make outbound connections to the Command Center. No inbound ports are opened on VaultMesh nodes for CC communication.
Cloudflare Zero Trust
- Cloudflare Tunnel: CC is exposed via
cloudflaredtunnel, not a public IP - Cloudflare Access: Admin dashboard protected by Cloudflare Access policies
- Agent Authentication: Future: signed JWTs or shared secrets for agent auth
Network Flow
- Node agent wakes up every N seconds
- Agent collects local health metrics
- Agent POSTs heartbeat JSON to CC via Cloudflare Tunnel
- CC stores heartbeat in memory (future: SQLite)
- Admin views dashboard via Cloudflare Access-protected URL
Data Model
NodeHeartbeat
{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"hostname": "vault-node-01",
"os_profile": "ArchVault",
"cloudflare_ok": true,
"services_ok": true,
"vaultmesh_root": "/var/lib/vaultmesh",
"timestamp": "2024-01-15T10:30:00Z"
}
Storage (V1)
In-memory HashMap<Uuid, NodeHeartbeat> wrapped in Arc<RwLock<>>.
Nodes are keyed by node_id. Each heartbeat overwrites the previous entry for that node.
Component Details
Command Center
| Component | Technology |
|---|---|
| Web Framework | Axum 0.7 |
| Async Runtime | Tokio |
| Serialization | Serde + serde_json |
| Logging | tracing + tracing-subscriber |
| HTML | Server-rendered (HTMX-ready) |
Node Agent
| Component | Technology |
|---|---|
| HTTP Client | reqwest (rustls-tls) |
| Async Runtime | Tokio |
| System Checks | systemctl calls |
| Config | Environment variables |
Deployment
Command Center Deployment
- Build:
cargo build --release -p vaultmesh-command-center - Install binary to
/usr/local/bin/ - Install systemd unit
- Configure Cloudflare Tunnel to
http://127.0.0.1:8088 - Configure Cloudflare Access policies
Node Agent Deployment
- Build:
cargo build --release -p vaultmesh-node-agent - Install binary to
/usr/local/bin/ - Create
/etc/vaultmesh/agent.envwith:VAULTMESH_CC_URL=https://cc.your-domain.exampleVAULTMESH_OS_PROFILE=ArchVault
- Install systemd unit
Version History
V0.7.2: Communication Layer (Current)
- Unified
EventEnvelopeas canonical message format for comms events. POST /api/events- Ingest endpoint for operators, agents, and bots.GET /api/events- Query endpoint with since/kind/node_id/limit filtering.- New event kinds:
note,incident,ack,tag,resolve. - SSE broadcast of envelope events by their
kindname. - Durable persistence to
events.jsonlwith replay on startup. - Memory-bounded in-memory store (500 most recent envelopes).
- Canonicalization rules for audit-grade stability (see
docs/EVENT_ENVELOPE.md).
V0.7.1: Mission Console
- NASA-style 3-panel dashboard at
GET /console. - Global Mission Bar with fleet KPIs (Total/Healthy/Attention/Critical).
- Left panel: Node list with status pills (OK/ATTN/CRIT), live heartbeat glow.
- Center panel: Selected node telemetry + per-node event timeline.
- Right panel: Attention summary, scan findings, global event feed.
- Full SSE wiring for real-time DOM updates without page refresh.
V0.7: SSE Event Bus
- Real-time event streaming via
GET /events(Server-Sent Events). - Named events:
heartbeat,scan,command,attention. - Broadcast channel distributes events to all connected SSE clients.
- Keepalive every 15s to prevent connection timeouts.
- JS probe in dashboard for console.log debugging.
V0.6.1: Log Tools
- CLI subcommands for querying JSONL event logs.
logs viewwith filters: --kind, --node, --since, --min-severity, --limit.logs tailfor real-time log following.logs statsfor per-node event statistics.
V0.6: Append-Only Persistence
- Event logging to JSONL files (heartbeats, scans, commands).
- State replay on startup from
$VAULTMESH_LOG_DIR. - Foundation for V0.8 Ledger Bridge (Merkle over logs).
V0.5: Fleet Orchestrator
- Background scheduler for autonomous scans.
- Attention model with staleness / drift detection.
- Command policy enforcement (per-profile allowlists).
V0.4: Commands & Sovereign Scan
- Push commands to nodes (Ed25519 signed).
- Command receipts with proof chain.
- Sovereign scan execution and reporting.
V0.3: Signed Commands
- Ed25519 key generation and command signing.
- Agent signature verification.
- Nonce-based replay protection.
V0.2: Node Metrics
- System metrics in heartbeat (load, memory, disk).
- Heartbeat history tracking.
Future Extensions
V0.7.1: Mission Console
- NASA-inspired dashboard layout with node tree sidebar.
- Live row updates via SSE (no page refresh).
- Attention summary panel with fleet health overview.
V0.8: Ledger Bridge
- Merkle tree over
sovereign-scans.jsonl. ROOT.txt+PROOFCHAIN.jsonfor VaultMesh proof layer.