Files
harpia/docs/configuration.md
T
Lucas Guerra 2298117c47
Release / Plan (reuse the published image?) (push) Successful in 4s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and clippy (push) Failing after 9s
CI / Dependency audit (push) Failing after 11s
CI / Tests (Linux) (push) Successful in 9m25s
Release / ci (push) Failing after 9m26s
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Skipped
Release / Gitea release (push) Skipped
feat(scan): implement raw-socket SYN engine; fix Docker build and cross-container permissions; full v1.0 docs
- scan::syn_scan: raw TCP SYN half-open scanning (CAP_NET_RAW), validated
  end-to-end against a real target through the actual hardened Docker
  Compose stack (scanner uid 0 restricted to NET_RAW, xexeu uid 10001 zero
  capabilities). Automatic fallback to nativo-sem-raw, engine actually used
  recorded in every sweep manifest.
- caps::has_net_raw: CAP_NET_RAW detection via /proc/self/status, shared by
  the scan engine selection and `xexeu doctor`.
- Fix: Dockerfile never copied apps/ or logo.png, so the image never
  actually built until this was caught by a real `docker build`.
- Fix: sweep batches were written 0600 by scanner (uid 0); xexeu (uid 10001)
  couldn't read them through the read-only xexeu-sweeps mount. Now written
  0644/0755 explicitly.
- Fix: group names from the config CRUD API weren't validated as safe path
  components until a sweep tried to write a batch for them; now rejected
  immediately.
- Fix: CSV exports had no CSV/formula-injection guard; cells starting with
  =, +, -, @ or a tab are now prefixed to force plain-text interpretation.
- docs/: full EN/PT-BR set (architecture rewritten to match the real
  implementation — SQLite not DuckDB, include_str!/include_bytes! not
  rust-embed; new cli.md, configuration.md, docker.md, interface.md,
  support.md) with real dashboard/report screenshots.
- README, ROADMAP, CHANGELOG, SECURITY, CONTRIBUTING (EN/PT-BR): updated to
  reflect actual v1.0-candidate state instead of the initial-scaffolding
  status they still described.
2026-11-02 11:08:51 -03:00

125 lines
5.0 KiB
Markdown

<p align="center"><a href="../README.md">◂ Back to README</a></p>
# Configuration
Xexéu is configured by a single TOML file, by default `config/xexeu.toml`
(override with `--config` on every command). `xexeu config check --config
<path>` validates it and prints, per group, the address count, effective
cron and cadence overlaps — run it after every edit, before restarting
`serve`/`scanner`.
## Shape of the file
```toml
[escopo]
autorizado = ["10.0.0.0/8", "203.0.113.0/24"]
responsavel = "Infra Team <infra@example.org>"
[padrao]
cron = "@daily"
jitter = "10%"
perfil = "padrao"
taxa_maxima_pps = 500
hosts_simultaneos = 64
ausencias_para_sumir = 2
[padrao.feeds]
sincronizar_automaticamente = false
intervalo_sincronizacao = "24h"
[perfis.padrao]
tcp = "top-1000"
motor = "nativo"
vulnerabilidades = true
[[grupo]]
nome = "nucleo"
alvos = ["10.0.1.1", "10.0.1.10-10.0.1.20"]
cron = "*/5 * * * *"
perfil = "padrao"
criticidade = "critica"
```
See [`examples/xexeu.toml`](../examples/xexeu.toml) for a fully commented
reference covering a corporate network, a DMZ and a core/critical tier with
two cadences (a light 5-minute check and a full 03:00 sweep).
### `[escopo]` — authorized scope (hard limit)
- `autorizado`: list of CIDR ranges every expanded target must fall inside.
A target outside it — including a DNS name that resolves outside it —
is rejected (`config check` fails for static targets; a name is skipped
for that sweep and logged as `alvo_fora_do_escopo` if it only drifts at
resolution time).
- `responsavel`: free-text contact, shown in reports; not validated.
### `[padrao]` — defaults inherited by every group
- `cron`: 5-field cron expression or a shortcut (`@hourly`, `@daily`,
`@weekly`, `@monthly`). Any group without its own `cron` uses this one.
- `jitter`: percentage of the interval to the next run, applied as a
deterministic (not random) offset — see [`architecture.md`](architecture.md)
for why.
- `perfil`: which `[perfis.*]` table a group uses when it doesn't set its own.
- `taxa_maxima_pps` / `hosts_simultaneos`: shared rate budget across the
whole scanner process, not per group.
- `ausencias_para_sumir`: consecutive missed sweeps before a host is marked
gone (`host_sumiu`) — protects against a single dropped sweep producing a
false "host disappeared" event.
- `[padrao.feeds]`: `sincronizar_automaticamente` (bool, default `false`) and
`intervalo_sincronizacao` (default `"24h"`) control the background CVE/KEV
refresh inside `xexeu serve` — see [Vulnerability feeds](#vulnerability-feeds) below.
### `[perfis.<nome>]` — port and engine profiles
- `tcp`: `"top-1000"`, a range (`"1-65535"`), or an explicit list
(`"22,80,443"`).
- `udp`: list of UDP ports to probe (string list).
- `motor`: `"nativo"` (tries the raw-socket SYN engine, falls back to
`nativo-sem-raw` automatically if `CAP_NET_RAW` isn't available — see
[`docker.md`](docker.md)) or `"nmap"` (requires the `xexeu-scanner-nmap`
image variant).
- `vulnerabilidades`: whether CVE/KEV correlation and the safe config checks
(expired TLS cert, unencrypted admin port) run for this profile's findings.
### `[[grupo]]` — target groups
Each `[[grupo]]` block is a named network with its own targets and,
optionally, its own cron/profile/criticality:
- `nome`: unique name (also the asset-identity namespace — see
[`architecture.md`](architecture.md)).
- `alvos`: list of CIDR ranges, single IPs, ranges (`"10.0.1.10-10.0.1.20"`)
or DNS names (re-resolved every sweep).
- `excluir`: optional list subtracted from `alvos` (same formats, no DNS
names).
- `cron` / `perfil` / `criticidade`: override the defaults for this group
only. `criticidade` is informational (shown in the dashboard/report), it
does not change scheduling by itself — the cron does.
A host can belong to more than one group (e.g. a narrow high-frequency group
and a broad daily one covering the same address). The storage layer
deduplicates by asset identity, and `config check` lists the overlap with
each host's effective (shortest) cadence.
## Editing a group from the dashboard
`xexeu serve`'s **Groups** view can create, edit and delete groups without
touching the file by hand (`POST`/`PUT`/`DELETE /api/config/groups`) — every
mutation re-runs the same validation as `config check` and persists back to
the TOML file atomically. `xexeu scanner`, running as a separate process,
picks up the change on its next tick by comparing the file's mtime; no
restart needed.
## Vulnerability feeds
`xexeu feeds import <dir> --data-dir <path>` loads a local NVD CVE JSON 2.0
dump and a CISA KEV file with no network access (for air-gapped networks).
`xexeu feeds sync --config <path> --data-dir <path>` fetches both live, once,
and merges them into the existing local database. Setting
`padrao.feeds.sincronizar_automaticamente = true` makes `xexeu serve` repeat
that sync on its own, every `intervalo_sincronizacao`, for as long as the
process runs — the CVE database then stays fresh independently of the image
or binary being rebuilt, the same principle Trivy uses for its vulnerability
database.