From 0aaaa12ba151ec4afc9298b7e306b2e25c88ec08 Mon Sep 17 00:00:00 2001 From: nessi Date: Thu, 9 Jul 2026 13:15:37 +0200 Subject: [PATCH] docs: add Proxmox preparation guide and update quick start for setup wizard Add comprehensive Proxmox integration guide covering API token creation, minimum read permissions, QEMU guest agent setup for IP discovery, LXC IP configuration, cluster sync workflow, firewall requirements, network flow visibility options, and troubleshooting common integration errors. Update quick start section to document setup wizard for fresh installations, remove hardcoded demo credentials, add instructions for res --- README.md | 149 ++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 144 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a2e035b..cd794f8 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ NexaFabric is an open-source SDN-like network and security control plane for Pro - FastAPI backend with SQLAlchemy 2, Alembic-ready models, JWT auth, RBAC primitives, audit logging, and provider interfaces. - React + TypeScript frontend with Vite, Tailwind CSS, TanStack Query, React Router, Zustand, dark/light mode, and production-oriented pages. - PostgreSQL, Redis, worker, API, frontend, and reverse proxy through Docker Compose. -- Demo seed data for clusters, nodes, workloads, networks, tenants, policies, IPAM, jobs, and audit events. +- Optional demo seed data for clusters, nodes, workloads, networks, tenants, policies, IPAM, jobs, and audit events. - Tests, lint/type-check scripts, CI workflow, and operational documentation. ## Quick Start @@ -22,10 +22,150 @@ Then open: - Frontend: http://localhost:8080 - API docs: http://localhost:8080/api/docs -Demo login: +On a fresh database NexaFabric opens the setup wizard first. The wizard creates the first Super Admin user and registers the first Proxmox or demo provider. -- Email: `admin@nexafabric.local` -- Password: `ChangeMe_UseEnvInstead` +To start from scratch during testing: + +```bash +docker compose down -v +docker compose up --build +``` + +Demo data is disabled by default. Enable it only for lab screenshots or UI testing: + +```env +SEED_DEMO_DATA=true +``` + +## Proxmox Preparation + +NexaFabric can read inventory from the Proxmox VE API immediately after you add a cluster, but IPAM and flow visibility depend on what Proxmox and the guests expose. Use this checklist before expecting full data in the UI. + +### 1. Create A Dedicated API Token + +In Proxmox VE, create a dedicated user and API token instead of using a personal admin token. + +Recommended UI path: + +1. `Datacenter` -> `Permissions` -> `Users` +2. Create a user such as `nexafabric@pve` or another realm you manage. +3. `Datacenter` -> `Permissions` -> `API Tokens` +4. Add a token such as `nexafabric@pve!control-plane`. +5. Keep privilege separation enabled unless you intentionally want the token to inherit all user privileges. + +NexaFabric accepts both token formats: + +```text +PVEAPIToken=nexafabric@pve!control-plane=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +nexafabric@pve!control-plane=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx +``` + +The installer stores the token with the cluster and starts in `read_only` mode by default. + +### 2. Assign Minimum Read Permissions + +For inventory, IP discovery, policy preview, and dashboard data, assign the token read access at the Datacenter level or the narrowest paths that contain your nodes and guests. + +Minimum practical read privileges: + +- `Sys.Audit` for cluster and node inventory. +- `VM.Audit` for VM and container inventory/config visibility. +- `SDN.Audit` if you use Proxmox SDN zones, VNets, EVPN, or related network objects. + +For future write-enabled firewall orchestration, create a separate token or role and do not reuse the read-only token. Only enable write mode after previews and audit logging have been verified in your environment. + +### 3. Enable QEMU Guest Agent For VM IP Discovery + +For QEMU VMs, Proxmox only exposes guest interface/IP details reliably when the QEMU Guest Agent is installed in the VM and enabled in Proxmox. + +Per VM: + +1. Install the guest agent inside the VM. + - Debian/Ubuntu: `apt install qemu-guest-agent` + - RHEL/Rocky/Alma: `dnf install qemu-guest-agent` + - Windows: install the VirtIO guest tools including the QEMU guest agent. +2. Enable and start the service in the guest. + - Linux: `systemctl enable --now qemu-guest-agent` +3. In Proxmox UI, open the VM: + - `Options` -> `QEMU Guest Agent` -> `Enabled` +4. Reboot the VM or fully stop/start it if Proxmox does not immediately report the agent. + +NexaFabric uses the Proxmox guest-agent network interface endpoint to discover IPv4 addresses for IPAM. If the guest agent is missing, the VM can still appear in inventory, but IPAM may not learn its IP address. + +### 4. LXC IP Discovery + +For LXC containers, NexaFabric reads static IPs from the Proxmox container network config when available. + +Works best when container interfaces are configured with explicit IPs, for example: + +```text +net0: name=eth0,bridge=vmbr0,ip=10.10.10.50/24,gw=10.10.10.1 +``` + +If the container uses DHCP, Proxmox may not always have a stable IP value in config. In that case, use a DHCP lease source, static reservations, or a future NexaFabric node-agent/flow-source integration. + +### 5. Sync Cluster Inventory + +After adding the cluster in NexaFabric: + +1. Open `Clusters`. +2. Click the cluster row/name. +3. Use `Test` to validate the token. +4. Use `Sync` to import nodes, VMs/LXCs, networks, and discoverable IP addresses. +5. Open `IPAM` -> `Discover from Proxmox` if you want to rerun IP discovery later. + +Imported IPs are placed into an automatically created `discovered-ipam` network if NexaFabric cannot map them to an existing subnet. + +### 6. Firewall And Policy Requirements + +NexaFabric policy preview does not require Proxmox firewall writes. It compiles NexaFabric policies into provider-specific preview output and records audit events. + +Before enabling real firewall apply workflows: + +- Ensure Proxmox firewall is enabled intentionally at the Datacenter, node, and guest level where you want enforcement. +- Keep NexaFabric clusters in `read_only` mode until previews are reviewed. +- Use `audit` mode policies first to see what would be allowed or blocked. +- Confirm that Proxmox API token permissions match the exact write operations you plan to allow. +- Keep backups of Proxmox firewall configuration before enabling automation. + +NexaFabric is designed to read first, simulate second, and only apply after explicit confirmation. + +### 7. Network Flow Visibility + +Proxmox inventory and guest agent data are enough for: + +- Cluster, node, VM, LXC inventory. +- Network object visibility. +- IPAM discovery for VMs with QEMU Guest Agent. +- Static LXC IP discovery. +- Policy matching and firewall previews. + +Actual traffic flow visibility, top talkers, byte counters, and per-workload traffic history require an additional telemetry source. Proxmox VE does not provide full flow telemetry for every VM through the basic inventory API. + +Supported or planned options: + +- NexaFabric node agent on Proxmox nodes to read nftables/conntrack or flow counters. +- Open vSwitch with sFlow/NetFlow/IPFIX exported to a collector. +- Router/firewall flow exports from pfSense, OPNsense, FRR/BGP edge devices, or physical switches. +- eBPF or host-level telemetry in future agent builds. + +Until such a source is configured, NexaFabric will show `No flow telemetry collected yet` instead of fake traffic. + +### 8. Troubleshooting Proxmox Integration + +`401 No ticket` or `Provider sync failed` usually means: + +- The API token format is wrong. +- The token was copied without the secret value after `=`. +- The token lacks the required ACLs. +- Privilege separation is enabled but no permissions were assigned to the token. +- The wrong realm/user/token ID was used. + +TLS errors usually mean: + +- Proxmox uses a self-signed certificate. +- The hostname in `Cluster API URL` does not match the certificate. +- Disable `Verify TLS certificate` only for trusted lab systems, or install a valid certificate on Proxmox. ## Repository Layout @@ -39,4 +179,3 @@ nginx/ Reverse proxy example ## Safety Model NexaFabric never applies firewall changes without a preview, validation, and audit record. The included Proxmox provider is designed around read-only inventory first. Write-enabled orchestration is intentionally routed through explicit dry-run and apply workflows. -