Group CRUD decides what the scanner sweeps, yet any client that reached the API could change it. Writes now need XEXEU_ADMIN_TOKEN (or a token generated at startup and printed as a ?token= link, like sabia ui), compared in constant time, and a browser Origin must match Host. The dashboard keeps the token for the tab and asks for it on 401. Reads are unchanged. Also track .env.example: '.env*' in .gitignore had kept it out of the repository, although the README tells operators to copy it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
175 lines
5.6 KiB
Markdown
175 lines
5.6 KiB
Markdown
<p align="center"><a href="../README.md">◂ Back to README</a></p>
|
|
|
|
# Terminal (CLI)
|
|
|
|
`xexeu` is one binary covering both Docker Compose roles (`serve` and
|
|
`scanner`) plus every operator command. Every subcommand accepts `-h`/
|
|
`--help`.
|
|
|
|
## `xexeu serve`
|
|
|
|
Runs the API server, batch ingestion, diff engine and the embedded
|
|
dashboard/executive report.
|
|
|
|
```
|
|
Usage: xexeu serve [OPTIONS]
|
|
|
|
Options:
|
|
--bind <BIND> [default: 0.0.0.0:8788]
|
|
--config <CONFIG> [default: config/xexeu.toml]
|
|
--sweeps <SWEEPS> [default: data/sweeps]
|
|
--data-dir <DATA_DIR> [default: data/xexeu]
|
|
--admin-token <ADMIN_TOKEN> Token required by the API routes that change state.
|
|
Without it, a random token is generated at startup
|
|
and printed once [env: XEXEU_ADMIN_TOKEN]
|
|
```
|
|
|
|
This is the `xexeu` Compose service's entrypoint.
|
|
|
|
Reads (`GET`) are open; the routes that change the configuration
|
|
(`POST`/`PUT`/`DELETE /api/config/groups…`) need the admin token in
|
|
`Authorization: Bearer <token>` or `X-Xexeu-Token`, and a browser `Origin`, when
|
|
present, must match `Host`. Without `XEXEU_ADMIN_TOKEN`, `serve` prints a fresh
|
|
`http://…/?token=…` link at each start; opening it logs the dashboard in for
|
|
that tab.
|
|
|
|
## `xexeu scanner`
|
|
|
|
Runs the continuous scheduler and scan engine, writing sweep batches —
|
|
never exits on its own, same lifecycle as a daemon.
|
|
|
|
```
|
|
Usage: xexeu scanner [OPTIONS]
|
|
|
|
Options:
|
|
--config <CONFIG> [default: config/xexeu.toml]
|
|
--out <OUT> [default: data/sweeps]
|
|
--data-dir <DATA_DIR> [default: data/xexeu]
|
|
```
|
|
|
|
Picks the `nativo` (raw SYN) engine whenever a profile asks for it and
|
|
`CAP_NET_RAW` is actually usable, falling back to `nativo-sem-raw`
|
|
automatically otherwise — see [`architecture.md`](architecture.md#2-scan-engine).
|
|
This is the `scanner` Compose service's entrypoint.
|
|
|
|
## `xexeu scan --group <name> --once`
|
|
|
|
Runs a single sweep for one group, for diagnostics — writes a batch exactly
|
|
like `scanner` would, then exits.
|
|
|
|
```
|
|
Usage: xexeu scan [OPTIONS]
|
|
|
|
Options:
|
|
--group <GROUP>
|
|
--once
|
|
--config <CONFIG> [default: config/xexeu.toml]
|
|
--out <OUT> [default: data/sweeps]
|
|
--data-dir <DATA_DIR> [default: data/xexeu]
|
|
```
|
|
|
|
```bash
|
|
xexeu scan --group dmz --once --config config/xexeu.toml --out data/sweeps --data-dir data/xexeu
|
|
```
|
|
|
|
## `xexeu config check`
|
|
|
|
Validates `xexeu.toml` and prints, per group, the address count, effective
|
|
cron and any cadence overlap. Run this after every manual edit.
|
|
|
|
```
|
|
Usage: xexeu config check [OPTIONS]
|
|
|
|
Options:
|
|
--config <CONFIG> [default: config/xexeu.toml]
|
|
```
|
|
|
|
Exits non-zero on an invalid configuration — safe to use in a pre-push hook
|
|
or CI step, which is exactly what `scripts/check.sh` does.
|
|
|
|
## `xexeu feeds sync` / `xexeu feeds import`
|
|
|
|
```
|
|
Usage: xexeu feeds <COMMAND>
|
|
|
|
Commands:
|
|
sync Download NVD and CISA KEV feeds incrementally
|
|
import Import feed files copied manually for isolated networks
|
|
```
|
|
|
|
```bash
|
|
# Live, one-shot sync (also happens automatically inside `serve` if
|
|
# padrao.feeds.sincronizar_automaticamente = true — see configuration.md)
|
|
xexeu feeds sync --config config/xexeu.toml --data-dir data/xexeu
|
|
|
|
# Offline, for air-gapped networks
|
|
xexeu feeds import ./nvd-dump --data-dir data/xexeu
|
|
```
|
|
|
|
## `xexeu changes --since <duration>`
|
|
|
|
Prints diff events (new/gone host, new/closed port, new/fixed
|
|
vulnerability) from the local state — the same data `/api/changes` serves.
|
|
|
|
```bash
|
|
xexeu changes --since 24h --data-dir data/xexeu
|
|
```
|
|
|
|
## `xexeu export --format json|csv`
|
|
|
|
Exports the current deduplicated state (hosts, ports, findings) — shares
|
|
its formatting logic with the `/api/export/*.csv` and `/api/hosts`
|
|
endpoints, so a terminal export and a dashboard download never drift apart.
|
|
|
|
```
|
|
Usage: xexeu export [OPTIONS]
|
|
|
|
Options:
|
|
--format <FORMAT> [default: json]
|
|
--data-dir <DATA_DIR> [default: data/xexeu]
|
|
--out <OUT>
|
|
```
|
|
|
|
```bash
|
|
xexeu export --format csv --data-dir data/xexeu --out hosts.csv
|
|
xexeu export --format json --data-dir data/xexeu # prints to stdout
|
|
```
|
|
|
|
## `xexeu doctor [--json]`
|
|
|
|
Diagnoses the runtime environment — run this first when something looks
|
|
wrong, and always before reporting an issue (see
|
|
[`support.md`](support.md)).
|
|
|
|
```
|
|
Usage: xexeu doctor [OPTIONS]
|
|
|
|
Options:
|
|
--json
|
|
--config <CONFIG> [default: config/xexeu.toml]
|
|
--data-dir <DATA_DIR> [default: data/xexeu]
|
|
```
|
|
|
|
```
|
|
$ xexeu doctor
|
|
Xexéu v1.0.0 - Diagnóstico do Ambiente
|
|
================================================================================
|
|
Item Status Detalhe
|
|
--------------------------------------------------------------------------------
|
|
versao ok xexeu v1.0.0
|
|
config ok configuração válida (4 grupo(s))
|
|
net_raw ok CAP_NET_RAW disponível (motor nativo ativo)
|
|
sqlite ok banco SQLite acessível em data/xexeu/xexeu.db
|
|
vuln_db ok 135 CVE(s) carregados (12h atrás)
|
|
feeds_sync ok sincronizado há 12h (dentro do intervalo configurado)
|
|
--------------------------------------------------------------------------------
|
|
Resultado: OK
|
|
```
|
|
|
|
Exits `1` if any critical item (`config`, a missing database it needs to
|
|
write to) failed; a missing/stale vulnerability database or absent
|
|
`CAP_NET_RAW` are reported but don't fail the exit code — both have a
|
|
documented degraded path (see [`architecture.md`](architecture.md)).
|
|
`--json` is meant for scripted health checks and monitoring, not for
|
|
humans at a terminal.
|