Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
### Interactive Web UI (`nxtflow-ui`)

- **Dynamic Host Exclusion (`?exclude=<host>`):** Click any `⊘` **Hide** button on a host or talker row to filter noisy hosts out of Overview KPIs, Sankey diagrams, and Flow Explorer, with an **Exclude** chip bar to restore individual hosts or clear all.
- **Light / Dark Theme Toggle (`☀️` / `🌙`):** Switch between dark and light themes from the top bar (persisted in `localStorage`).
- **Light / Dark Theme Toggle (`☀️` / `🌙`) & Version Badge:** Switch between dark and light themes from the top bar (persisted in `localStorage`), with the active release version badge (e.g., `v0.2.4`, matching `nxtflow --version`) displayed in the header.

<p align="center">
<img src="assets/screenshots/nxtflow-ui-overview.png" alt="nxtflow-ui Overview Dashboard (Dark Mode)" width="100%" />
Expand Down Expand Up @@ -168,15 +168,15 @@ Forward Grafana locally and open `http://localhost:3000/d/nxtflow-overview`:
kubectl port-forward -n nxtflow svc/nxtflow-grafana 3000:80
```

### 2. Integrated (Existing Loki, Prometheus & Grafana)
### 2. Integrated (Existing VictoriaLogs, Loki, or ClickHouse + Prometheus & Grafana)

Connects to an existing Loki (or VictoriaLogs/ClickHouse) endpoint and provisions `ServiceMonitor`, `PrometheusRule`, and the Grafana dashboard ConfigMap:
Connects to an existing VictoriaLogs (default), Loki, or ClickHouse endpoint and provisions `ServiceMonitor`, `PrometheusRule`, and the Grafana dashboard ConfigMap:

```bash
helm install nxtflow oci://ghcr.io/nertwork/charts/nxtflow \
--namespace monitoring \
-f examples/values-integrated.yaml \
--set externalLoki.url="https://loki.example.com"
--set externalVictoriaLogs.url="https://victorialogs.example.com"
```

### 3. Collector-Only (Remote Edge Site)
Expand Down Expand Up @@ -243,6 +243,7 @@ Query VictoriaLogs (default) from your terminal:

```bash
export NXTFLOW_VICTORIALOGS_URL="http://localhost:9428"
nxtflow --version
nxtflow status
nxtflow summary --range 1h
nxtflow top-talkers 10 --range 15m
Expand Down Expand Up @@ -292,6 +293,7 @@ Every push and pull request runs automated GitHub Actions verification:
- **Python Lint & Unit Tests:** `ruff` static checks and `pytest` coverage across CLI, enricher, and MCP tools.
- **Helm Lint, Schema & Template:** `helm lint`, JSON Schema validation (`values.schema.json`), `ct lint`, and multi-mode template rendering tests.
- **Docker Build & Kind Helm Install:** Builds container images and executes an end-to-end `helm install` + `helm test` inside an ephemeral Kind cluster.
- **CodeQL, Dependabot & Supply-Chain Security:** Continuous GitHub **CodeQL** static analysis (`codeql.yml` for Python and GitHub Actions), **Dependabot** vulnerability & malware alerts, **Secret Scanning + Push Protection**, and **Private Vulnerability Reporting**.

See [SECURITY.md](SECURITY.md) for architecture details and private vulnerability reporting.

