Files
acaua/docs/cli.md
T
Lucas RayanandClaude Opus 5.5 b7fd1b7c8a docs(auth): describe the login budget and its limits
Also corrects cli.md, which said MFA is required for everyone.

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

123 lines
4.3 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Terminal
**English** · [Português](pt-BR/cli.md)
The `acaua` binary serves both as the CLI command runner and the background daemon.
This page describes the commands available in the engine.
```text
acaua <command> [options]
Commands:
serve Start the API and embedded web dashboard
analyze Analyze a Zeek log directory
doctor Check the local environment
update Check for available releases
auth Local account recovery (`auth reset`)
```
## `acaua serve`
Starts the HTTP API and the embedded web dashboard.
```bash
acaua serve --bind 127.0.0.1:8787 --data-dir .acaua
```
| Option | Default | Meaning |
|---|---|---|
| `--bind` | `127.0.0.1:8787` | Listen address |
| `--data-dir` | `.acaua` | Store and runtime files |
The default bind is loopback-only. Login is mandatory in every mode (MFA is mandatory for
administrators and optional for analysts), but plain HTTP is not encrypted: the daemon refuses to start without
`ACAUA_TRANSPORT` set to `local`, `tls` or `proxy`; `local` refuses a non-loopback
`--bind` unless `ACAUA_RUNTIME=container` (see
[docker.md](docker.md#authentication-and-transport)). In `tls` mode `--bind`
must be an `IP:port`. The API is documented in [architecture.md](architecture.md#api).
## `acaua analyze`
```bash
acaua analyze /var/log/zeek/current
acaua analyze /var/log/zeek/current --json
```
Validates the target directory, ingests `conn.log` and `dns.log` traffic into Parquet partitions,
and runs threat detection algorithms across pillars 1–4. The human-readable output reports summary metrics,
individual alerts, and the `hosts:` ranking section (top 10 by priority score):
```text
diretório: /var/log/zeek/current
logs lidos: 2
registros: 10450
alertas: 2
[0.850] Beaconing detected: 192.168.1.50:any -> 198.51.100.1:443 (period ~14400s, score 0.850)
[0.600] Persistent session: 192.168.1.50 -> 198.51.100.1:443 (6.0h, score 0.600)
hosts:
[0.784] 192.168.1.50 0.850/0.600/0.000
estado: ok
```
## `acaua doctor`
```bash
acaua doctor
acaua doctor --json
```
Runs environment checks:
- `zeek`: verifies `zeek --version` or detects containerized execution (`ACAUA_RUNTIME=container`).
- `curl`: confirms HTTP download availability.
- `duckdb`: confirms dynamic linkage against `libduckdb.so` in runtime.
- `research`: verifies that the research workspace remains isolated.
## `acaua auth reset`
```bash
acaua auth reset --username admin --data-dir .acaua
docker compose exec acaua acaua auth reset --username admin --data-dir /data/acaua
```
Local recovery for any account, administrator or analyst, that lost the password
or the authenticator. It removes the user's MFA, recovery codes, sessions and all
API tokens (read tokens included), clears the per-user count of MFA and session
password failures, writes an audit entry and prints a **temporary password once**.
The next login with it requires choosing a new password before any ordinary session;
an administrator enrolls MFA again first. It also clears the account's known
addresses and its login failure budget and per-address counts, which is the way in
for an owner locked out on an unknown address; a running daemon applies this at the
next login. An attacker still running can spend the budget again. The per-address
overall limit stays in the daemon's memory: wait for it, use another address, or
restart the daemon.
The command edits the data directory only: it never starts the daemon and does
not need `ACAUA_TRANSPORT`. A running daemon sees the change on its next request.
If the secret key is an external file, `ACAUA_SECRET_KEY_FILE` must be set for
the command too. An unknown user is refused.
## `acaua update`
```bash
acaua update
```
Queries the Gitea Releases API, compares the latest tag against the running
version, and prints upgrade instructions (`docker compose pull && docker compose up -d`
when running inside a container).
## Exit codes
| Code | Meaning |
|---|---|
| `0` | Success |
| `1` | Runtime error (invalid path, query error, I/O error) |
| `2` | Invalid command-line usage (clap) |
## Environment
| Variable | Meaning |
|---|---|
| `ACAUA_RUNTIME` | Set to `container` inside Docker images to adapt service checks |
| `DUCKDB_LIB_DIR` | Path to directory containing `libduckdb.so` when compiling natively |
| `LD_LIBRARY_PATH` | Shared library load path for `libduckdb.so` outside standard paths |