Commit Graph
30 Commits
Author SHA1 Message Date
Lucas RayanandClaude Opus 5.5 513741e403 fix(ui): keep recovery codes on screen and report failed logout
While one-time codes are visible the 401 redirect is suppressed and a
beforeunload guard is active until the done button. MFA buttons follow the
account state. A failed logout shows an error instead of looking successful.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 21:03:27 -03:00
Lucas RayanandClaude Opus 5.5 348e61ca95 fix(auth): close unauthenticated lockout and tighten the daemon's edges
Key login failures by username and client address with decay, plus a loose
per-username limit that delays every address by a bounded time. Refused
attempts write nothing. Unknown usernames share the code path. MFA and session
password checks keep a persistent user-bound count that needs a password or a
session to reach.

Also: local mode refuses a non-loopback bind outside a container; security
headers on every response; the Argon2 permit lives as long as the blocking
task; a required password change rechecks role, MFA and epoch; auth reset
works for any user; mfa_enabled in /api/auth/state; disabling MFA that is off
is refused with no side effects; StateCorrupt keeps only line and column.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 21:03:27 -03:00
Lucas RayanandClaude Opus 5.5 3e4c4201e5 docs(auth): fix README, health, reset and support docs
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:37:03 -03:00
Lucas RayanandClaude Opus 5.5 06b9980659 feat(auth): admin reset, docs and image smoke test
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:34:57 -03:00
Lucas RayanandClaude Opus 5.5 42892cb37f feat(auth): login, MFA and account screens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:21:33 -03:00
Lucas RayanandClaude Opus 5.5 67cf62b536 fix(auth): make the image HEALTHCHECK follow the transport mode
In tls mode the daemon speaks HTTPS only, so the plain-HTTP probe left the
container permanently unhealthy. The probe now uses curl -k against
https://127.0.0.1 when ACAUA_TRANSPORT=tls (loopback to itself, status only).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:11:05 -03:00
Lucas RayanandClaude Opus 5.5 dc8c7fa248 feat(auth): explicit transport modes
ACAUA_TRANSPORT (local, tls, proxy) is now required; a missing or invalid
value stops the daemon. local refuses a non-loopback ACAUA_PUBLISHED, tls
serves HTTPS via axum-server/rustls, proxy needs ACAUA_TRUSTED_PROXIES.
HSTS is sent in tls and proxy modes. The image defaults to local.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 20:03:00 -03:00
Lucas RayanandClaude Opus 5.5 5ad89d5be5 fix(auth): throttle bootstrap and require reauth for user changes
Bootstrap takes the client IP, is limited per IP, and writes no audit line
once an admin exists. Creating, changing the role of or deleting a user now
needs a session with recent reauthentication; API tokens are refused.
/api/analyze and /api/update return fixed messages and log the detail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:56:59 -03:00
Lucas RayanandClaude Opus 5.5 2b1bc63340 feat(auth): deny-by-default HTTP layer
A global middleware wraps the router and its fallback: only PUBLIC_ROUTES
answer without a credential, and unknown paths look like protected ones.
Adds cookie sessions with per-session CSRF, scoped Bearer tokens, the
/api/auth and /api/admin handlers, Transport for client IP and Secure, and
pending-token enrollment re-checked inside one store update.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:51:42 -03:00
Lucas RayanandClaude Opus 5.5 a90ff81650 fix(auth): per-session reauth and admin token lifecycle
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:40:08 -03:00
Lucas RayanandClaude Opus 5.5 c2d352ae30 feat(auth): sessions and scoped API tokens
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:34:37 -03:00
Lucas RayanandClaude Opus 5.5 411a21ca6e fix(auth): force a password change after reset_admin
reset_admin now sets a persisted must_change_password flag. While it is set,
login and confirm_mfa return PasswordChangeRequired, a ticket that only allows
change_required_password, instead of a session. confirm_mfa therefore returns
LoginStep. change_password clears the flag and refuses the current password
as the new one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:29:52 -03:00
Lucas RayanandClaude Opus 5.5 2b71ae41c0 feat(auth): accounts, first-run setup and MFA login flow
Adds AuthService with single-use setup code, password login, TOTP and
recovery codes, enrollment, account management and local admin reset.
Attempts are reserved before Argon2 so parallel guesses cannot outrun the
per-account delay or the IP limit, and unknown usernames follow the same
schedule as real accounts. Passwords are NFC-normalized; repeated-character
and all-digit passwords are refused.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:24:46 -03:00
Lucas RayanandClaude Opus 5.5 deea3e245b feat(auth): password hashing, TOTP and recovery codes
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:10:26 -03:00
Lucas RayanandClaude Opus 5.5 fbaeeca60c fix(auth): tail audit log as bytes and check last byte by seeking
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:02:58 -03:00
Lucas RayanandClaude Opus 5.5 c757db209d fix(auth): require state version, atomic key creation, torn audit lines
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 19:01:11 -03:00
Lucas RayanandClaude Opus 5.5 ef25bf7eb1 feat(auth): encrypted secrets, atomic state and audit log
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 18:57:45 -03:00
Lucas RayanandClaude Opus 5.5 0a5fdda0ba chore: keep local specs and plans out of version control
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 18:54:39 -03:00
Lucas RayanandClaude Opus 5.5 a17af2fac8 chore(release): 0.2.0
Release / Plan (reuse the published image?) (push) Successful in 4s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and clippy (push) Successful in 5m32s
CI / Dependency audit (push) Successful in 12s
CI / Tests (Linux) (push) Successful in 14m18s
Release / ci (push) Successful in 14m19s
Release / Build image (amd64) (push) Successful in 27s
Release / Build image (arm64) (push) Successful in 8m37s
Release / Publish tags (push) Successful in 21s
Release / Gitea release (push) Successful in 6s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:26:46 -03:00
Lucas RayanandClaude Opus 5.5 a218111996 feat(report): executive report at /relatorio with a Relatório button
Release / Plan (reuse the published image?) (push) Successful in 4s
CI / Tests (Linux) (push) Successful in 34s
Release / ci (push) Successful in 57s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and clippy (push) Successful in 13s
CI / Dependency audit (push) Successful in 10s
Release / Build image (arm64) (push) Failing after 28s
Release / Build image (amd64) (push) Successful in 7m14s
Release / Publish tags (push) Skipped
Release / Gitea release (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 21:23:57 -03:00
Lucas RayanandClaude Sonnet 5.5 6a14c29b97 docs: update changelogs after the rename to Harpia
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-03 20:44:47 -03:00
Lucas RayanandClaude Opus 5.5 2a4357377e docs(changelog): Portuguese entry for the smoke test fix
CI / Format and clippy (pull_request) Successful in 25s
CI / Dependency audit (pull_request) Successful in 16s
CI / Tests (Linux) (pull_request) Successful in 43s
CI / Docker image (build and smoke test) (pull_request) Successful in 4m34s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:19:17 -03:00
Lucas RayanandClaude Opus 5.5 15e70b5003 fix(ci): stop the image smoke test racing on SIGPIPE under pipefail
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 11:18:54 -03:00
Lucas RayanandClaude Sonnet 5 673b11c88c ci: replace docker/build-push-action with plain docker buildx build
Release / Publish tags (push) Successful in 13s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Successful in 32s
Release / Build image (amd64) (push) Successful in 20s
Release / Build image (arm64) (push) Successful in 19s
CI / Format and clippy (push) Successful in 16s
CI / Tests (Linux) (push) Successful in 31s
CI / Dependency audit (push) Successful in 16s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 3s
docker/build-push-action's upstream repo has ~260MB of git history, which
reliably hangs the act runner's Go-based git clone on the linux-amd64
(Hostinger) runner — confirmed it's not a network or cache issue: curl to
codeload.github.com and a plain `git clone` of the same repo both complete
in seconds from the host and from inside the exact job container. Only
act's own clone of this specific action hangs, every time.

A raw `docker buildx build` with the same flags does the same job without
cloning anything.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-11-01 10:18:18 -03:00
Lucas RayanandClaude Sonnet 5 f2a10ca1a6 docs: mark v0.1.0 as the first real release
CI / Tests (Linux) (push) Successful in 33s
CI / Dependency audit (push) Successful in 19s
Release / Build image (amd64) (push) Canceled after 0s
Release / Build image (arm64) (push) Canceled after 0s
Release / Publish tags (push) Canceled after 0s
Release / Gitea release (push) Canceled after 0s
Release / ci (push) Successful in 34s
Release / Plan (reuse the published image?) (push) Successful in 5s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and clippy (push) Successful in 15s
The previous "0.1.0 - 2026-10-31" entry documented a pre-implementation
skeleton and explicitly said no release artifact had been published.
Since it was never tagged, fold it into a single accurate v0.1.0 entry
dated today, covering the real first release: all 4 pillars, Docker-only
distribution, and the working dashboard.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-11-01 08:33:51 -03:00
Lucas RayanandClaude Sonnet 5 3e7e730f23 docs: log the dashboard UI work in the changelog
Release / Plan (reuse the published image?) (push) Canceled after 0s
Release / ci (push) Canceled after 0s
Release / Build image (amd64) (push) Canceled after 0s
Release / Build image (arm64) (push) Canceled after 0s
Release / Publish tags (push) Canceled after 0s
Release / Gitea release (push) Canceled after 0s
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-11-01 08:32:26 -03:00
Lucas RayanandClaude Sonnet 5 be47b607df feat: build a real dashboard and fix dead panel navigation in the web UI
Release / Plan (reuse the published image?) (push) Successful in 4s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and clippy (push) Successful in 16s
CI / Dependency audit (push) Successful in 17s
CI / Tests (Linux) (push) Successful in 34s
Release / ci (push) Successful in 35s
Release / Build image (arm64) (push) Successful in 4m55s
Release / Build image (amd64) (push) Failing after 11m10s
Release / Publish tags (push) Skipped
Release / Gitea release (push) Skipped
The sidebar nav (Overview/Alerts/Analysis) only did scrollIntoView on a
single stacked page, so clicking it produced no visible change. The
Alerts/Analysis panels were also placeholder shells with no real data
exploration despite the API already exposing rich per-pillar evidence.

- app.js/app.css/index.html: real panel switching via showView()/currentView,
  toggling an .active class with `.view:not(.active) { display: none }`;
  settings keeps opening its own dialog without disturbing the active view.
- New Hosts panel: table of observed hosts ranked by fusion score, with
  per-pillar (P1/P2/P3) columns, search, and drill-down into each pillar's
  evidence. Documents the known limitation that /api/alerts only lists hosts
  with at least one alert (no /api/hosts endpoint exists yet), so a benign
  host with no alert won't appear.
- Alerts panel: filterable by pillar and minimum score, sortable, with
  full evidence rendered as a formatted key/value table instead of raw JSON.
- Overview panel: KPI tiles (alert count, hosts with alerts, max score,
  dataset records) plus two interactive SVG charts (top hosts by fusion
  score, alert distribution by pillar) with hover tooltips.
- i18n-en.js: English strings for all new UI text.

No Rust files changed; this is purely apps/gui/ui/ consuming the existing
/api/alerts, /api/analyze and /api/status endpoints.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-11-01 08:28:08 -03:00
Lucas RayanandClaude Sonnet 5 c64bbbf775 feat: implement Pillars 2-4 and fix a production false-positive in Pillar 1
Pillar 1 v1.1 (shipped earlier) flagged benign browsing bursts as
beaconing: on short captures, grid periods longer than the observed
span never complete a cycle, so significance saturates to 1 and the
score sticks at exactly 0.5. v1.2 caps the grid at a third of the
observed span, requires a minimum number of completed cycles, and
excludes protocols that are periodic by nature (NTP, DNS, mDNS,
ICMP). Validated against 300 seeds per scenario: false positives on
bursty traffic drop from the 290-300/300 that v1.1 produced to 0/300,
with every beacon-detection scenario scoring unchanged.

Add Pillar 2 (persistent/long-lived sessions, with Zeek's fragmented
TCP sessions rejoined after a 5-minute gap), Pillar 3 (DNS tunneling
via Shannon-entropy information volume per subdomain per hour; the
Jensen-Shannon divergence was measured and does not separate tunnels
from benign CDN subdomains, so it stays in the evidence at zero
weight instead of in the score), and Pillar 4 (deterministic
noisy-OR fusion across the three pillars).

The fusion formula was validated against 8 labeled real-traffic
vectors (IoT-23, CTU-Normal) with tolerance <= 1e-4. A known
limitation is kept, not hidden: a benign Philips HUE bulb's strict
periodic polling and a 21.9h session score it above three real C2
hosts. No weight or threshold was tuned to mask this; it is
documented in the architecture docs instead.

Also fixes real bugs found along the way: ingest_dir's partition
count summed file names instead of distinct dates, DuckDB errors
were counted as bad rows, /api/alerts always returned an empty list
regardless of the last analysis, and the dashboard still claimed
every pillar was unimplemented.

Restores four design corrections that were missing from
docs/architecture.md (KL to Jensen-Shannon, the persistent-session
detector, the JA4 licensing boundary, and deterministic reduction
order), and catalogs the public datasets used for validation
(IoT-23, CTU-Normal, Mendeley DTQBC) with their licenses and SHA-256
checksums under research/validation/.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-11-01 00:28:54 -03:00
Lucas RayanandClaude Sonnet 5 8a80504c45 refactor: distribute Acaua as a Docker image instead of a desktop app
Release / Plan (reuse the published image?) (push) Successful in 3s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and clippy (push) Successful in 4m32s
CI / Dependency audit (push) Successful in 11s
CI / Tests (Linux) (push) Successful in 9m15s
Release / ci (push) Successful in 9m18s
Release / Build image (arm64) (push) Failing after 7m7s
Release / Build image (amd64) (push) Failing after 13m53s
Release / Publish tags (push) Skipped
Release / Gitea release (push) Skipped
Acaua is a collective SOC daemon consuming only Zeek log files, not a
single-user tool needing local hardware like its siblings. Drop the
Tauri desktop shell, installers and self-update entirely; the server
and its web dashboard ship as a container, updated by pulling a new
image tag.

Link against the official prebuilt libduckdb instead of compiling it
from source via the bundled feature, cutting image build time from
15+ minutes to about 3. Fix a real bug found along the way: as PID 1
in a container, the daemon ignored SIGTERM and was always killed
after the stop timeout; it now shuts down gracefully.

Also corrects the Pillar 1 beaconing score: the period estimate had a
harmonic alias (a perfectly periodic 4h series resolved to 600s), and
the old score formula flagged pure random traffic as suspicious
(p95 = 0.839 on Poisson noise). The new formula was validated against
300 samples per scenario.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-10-31 19:54:45 -03:00
Lucas RayanandClaude Sonnet 5 1b974bb90d chore: initial project skeleton
Acauã: Network Detection & Threat Hunting, heuristic analysis over a
rolling 7-day window using deterministic math (time series, graph
theory, information theory) instead of opaque ML models. Third
product in the Ciberfauna ecosystem, alongside Guará and Sabiá.

Follows the ecosystem's established conventions: OpenWolf project
memory, bilingual PT-BR/EN docs and UI, Gitea Actions CI/CD on the
same self-hosted runners, Conventional Commits, SemVer, logo and
productName handling, MIT OR Apache-2.0 licensing.

Architecture decision (made with the project owner after a dedicated
consultation, not the original blueprint's suggested stack): Rust
throughout, not Python/FastAPI/React. Most of the statistics (Bowley
skew, MADM, Shannon entropy, PCR, Z-score, novel-edge detection,
pivot chains) reduces to SQL over an embedded DuckDB/Parquet store;
only the spectral analysis and graph centrality need host-language
code, and both have workable Rust crates. Documented in full, including
six corrections to the original blueprint's math (Rayleigh/Schuster
instead of a degenerate Lomb-Scargle over bare timestamps, an explicit
sentinel for Bowley skew's Q3=Q1 case, Jensen-Shannon instead of
unbounded KL, a dedicated long-connection detector, JA4 vs. JA4+
licensing caution, deterministic per-alert evidence), in
docs/architecture.md.

Skeleton only: crates/acaua-core has the four detection pillars,
fusion, storage, zeek log parsing and the updater as typed stubs that
compile and return a clear "skeleton" status rather than real
detection logic — that is separate, future work. crates/acaua-cli has
serve/analyze/doctor/update. apps/gui is a minimal Tauri shell. Also
already includes the one-click desktop self-update mechanism shared
with Guará and Sabiá (AppImage/.deb/Windows installer), even with no
release published yet, for consistency across the ecosystem.

No Gitea repository exists for this project yet; this is a local-only
commit.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VAyr8d7HuAdUGB6aA5xmDD
2026-10-31 10:20:03 -03:00