diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml index 05fe9c8..f7b0e0c 100644 --- a/.gitea/workflows/release.yml +++ b/.gitea/workflows/release.yml @@ -17,6 +17,10 @@ concurrency: env: REGISTRY: git.lucasrguerra.dev.br + CARGO_TERM_COLOR: always + # Rust toolchains, cargo registry, and caches live on the persistent runner volume. + CARGO_HOME: /opt/hostedtoolcache/cargo + RUSTUP_HOME: /opt/hostedtoolcache/rustup jobs: # The image is built only from these paths, so their tree hashes identify it. @@ -149,10 +153,6 @@ jobs: - uses: actions/checkout@v7 with: fetch-depth: 0 - - uses: dtolnay/rust-toolchain@stable - - name: Build release CLI binary - run: | - cargo build --release --locked -p xexeu-cli - name: Release env: TAG: ${{ gitea.ref_name }} @@ -167,14 +167,32 @@ jobs: pre=false; case "$TAG" in *-*) pre=true ;; esac jq -n --arg tag "$TAG" --arg name "Xexéu ${TAG#v}" --rawfile body notes.md --argjson pre "$pre" \ '{tag_name:$tag, name:$name, body:$body, prerelease:$pre}' > release.json - rel=$(curl -fsS -X POST "$API/releases" -H "Authorization: token $TOKEN" \ - -H 'Content-Type: application/json' -d @release.json) - rel_id=$(echo "$rel" | jq -r .id) - if [ -n "$rel_id" ] && [ "$rel_id" != "null" ]; then - asset_name="xexeu-${TAG#v}-linux-arm64" - cp target/release/xexeu "$asset_name" - curl -fsS -X POST "$API/releases/$rel_id/assets?name=$asset_name" \ - -H "Authorization: token $TOKEN" \ - -H "Content-Type: application/octet-stream" \ - --data-binary @"$asset_name" >/dev/null || true - fi + curl -fsS -X POST "$API/releases" -H "Authorization: token $TOKEN" \ + -H 'Content-Type: application/json' -d @release.json >/dev/null + + # Standalone CLI for hosts that run Xexéu without Docker, built natively on + # each architecture: xexeu--.tar.gz plus its .sha256. + cli: + name: CLI (${{ matrix.platform }}) + needs: gitea-release + runs-on: ${{ matrix.runner }} + env: + CARGO_TARGET_DIR: /opt/hostedtoolcache/cargo-target/xexeu-release-cli-${{ matrix.platform }} + strategy: + fail-fast: false + matrix: + include: + - { platform: linux-aarch64, target: aarch64-unknown-linux-gnu, runner: linux-arm64 } + - { platform: linux-x86_64, target: x86_64-unknown-linux-gnu, runner: linux-amd64 } + steps: + - uses: actions/checkout@v7 + - uses: dtolnay/rust-toolchain@stable + with: + targets: ${{ matrix.target }} + - name: Build and package + run: scripts/package-cli.sh "${{ gitea.ref_name }}" "${{ matrix.platform }}" "${{ matrix.target }}" | tee packages.txt + - name: Upload to release + env: + TOKEN: ${{ gitea.token }} + API: ${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }} + run: scripts/release-upload.sh "${{ gitea.ref_name }}" $(cat packages.txt) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83e0fe1..98366d8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,16 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio ## [Unreleased] +## [1.0.0] - 2026-11-03 + +### Security +- The API routes that change the configuration (`POST`/`PUT`/`DELETE /api/config/groups…`) now require an admin token (`--admin-token`/`XEXEU_ADMIN_TOKEN`, at least 16 characters, compared in constant time) in `Authorization: Bearer` or `X-Xexeu-Token`, and reject a browser `Origin` that does not match `Host`. Without a configured token, `serve` generates a random one at each start and prints a `?token=` link; the dashboard keeps it for the tab and asks for it on a `401`. Reads are unchanged. +- `quinn-proto` 0.11.17 → 0.11.19 (RUSTSEC-2026-0338, RUSTSEC-2026-0340, RUSTSEC-2026-0343). + ### Added +- `LICENSE-MIT` and `LICENSE-APACHE`: the crates and the image already declared `MIT OR Apache-2.0`, but the license texts were missing. +- Releases attach a standalone CLI for `linux-aarch64` and `linux-x86_64` (`xexeu--.tar.gz` plus `.sha256`), built natively on each architecture. +- `scripts/check-ui-i18n.mjs`, run by CI and `scripts/check.sh`: every Portuguese dashboard string needs an English translation. It found 38 untranslated strings and a duplicated key, now fixed. - Rust workspace scaffolding (`xexeu-core`, `xexeu-cli`), Docker Compose topology, documentation pairs and configuration examples. - `config`, `targets` and `schedule`: TOML parsing, CIDR/range/DNS target expansion, 5-field cron with jitter and overlap/cadence warnings. - Native scan engines: `nativo-sem-raw` (TCP connect) and `nativo` (raw-socket TCP SYN, `CAP_NET_RAW`), with automatic fallback and the engine actually used recorded in every sweep manifest. @@ -19,10 +28,17 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio - CSV export (`/api/export/*.csv`, `xexeu export`), CSV-injection-safe. - A4, Paged.js-paginated executive report at `/relatorio`. - `xexeu doctor` and `xexeu export` (JSON/CSV) CLI commands. -- Gitea CI/CD (`ci.yml`, `release.yml`), `scripts/verificar.sh`, pre-push hook, issue/PR templates. +- Gitea CI/CD (`ci.yml`, `release.yml`), `scripts/check.sh`, pre-push hook, issue/PR templates. - Full `docs/` set (architecture, CLI, configuration, Docker, interface, support) in EN/PT-BR with real dashboard screenshots. +### Changed +- `scripts/verificar.sh` → `scripts/check.sh` (fast by default; `--full` adds the workspace tests and `cargo audit`) and `scripts/instalar-hooks.sh` → `scripts/install-hooks.sh`, the same names as the other Ciberfauna projects. + ### Fixed +- The image smoke test started the container without `/config/xexeu.toml`, ran `xexeu doctor` against relative paths, and piped into `grep -q` under `pipefail`, which failed at random through SIGPIPE. +- The CI YAML check failed on runners without PyYAML. +- `.env.example` was never in the repository (`.env*` in `.gitignore` matched it), although the README tells operators to copy it. +- The dashboard sidebar always showed `v0.1.0`; it now shows the running version. - `Dockerfile` didn't copy `apps/` or `logo.png`, so the image never actually built until this was caught by a real `docker build`. - Sweep batch files were written with mode `0600` by `scanner` (uid 0); `xexeu` (uid 10001) couldn't read them through the read-only `xexeu-sweeps` mount. Batches are now written `0644`/directories `0755` explicitly. - Target group names accepted by the config CRUD API weren't validated as safe path components, so an unsafe name would only fail much later when a sweep for that group tried to write its batch; now rejected immediately with a clear error. diff --git a/CHANGELOG.pt-BR.md b/CHANGELOG.pt-BR.md index 1512577..6b70bcf 100644 --- a/CHANGELOG.pt-BR.md +++ b/CHANGELOG.pt-BR.md @@ -6,7 +6,16 @@ Formato baseado no [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/); ## [Não lançado] +## [1.0.0] - 2026-11-03 + +### Segurança +- As rotas da API que mudam a configuração (`POST`/`PUT`/`DELETE /api/config/groups…`) agora exigem um token de administração (`--admin-token`/`XEXEU_ADMIN_TOKEN`, com pelo menos 16 caracteres, comparado em tempo constante) em `Authorization: Bearer` ou `X-Xexeu-Token`, e recusam um `Origin` de navegador que não bata com o `Host`. Sem token configurado, o `serve` gera um aleatório a cada partida e imprime um link `?token=`; o dashboard o guarda na aba e pede o token ao receber `401`. Leituras não mudaram. +- `quinn-proto` 0.11.17 → 0.11.19 (RUSTSEC-2026-0338, RUSTSEC-2026-0340, RUSTSEC-2026-0343). + ### Adicionado +- `LICENSE-MIT` e `LICENSE-APACHE`: os crates e a imagem já declaravam `MIT OR Apache-2.0`, mas faltavam os textos das licenças. +- As releases anexam um CLI avulso para `linux-aarch64` e `linux-x86_64` (`xexeu--.tar.gz` mais `.sha256`), compilado nativamente em cada arquitetura. +- `scripts/check-ui-i18n.mjs`, rodado pelo CI e pelo `scripts/check.sh`: todo texto em português do dashboard precisa de tradução inglesa. Ele achou 38 textos sem tradução e uma chave duplicada, já corrigidos. - Scaffolding do workspace Rust (`xexeu-core`, `xexeu-cli`), topologia Docker Compose, pares de documentação e exemplos de configuração. - `config`, `targets` e `schedule`: parse de TOML, expansão de alvo CIDR/faixa/DNS, cron de 5 campos com jitter e avisos de sobreposição/cadência. - Motores de varredura nativos: `nativo-sem-raw` (TCP connect) e `nativo` (SYN cru de socket, `CAP_NET_RAW`), com fallback automático e o motor realmente usado registrado em todo manifesto de varredura. @@ -19,10 +28,17 @@ Formato baseado no [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/); - Exportação CSV (`/api/export/*.csv`, `xexeu export`), protegida contra injeção de CSV. - Relatório executivo A4 paginado com Paged.js em `/relatorio`. - Comandos de CLI `xexeu doctor` e `xexeu export` (JSON/CSV). -- CI/CD do Gitea (`ci.yml`, `release.yml`), `scripts/verificar.sh`, hook de pre-push, templates de issue/PR. +- CI/CD do Gitea (`ci.yml`, `release.yml`), `scripts/check.sh`, hook de pre-push, templates de issue/PR. - Conjunto completo de `docs/` (arquitetura, CLI, configuração, Docker, interface, suporte) em EN/PT-BR com screenshots reais do dashboard. +### Alterado +- `scripts/verificar.sh` → `scripts/check.sh` (rápido por padrão; `--full` acrescenta os testes do workspace e o `cargo audit`) e `scripts/instalar-hooks.sh` → `scripts/install-hooks.sh`, os mesmos nomes dos outros projetos da Ciberfauna. + ### Corrigido +- O smoke test da imagem subia o contêiner sem `/config/xexeu.toml`, rodava o `xexeu doctor` em caminhos relativos e usava pipe para `grep -q` sob `pipefail`, o que falhava ao acaso por SIGPIPE. +- A checagem de YAML do CI falhava em runners sem PyYAML. +- O `.env.example` nunca esteve no repositório (o `.env*` do `.gitignore` o pegava), embora o README mande os operadores copiá-lo. +- A barra lateral do dashboard mostrava sempre `v0.1.0`; agora mostra a versão em execução. - O `Dockerfile` não copiava `apps/` nem `logo.png`, então a imagem nunca buildava de verdade até isso ser pego por um `docker build` real. - Arquivos de lote de varredura eram gravados com modo `0600` pelo `scanner` (uid 0); o `xexeu` (uid 10001) não conseguia lê-los pelo mount `xexeu-sweeps` somente leitura. Lotes agora são gravados com `0644`/diretórios com `0755` explicitamente. - Nomes de grupo de alvos aceitos pela API de CRUD de config não eram validados como componentes de caminho seguros, então um nome inseguro só falhava bem mais tarde, quando uma varredura daquele grupo tentava gravar o lote; agora é rejeitado imediatamente com um erro claro. diff --git a/Cargo.lock b/Cargo.lock index 7c20091..01236f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2245,7 +2245,7 @@ checksum = "3ad82d2a33cdc9674dc7465672f271e096168fcdbe0f799d9e6db8c5892679dc" [[package]] name = "xexeu-cli" -version = "0.1.0" +version = "1.0.0" dependencies = [ "axum", "chrono", @@ -2260,7 +2260,7 @@ dependencies = [ [[package]] name = "xexeu-core" -version = "0.1.0" +version = "1.0.0" dependencies = [ "arrow-array", "arrow-schema", diff --git a/Cargo.toml b/Cargo.toml index f055bc2..2248f84 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ resolver = "2" members = ["crates/xexeu-core", "crates/xexeu-cli"] [workspace.package] -version = "0.1.0" +version = "1.0.0" edition = "2021" license = "MIT OR Apache-2.0" repository = "https://git.lucasrguerra.dev.br/ciberfauna/xexeu" diff --git a/README.md b/README.md index d76fab7..9c2ec56 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Xexéu is a lightweight continuous attack surface and vulnerability audit daemon | Dashboard & executive report | ✅ embedded vanilla UI (severity palette, SVG charts, group CRUD), A4 Paged.js report at `/relatorio` | | CSV / JSON export | ✅ `/api/export/*.csv`, `xexeu export`, CSV-injection-safe | | Docker Compose topology & hardening | ✅ validated end-to-end against a real target, including the permission boundary between the two containers' users | -| CI/CD (Gitea) | ✅ `ci.yml`, `release.yml`, `scripts/verificar.sh`, pre-push hook | +| CI/CD (Gitea) | ✅ `ci.yml`, `release.yml`, `scripts/check.sh`, pre-push hook | | Bilingual documentation | ✅ EN/PT-BR pairs, with real dashboard screenshots | | `nmap` adapter / `xexeu-scanner-nmap` variant | 🚧 not yet implemented | | Published releases | ❌ none yet — see [ROADMAP.md](ROADMAP.md) | @@ -53,7 +53,7 @@ Xexéu executes an ongoing loop: **schedule → scan → identify → historize Xexéu is defensive software designed strictly for networks you own or are explicitly authorized to audit. Scanning third-party infrastructure without permission is illegal. Operators are responsible for scope, compliance, and data retention policies. -The configuration requires an explicit `[escopo]` block. Any target resolving outside the authorized CIDR ranges is rejected. The API daemon binds to `127.0.0.1` by default; it has no built-in authentication — put it behind an authenticating reverse proxy before exposing it beyond localhost. See [SECURITY.md](SECURITY.md). +The configuration requires an explicit `[escopo]` block. Any target resolving outside the authorized CIDR ranges is rejected. The API daemon binds to `127.0.0.1` by default; reads are open, and the routes that change the configuration need an admin token (`XEXEU_ADMIN_TOKEN`, or the one-off link printed at startup). Put it behind an authenticating reverse proxy before exposing it beyond localhost. See [SECURITY.md](SECURITY.md). ## Install @@ -63,8 +63,11 @@ Run via Docker Compose (recommended for operators): cp .env.example .env mkdir -p config && cp examples/xexeu.toml config/xexeu.toml docker compose pull && docker compose up -d +docker compose logs xexeu | grep token # one-off admin link, unless XEXEU_ADMIN_TOKEN is set ``` +The image is public: `docker pull git.lucasrguerra.dev.br/ciberfauna/xexeu:latest`. + Or build and run locally with Docker: ```bash @@ -78,6 +81,13 @@ cargo build --release -p xexeu-cli ./target/release/xexeu --help ``` +Or download the standalone CLI from the [releases page](https://git.lucasrguerra.dev.br/ciberfauna/xexeu/releases) (`linux-x86_64` and `linux-aarch64`) and check it against its `.sha256`: + +```bash +sha256sum -c xexeu-v1.0.0-linux-x86_64.tar.gz.sha256 +tar xzf xexeu-v1.0.0-linux-x86_64.tar.gz +``` + Supported platform matrix for container images: `linux/amd64` and `linux/arm64`. ## Getting started @@ -106,7 +116,7 @@ See [docs/cli.md](docs/cli.md) for the full command reference. ```bash cargo test --workspace cargo clippy --workspace --all-targets -- -D warnings -scripts/verificar.sh +scripts/check.sh ``` See **[CONTRIBUTING.md](CONTRIBUTING.md)** and **[docs/architecture.md](docs/architecture.md)**. @@ -117,7 +127,6 @@ See **[CONTRIBUTING.md](CONTRIBUTING.md)** and **[docs/architecture.md](docs/arc - Authenticated scans (SSH/WinRM) and active exploit validation are non-goals. - The `nativo-sem-raw` degraded mode is restricted to TCP connect and lacks ICMP/ARP discovery. - IPv6 target expansion is limited to prefixes up to `/112` or explicit host lists; the raw SYN engine itself only scans IPv4 targets (IPv6 ones fall back to `nativo-sem-raw` automatically). -- No published releases/container images yet — build from source or `docker compose up -d --build` until the first tagged release. ## Where it's going @@ -125,9 +134,9 @@ Summary of the [ROADMAP](ROADMAP.md): | | | |---|---| -| **Done** | Workspace crates, native SYN/connect scan engines, fingerprinting, CVE/KEV correlation, scoped diffs, SQLite+Parquet storage, dashboard, executive report, CSV export, config CRUD with scanner hot-reload, CI/CD | -| **Next** | First tagged release and published container image | -| **Later** | `nmap` adapter and the `xexeu-scanner-nmap` variant, authenticated scanning, notifications | +| **Done (1.0.0)** | Workspace crates, native SYN/connect scan engines, fingerprinting, CVE/KEV correlation, scoped diffs, SQLite+Parquet storage, dashboard, executive report, CSV export, config CRUD with scanner hot-reload behind an admin token, CI/CD with published image and CLI | +| **Next** | Fuzzing and property tests, webhook alerts, Prometheus metrics | +| **Later** | `nmap` adapter and the `xexeu-scanner-nmap` variant, email alerts, OSV and distribution backport mapping | | **Not planned** | Exploitation payloads, NASL engine, mandatory cloud services, desktop Tauri wrapper | ## License diff --git a/README.pt-BR.md b/README.pt-BR.md index f57d799..d913b27 100644 --- a/README.pt-BR.md +++ b/README.pt-BR.md @@ -35,7 +35,7 @@ A Xexéu é um daemon leve e contínuo de auditoria de superfície de ataque e v | Dashboard e relatório executivo | ✅ interface embutida em HTML/JS puro (paleta por severidade, gráficos SVG, CRUD de grupos), relatório A4 com Paged.js em `/relatorio` | | Exportação CSV / JSON | ✅ `/api/export/*.csv`, `xexeu export`, protegido contra injeção de fórmula em CSV | | Topologia Docker Compose e hardening | ✅ validado de ponta a ponta contra um alvo real, incluindo o limite de permissão entre os usuários dos dois containers | -| CI/CD (Gitea) | ✅ `ci.yml`, `release.yml`, `scripts/verificar.sh`, hook de pre-push | +| CI/CD (Gitea) | ✅ `ci.yml`, `release.yml`, `scripts/check.sh`, hook de pre-push | | Documentação bilíngue | ✅ pares EN/PT-BR, com screenshots reais do dashboard | | Adaptador `nmap` / variante `xexeu-scanner-nmap` | 🚧 ainda não implementado | | Releases publicados | ❌ nenhum ainda — veja [ROADMAP.pt-BR.md](ROADMAP.pt-BR.md) | @@ -53,7 +53,7 @@ A Xexéu executa um ciclo contínuo: **agendar → varrer → identificar → hi A Xexéu é software defensivo desenhado estritamente pra redes que você possui ou tem autorização explícita pra auditar. Varrer infraestrutura de terceiros sem permissão é ilegal. Operadores são responsáveis pelo escopo, conformidade e políticas de retenção de dados. -A configuração exige um bloco `[escopo]` explícito. Qualquer alvo que resolva fora das faixas CIDR autorizadas é rejeitado. O daemon de API vincula em `127.0.0.1` por padrão; não tem autenticação embutida — coloque atrás de um proxy reverso autenticador antes de expor além do localhost. Veja [SECURITY.pt-BR.md](SECURITY.pt-BR.md). +A configuração exige um bloco `[escopo]` explícito. Qualquer alvo que resolva fora das faixas CIDR autorizadas é rejeitado. O daemon de API vincula em `127.0.0.1` por padrão; leituras são abertas, e as rotas que mudam a configuração exigem um token de administração (`XEXEU_ADMIN_TOKEN`, ou o link avulso impresso na partida). Coloque atrás de um proxy reverso autenticador antes de expor além do localhost. Veja [SECURITY.pt-BR.md](SECURITY.pt-BR.md). ## Instalação @@ -63,8 +63,11 @@ Rode via Docker Compose (recomendado pra operadores): cp .env.example .env mkdir -p config && cp examples/xexeu.toml config/xexeu.toml docker compose pull && docker compose up -d +docker compose logs xexeu | grep token # link avulso de admin, se XEXEU_ADMIN_TOKEN não estiver definido ``` +A imagem é pública: `docker pull git.lucasrguerra.dev.br/ciberfauna/xexeu:latest`. + Ou builde e rode localmente com Docker: ```bash @@ -78,6 +81,13 @@ cargo build --release -p xexeu-cli ./target/release/xexeu --help ``` +Ou baixe o CLI avulso na [página de releases](https://git.lucasrguerra.dev.br/ciberfauna/xexeu/releases) (`linux-x86_64` e `linux-aarch64`) e confira com o `.sha256`: + +```bash +sha256sum -c xexeu-v1.0.0-linux-x86_64.tar.gz.sha256 +tar xzf xexeu-v1.0.0-linux-x86_64.tar.gz +``` + Matriz de plataforma suportada pras imagens de container: `linux/amd64` e `linux/arm64`. ## Primeiros passos @@ -106,7 +116,7 @@ Veja [docs/pt-BR/cli.md](docs/pt-BR/cli.md) pra referência completa de comandos ```bash cargo test --workspace cargo clippy --workspace --all-targets -- -D warnings -scripts/verificar.sh +scripts/check.sh ``` Veja **[CONTRIBUTING.pt-BR.md](CONTRIBUTING.pt-BR.md)** e **[docs/pt-BR/arquitetura.md](docs/pt-BR/arquitetura.md)**. @@ -117,7 +127,6 @@ Veja **[CONTRIBUTING.pt-BR.md](CONTRIBUTING.pt-BR.md)** e **[docs/pt-BR/arquitet - Varreduras autenticadas (SSH/WinRM) e validação ativa de exploit são não-objetivos. - O modo degradado `nativo-sem-raw` é restrito a TCP connect e não tem descoberta ICMP/ARP. - Expansão de alvo IPv6 é limitada a prefixos até `/112` ou listas explícitas de host; o próprio motor SYN cru só varre alvos IPv4 (os IPv6 recorrem automaticamente ao `nativo-sem-raw`). -- Sem releases/imagens de container publicados ainda — builde a partir do código-fonte ou `docker compose up -d --build` até o primeiro release com tag. ## Pra onde está indo @@ -125,9 +134,9 @@ Resumo do [ROADMAP](ROADMAP.pt-BR.md): | | | |---|---| -| **Feito** | Crates do workspace, motores de varredura SYN/connect nativos, fingerprint, correlação CVE/KEV, diffs por escopo, armazenamento SQLite+Parquet, dashboard, relatório executivo, exportação CSV, CRUD de config com hot-reload do scanner, CI/CD | -| **Próximo** | Primeiro release com tag e imagem de container publicada | -| **Depois** | Adaptador `nmap` e a variante `xexeu-scanner-nmap`, varredura autenticada, notificações | +| **Feito (1.0.0)** | Crates do workspace, motores de varredura SYN/connect nativos, fingerprint, correlação CVE/KEV, diffs por escopo, armazenamento SQLite+Parquet, dashboard, relatório executivo, exportação CSV, CRUD de config com hot-reload do scanner protegido por token de administração, CI/CD com imagem e CLI publicados | +| **Próximo** | Fuzzing e testes de propriedade, alertas por webhook, métricas Prometheus | +| **Depois** | Adaptador `nmap` e a variante `xexeu-scanner-nmap`, alertas por e-mail, OSV e mapeamento de backports de distribuição | | **Não planejado** | Payloads de exploração, motor NASL, serviços de nuvem obrigatórios, wrapper desktop Tauri | ## Licença diff --git a/ROADMAP.md b/ROADMAP.md index 8aaee48..96e9b05 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -2,9 +2,11 @@ **English** · [Português](ROADMAP.pt-BR.md) -This roadmap outlines the implementation plan for Xexéu based on the approved specification (`openspec/changes/criar-xexeu/`). +Xexéu does continuous attack-surface and vulnerability auditing: it sweeps authorized networks on a schedule, fingerprints exposed services, correlates them with NVD/CISA KEV, and records every change in the surface. Always within an explicitly authorized scope, with no active exploitation. -## Done +## Done (1.0.0) + +- **Admin token for configuration changes:** the group CRUD routes require `XEXEU_ADMIN_TOKEN` (or a one-off token printed at startup), compared in constant time, plus a same-origin check. - **Design approval & specification:** formal design and task breakdown completed (`proposal.md`, `design.md`, `tasks.md`). - **Rust workspace & CLI:** `crates/xexeu-core` and `crates/xexeu-cli`; `serve`, `scanner`, `scan`, `config check`, `feeds sync`/`import`, `changes`, `export`, `doctor` all implemented, not stubs. @@ -13,17 +15,19 @@ This roadmap outlines the implementation plan for Xexéu based on the approved s - **Non-intrusive vulnerability identification:** local NVD CVE JSON 2.0 + CISA KEV caching, offline import or live sync (one-shot or periodic background, independent of image/binary updates); deterministic CPE → CVE matcher with confidence levels (`alta`/`média`/`baixa`); safe configuration checks (expired/soon-to-expire TLS certificates, unencrypted administrative ports). - **Storage, diff engine & change history:** embedded SQLite (state) + Parquet (immutable sweep batches) — see `docs/architecture.md` for why SQLite instead of the originally-specified DuckDB; idempotent batch ingestion; scoped diff computation that never produces a false disappearance from a partial sweep; debounced state transitions (`ausencias_para_sumir`). - **API, dashboard & executive report:** Axum API (`/api/health`, `/api/status`, `/api/hosts`, `/api/changes`, `/api/config*`, `/api/export/*.csv`); embedded vanilla HTML/CSS/JS dashboard with a CVSS-severity palette, SVG charts and group CRUD; an A4, Paged.js-paginated executive report at `/relatorio`. -- **CI/CD & hardening:** Gitea `ci.yml`/`release.yml`, `scripts/verificar.sh` and a pre-push hook, a multi-stage `Dockerfile`, and `docker-compose.yml` — all validated end-to-end against a real scan target (DVWA) through the actual hardened containers, not just the host binary. +- **CI/CD & hardening:** Gitea `ci.yml`/`release.yml`, `scripts/check.sh` and a pre-push hook, a multi-stage `Dockerfile`, and `docker-compose.yml` — all validated end-to-end against a real scan target (DVWA) through the actual hardened containers, not just the host binary. - **Bilingual documentation:** `README`, `CHANGELOG`, `CONTRIBUTING`, `SECURITY`, `ROADMAP` and the full `docs/` set (architecture, CLI, configuration, Docker, interface, support), EN/PT-BR pairs, with real dashboard screenshots. ## Next -- **First tagged release:** cut `v1.0.0` and publish the container image to the Gitea registry via `release.yml`. +- **Robustness:** fuzzing of the parsers that read untrusted input (service banners, NVD/KEV feeds, target expansion), property tests for the diff engine's no-false-disappearance guarantee, `xexeu-cli` split into modules, and a weekly dependency audit. +- **Alert notifications:** outbound webhooks for critical new findings or surface changes. +- **Prometheus metrics:** `/metrics` with sweep durations, host counts and feed age. ## Later - **`nmap` adapter & `xexeu-scanner-nmap` variant:** optional integration with the external `nmap` binary for richer service fingerprinting on profiles that opt in. -- **Alert notifications:** outbound webhooks and email alerting for critical new findings or surface changes. +- **Email alerting:** the same events as the webhooks, delivered by SMTP. - **Distribution backport mapping:** automated detection of backported vulnerability fixes in Debian/Ubuntu packages, to reduce false positives in version-based CVE matching. - **OSV feed integration:** Open Source Vulnerabilities database correlation for exposed application dependencies. - **Advanced network topologies:** coordinated multi-scanner worker pools reporting to a centralized aggregator daemon. diff --git a/ROADMAP.pt-BR.md b/ROADMAP.pt-BR.md index 528e6d6..824074a 100644 --- a/ROADMAP.pt-BR.md +++ b/ROADMAP.pt-BR.md @@ -2,9 +2,11 @@ [English](ROADMAP.md) · **Português** -Este roadmap detalha o plano de implementação do Xexéu com base na especificação aprovada (`openspec/changes/criar-xexeu/`). +O Xexéu faz auditoria contínua de superfície de ataque e de vulnerabilidades: varre redes autorizadas num agendamento, identifica os serviços expostos, correlaciona com NVD/CISA KEV e registra cada mudança na superfície. Sempre dentro de um escopo explicitamente autorizado, sem exploração ativa. -## Concluído +## Concluído (1.0.0) + +- **Token de administração para mudanças de configuração:** as rotas de CRUD de grupos exigem `XEXEU_ADMIN_TOKEN` (ou um token avulso impresso na partida), comparado em tempo constante, mais checagem de mesma origem. - **Aprovação do design e especificação:** design formal e decomposição em tarefas concluídos (`proposal.md`, `design.md`, `tasks.md`). - **Workspace Rust e CLI:** `crates/xexeu-core` e `crates/xexeu-cli`; `serve`, `scanner`, `scan`, `config check`, `feeds sync`/`import`, `changes`, `export`, `doctor` todos implementados de verdade, não são mais stub. @@ -13,17 +15,19 @@ Este roadmap detalha o plano de implementação do Xexéu com base na especifica - **Identificação não intrusiva de vulnerabilidades:** cache local do NVD CVE JSON 2.0 + CISA KEV, importação offline ou sync ao vivo (único ou periódico em segundo plano, independente de atualização de imagem/binário); correlacionador determinístico CPE → CVE com níveis de confiança (`alta`/`média`/`baixa`); checagens seguras de configuração (certificados TLS expirados ou prestes a expirar, portas administrativas sem criptografia). - **Armazenamento, motor de diff e histórico de mudanças:** SQLite embutido (estado) + Parquet (lotes de varredura imutáveis) — veja `docs/pt-BR/arquitetura.md` pro motivo de SQLite em vez do DuckDB originalmente especificado; ingestão idempotente de lotes; cálculo de diff por escopo que nunca gera um falso desaparecimento a partir de uma varredura parcial; amortecimento de transições de estado (`ausencias_para_sumir`). - **API, dashboard e relatório executivo:** API Axum (`/api/health`, `/api/status`, `/api/hosts`, `/api/changes`, `/api/config*`, `/api/export/*.csv`); dashboard embutido em HTML/CSS/JS puro com paleta por severidade CVSS, gráficos SVG e CRUD de grupos; relatório executivo A4 paginado com Paged.js em `/relatorio`. -- **CI/CD e hardening:** `ci.yml`/`release.yml` do Gitea, `scripts/verificar.sh` e hook de pre-push, `Dockerfile` multi-stage, e `docker-compose.yml` — tudo validado de ponta a ponta contra um alvo real de varredura (DVWA) através dos containers hardened de verdade, não só do binário no host. +- **CI/CD e hardening:** `ci.yml`/`release.yml` do Gitea, `scripts/check.sh` e hook de pre-push, `Dockerfile` multi-stage, e `docker-compose.yml` — tudo validado de ponta a ponta contra um alvo real de varredura (DVWA) através dos containers hardened de verdade, não só do binário no host. - **Documentação bilíngue:** `README`, `CHANGELOG`, `CONTRIBUTING`, `SECURITY`, `ROADMAP` e todo o conjunto `docs/` (arquitetura, CLI, configuração, Docker, interface, suporte), pares EN/PT-BR, com screenshots reais do dashboard. ## Próximo -- **Primeiro release com tag:** cortar a `v1.0.0` e publicar a imagem de container no registro do Gitea via `release.yml`. +- **Robustez:** fuzzing dos parsers que leem entrada não confiável (banners de serviço, feeds NVD/KEV, expansão de alvos), testes de propriedade da garantia de nenhum desaparecimento falso do motor de diff, `xexeu-cli` dividido em módulos e auditoria semanal de dependências. +- **Notificações de alerta:** webhooks de saída para achados críticos novos ou mudanças na superfície. +- **Métricas Prometheus:** `/metrics` com duração das varreduras, contagem de hosts e idade dos feeds. ## Depois - **Adaptador `nmap` e variante `xexeu-scanner-nmap`:** integração opcional com o binário externo `nmap` pra fingerprint de serviço mais rico em perfis que optarem por isso. -- **Notificações de alerta:** webhooks externos e alertas por e-mail pra novas vulnerabilidades críticas ou mudanças de superfície. +- **Alertas por e-mail:** os mesmos eventos dos webhooks, entregues por SMTP. - **Mapeamento de backports de distribuições:** dedução automática de correções retroportadas em pacotes Debian/Ubuntu, pra reduzir falsos positivos na correlação de CVE por versão. - **Integração com feeds OSV:** correlação contra a base Open Source Vulnerabilities pra dependências de aplicações expostas. - **Topologias distribuídas:** agrupamentos de múltiplos scanners reportando pra um daemon agregador centralizado. diff --git a/scripts/package-cli.sh b/scripts/package-cli.sh new file mode 100755 index 0000000..41bf1e5 --- /dev/null +++ b/scripts/package-cli.sh @@ -0,0 +1,39 @@ +#!/usr/bin/env bash +# Builds the CLI for a target platform and packages it for a release: +# xexeu--.tar.gz alongside a .sha256 checksum file. +# +# scripts/package-cli.sh v1.0.3 linux-x86_64 x86_64-unknown-linux-gnu +# +# Supported platforms: linux-x86_64 and linux-aarch64. When cross-compiling +# from a non-x86_64 host, uses gcc-x86-64-linux-gnu. Writes the archives to the +# repository root and prints their filenames. +set -euo pipefail + +cd "$(dirname "$0")/.." + +tag=${1:?usage: package-cli.sh } +platform=${2:?usage: package-cli.sh } +target=${3:?usage: package-cli.sh } + +case "$target" in + x86_64-unknown-linux-gnu) + if [ "$(uname -m)" != x86_64 ]; then + export CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_LINKER=x86_64-linux-gnu-gcc + export CC_x86_64_unknown_linux_gnu=x86_64-linux-gnu-gcc + fi ;; +esac + +rustup target add "$target" >/dev/null 2>&1 || true +cargo build --release --locked -p xexeu-cli --target "$target" + +name="xexeu-${tag}-${platform}" +rm -rf "$name"; mkdir "$name" +cp "${CARGO_TARGET_DIR:-target}/${target}/release/xexeu" "$name/" +cp README.md LICENSE-MIT LICENSE-APACHE "$name/" + +tar czf "$name.tar.gz" "$name" +asset="$name.tar.gz" +rm -rf "$name" +sha256sum "$asset" > "$asset.sha256" +echo "$asset" +echo "$asset.sha256" diff --git a/scripts/release-upload.sh b/scripts/release-upload.sh new file mode 100755 index 0000000..2a24cc2 --- /dev/null +++ b/scripts/release-upload.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Uploads assets to a Gitea release, replacing any existing asset with the same +# filename so re-running a CI job never fails on duplicate attachments. +# +# API=https://git.example.com/api/v1/repos/owner/repo TOKEN=... \ +# scripts/release-upload.sh v1.2.3 file1 file2 +set -euo pipefail + +: "${API:?set API (Gitea repository API URL)}" +: "${TOKEN:?set TOKEN}" +tag=${1:?usage: release-upload.sh ...} +shift + +auth=(-H "Authorization: token $TOKEN") +id=$(curl -fsS "${auth[@]}" "$API/releases/tags/$tag" | jq -r .id) + +for file in "$@"; do + name=$(basename "$file") + encoded=$(jq -rn --arg n "$name" '$n|@uri') + for old in $(curl -fsS "${auth[@]}" "$API/releases/$id/assets" | jq -r --arg n "$name" '.[] | select(.name == $n) | .id'); do + curl -fsS -X DELETE "${auth[@]}" "$API/releases/$id/assets/$old" + done + curl -fsS -X POST "${auth[@]}" -F "attachment=@$file" "$API/releases/$id/assets?name=$encoded" >/dev/null + echo "uploaded: $name" +done