Expand All @@ -314,7 +316,7 @@ Full hosted documentation is automatically published to **[`https://nertwork.git

Thank you to everyone contributing code, exporter guides, bug reports, and platform improvements to **nxtflow**!

- **[@nertwork](https://github.com/nertwork) (James Farr Gomez)** — Creator & Maintainer (Helm chart architecture, `nxtflow-enricher`, bounded-cardinality Loki pipeline, 18-panel Grafana dashboard, `nxtflow` CLI & FastMCP server).
- **[@nertwork](https://github.com/nertwork) (James Farr Gomez)** — Creator & Maintainer (Helm chart architecture, `nxtflow-enricher`, multi-backend flow pipeline (VictoriaLogs, Loki, ClickHouse), 18-panel Grafana dashboard, `nxtflow` CLI & FastMCP server).

See the full **[GitHub Contributors Graph](https://github.com/nertwork/nxtflow/graphs/contributors)** and our **[Contributing Guide](CONTRIBUTING.md)** to get involved.

Expand Down
8 changes: 4 additions & 4 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

| Version | Supported |
| :--- | :--- |
| `0.1.x` (`main`) | :white_check_mark: |
| `0.2.x` (`main`, current `v0.2.4`) | :white_check_mark: |

## Security Architecture

- **Non-Root Containers:** `nxtflow-enricher` runs as UID/GID `100:65533` (`flow:nogroup`, matching upstream `netsampler/goflow2:v2.2.7`), and `nxtflow-mcp` runs as UID/GID `65532:65532` with `allowPrivilegeEscalation: false`.
- **LogQL Injection Prevention:** All user-supplied `site`, `dir`, `search`, and `host` inputs in `nxtflow` CLI and `nxtflow-mcp` pass through `validate_range()`, `validate_dir()`, `escape_logql_label()`, and `sanitize_logql_regex()`.
- **Query Injection Prevention:** All user-supplied `site`, `dir`, `search`, and `host` inputs in `nxtflow` CLI, `nxtflow-ui`, and `nxtflow-mcp` pass through strict validators and backend-specific escaping (`validate_range()`, `validate_dir()`, `escape_logql_label()`, `sanitize_logql_regex()`, LogsQL quoting, and ClickHouse parameterized escaping).
- **Bounded Memory & Query Cardinality:** Enricher queues use bounded ring buffers (`ringBufferMaxFlows`), rDNS uses a bounded LRU+TTL cache (`maxEntries`), Loki streams use strictly bounded labels (`{job, site, dir}`), and ephemeral ports (`>=10000`) are filtered from `top-ports` aggregations to prevent 5000-series exhaustion.
- **Secret Isolation:** Loki and NetBox credentials are injected via Kubernetes `Secret` environment variables (`NXTFLOW_LOKI_*`, `NXTFLOW_NETBOX_TOKEN`), never rendered into ConfigMaps, and redacted by `nxtflow config`.
- **Automated Security & Static Analysis:** CI runs `scripts/security_audit.py` across all source, chart, SVG, workflow, and documentation files to catch exposed credentials, private keys, and syntax errors alongside Ruff linting and Helm schema validation.
- **Secret Isolation:** Storage backend (VictoriaLogs, Loki, ClickHouse) and NetBox credentials are injected via Kubernetes `Secret` environment variables (`NXTFLOW_LOKI_*`, `NXTFLOW_CLICKHOUSE_*`, `NXTFLOW_NETBOX_TOKEN`) and `secret-grafana-datasources.yaml`, never rendered into ConfigMaps, and redacted by `nxtflow config`.
- **Automated Security & Static Analysis:** Every PR and push runs GitHub **CodeQL** static analysis (`codeql.yml` across Python and GitHub Actions), `scripts/security_audit.py` (scanning source, chart, SVG, workflow, and documentation files for exposed credentials, private keys, and syntax errors), Ruff linting, and Helm schema validation. GitHub **Dependabot** vulnerability & malware alerts, **Secret Scanning**, and **Push Protection** are enabled on the repository.

## Reporting a Vulnerability

Expand Down
6 changes: 3 additions & 3 deletions charts/nxtflow/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="https://raw.githubusercontent.com/nertwork/nxtflow/main/assets/nxtflow-icon.png" width="96" alt="nxtflow icon" />
</p>

Multi-protocol **NetFlow v5/v9, IPFIX, and sFlow v5** Kubernetes observability platform pairing upstream [`netsampler/goflow2`](https://github.com/netsampler/goflow2) with `nxtflow-enricher`, multi-backend flow storage (**Grafana Loki**, **VictoriaLogs**, or **ClickHouse**), Prometheus metrics & alerts, an 18-panel Grafana Sankey dashboard, and the read-only `nxtflow-mcp` server.
Multi-protocol **NetFlow v5/v9, IPFIX, and sFlow v5** Kubernetes observability platform pairing upstream [`netsampler/goflow2`](https://github.com/netsampler/goflow2) with `nxtflow-enricher`, multi-backend flow storage (**VictoriaLogs** default, **Grafana Loki**, or **ClickHouse**), Prometheus metrics & alerts, an 18-panel Grafana Sankey dashboard, and the read-only `nxtflow-mcp` server.

---

Expand Down Expand Up @@ -59,14 +59,14 @@ helm install nxtflow oci://ghcr.io/nertwork/charts/nxtflow \
-f https://raw.githubusercontent.com/nertwork/nxtflow/main/examples/values-clickhouse.yaml
```

### Integrated (Existing Loki, Prometheus & Grafana)
### Integrated (Existing VictoriaLogs, Loki, or ClickHouse + Prometheus & Grafana)

```bash
helm install nxtflow oci://ghcr.io/nertwork/charts/nxtflow \
--version 0.2.4 \
--namespace monitoring \
-f https://raw.githubusercontent.com/nertwork/nxtflow/main/examples/values-integrated.yaml \
--set externalLoki.url="https://loki.example.com"
--set externalVictoriaLogs.url="https://victorialogs.example.com"
```

### Collector-Only (Remote Edge Site)
Expand Down
2 changes: 1 addition & 1 deletion docs/ai-integration.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
| `nxtflow directory` | — | Discovered IP-to-hostname directory |
| `nxtflow config` | — | Display active configuration with secrets redacted |

Common flags work before or after any subcommand: `--range 1h`, `--site <site>`, `--dir up|down|lan`, `-n <limit>`, `--json`, `--config <path>`.
Common flags work before or after any subcommand: `--range 1h`, `--site <site>`, `--dir up|down|lan`, `-n <limit>`, `--json`, `--config <path>`, and `--version` (`nxtflow --version`, matching the version badge shown in `nxtflow-ui`).

---

Expand Down
3 changes: 2 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# nxtflow Documentation

Welcome to **`nxtflow`** — an open-source, AI-ready NetFlow v5/v9, IPFIX, and sFlow telemetry platform designed for Docker Compose, Kubernetes, Grafana Loki, VictoriaLogs, ClickHouse, Prometheus, and AI coding assistants.
Welcome to **`nxtflow`** — an open-source, AI-ready NetFlow v5/v9, IPFIX, and sFlow telemetry platform designed for Docker Compose, Kubernetes, VictoriaLogs, Grafana Loki, ClickHouse, Prometheus, and AI coding assistants.

## Fastest — 60s Setup (Docker Compose)

Expand Down Expand Up @@ -99,3 +99,4 @@ Every release and pull request is validated through automated GitHub Actions che
- **Lint, Syntax & Security Audit:** Automated credential, private key, and Python/JSON syntax checks (`scripts/security_audit.py`).
- **Python Lint & Unit Tests:** `ruff` checks and `pytest` suites covering the CLI, enricher, Compose config, and MCP server.
- **Helm Lint, Schema & Template:** Multi-mode `helm lint`, `values.schema.json` validation, `ct lint`, and Kind cluster `helm test` smoke tests.
- **CodeQL & Supply-Chain Security:** Continuous GitHub **CodeQL** analysis (`codeql.yml`), **Dependabot** vulnerability & malware alerts, **Secret Scanning**, and **Private Vulnerability Reporting**.
8 changes: 4 additions & 4 deletions docs/standalone-vs-integrated.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Standalone vs. Integrated Deployment Modes

The `charts/nxtflow` Helm chart supports three deployment topologies controlled by `tags.standalone`, `storage.backend` (`loki`, `victorialogs`, or `clickhouse`), and external backend URLs.
The `charts/nxtflow` Helm chart supports three deployment topologies controlled by `tags.standalone`, `storage.backend` (`victorialogs` default, `loki`, or `clickhouse`), and external backend URLs.

## Mode Comparison

Expand Down Expand Up @@ -58,7 +58,7 @@ Use Integrated mode when your cluster already runs Loki, VictoriaLogs, or ClickH
helm install nxtflow oci://ghcr.io/nertwork/charts/nxtflow \
--namespace monitoring \
-f examples/values-integrated.yaml \
--set externalLoki.url="https://loki.example.com"
--set externalVictoriaLogs.url="https://victorialogs.example.com"
```

### Configuration Guardrails
Expand All @@ -80,7 +80,7 @@ helm install nxtflow-branch oci://ghcr.io/nertwork/charts/nxtflow \
--set externalVictoriaLogs.url="https://victorialogs.example.com"
```

Every site registers dynamically in the Grafana `Site` dropdown via `label_values({job="nxtflow"}, site)` and appears in `nxtflow status`.
Every site registers dynamically in the Grafana `Site` dropdown (LogsQL field values in VictoriaLogs, `label_values({job="nxtflow"}, site)` in Loki, or `DISTINCT site` in ClickHouse) and appears in `nxtflow status`.

## Sankey Visualization Engine (`echarts` vs. `netsage`)

Expand All @@ -89,7 +89,7 @@ Every site registers dynamically in the Grafana `Site` dropdown via `label_value

## Interactive Web UI (`ui.enabled`) & Pre-NAT Correlation

- **Interactive Web Explorer (`ui.enabled=true`):** Deploys `nxtflow-ui` on port `8080` (with optional `ui.ingress` and automatic wiring to whichever `storage.backend` is active). Provides live `site`/`dir`/`pair` flow browsing, `via <nat_dst>` NAT correlation pills, Host Deep-Dive drawers with observed IPs + 3-tier Host Sankey, and click-to-pivot 5-tuple sessions alongside Grafana's `dataLinks` and `Host & Flow Deep-Dive` panel.
- **Interactive Web Explorer (`ui.enabled=true`):** Deploys `nxtflow-ui` on port `8080` (with optional `ui.ingress` and automatic wiring to whichever `storage.backend` is active). Displays the running release version badge in the header and provides live `site`/`dir`/`pair` flow browsing, `via <nat_dst>` NAT correlation pills, Host Deep-Dive drawers with observed IPs + 3-tier Host Sankey, and click-to-pivot 5-tuple sessions alongside Grafana's `dataLinks` and `Host & Flow Deep-Dive` panel.
- **5-Tuple Pre-NAT Reverse-Correlation (`enricher.classification.natCorrelation`):** Enabled by default (`enabled: true`, `ttlSeconds: 600`, `maxEntries: 100000`) in `configmap-enricher.yaml` so pre-NAT router WAN downloads (`external-cdn -> wan-gateway`) correlate back to the internal host (`external-cdn -> (via wan-gateway) -> internal-host`).

## Alloy Sidecar Mode
Expand Down