Files
harpia/docs/cli.md
T
Lucas RayanandClaude Opus 5.5 cd1f3d0e8c feat: webhook alerts for surface changes and Prometheus /metrics
[[webhook]] receivers get each ingested sweep's changes, filtered by kind
and group, as Xexéu JSON or a Slack/Discord message, optionally signed with
HMAC-SHA256 from an environment variable. Delivery runs in the background
with retries and never blocks ingestion. GET /api/config and the logs show
webhook URLs as scheme://host/… because chat webhook URLs are credentials.

/metrics exposes hosts, ports, findings by severity, feed state, per-group
last sweep and webhook delivery counters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:06:45 -03:00

6.1 KiB

◂ Back to README

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.

GET /metrics serves Prometheus text: xexeu_build_info, xexeu_sweeps_ingested_total, xexeu_assets{status}, xexeu_open_ports, xexeu_findings{severidade}, xexeu_kev_findings, xexeu_vuln_db_cves, xexeu_feeds_last_sync_timestamp_seconds, per-group xexeu_last_sweep_{timestamp_seconds,duration_seconds,complete,events} and xexeu_webhook_deliveries_total{resultado}. Like the other reads it needs no token; an alert on time() - xexeu_last_sweep_timestamp_seconds catches a scanner that stopped.

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. 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]
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
# 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.

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>
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).

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). --json is meant for scripted health checks and monitoring, not for humans at a terminal.