Compare commits

...
54 Commits
Author SHA1 Message Date
lucasrguerra f242f19b82 Merge pull request 'Urutau 2.3.1: Replay threats-only by default, no duplicate fetches' (#6) from perf/replay-load into main
Release / ci (push) Skipped
CI / Format and vet (push) Successful in 27s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / Build probe image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Gitea release (push) Successful in 7s
CI / Dependency audit (push) Successful in 15s
CI / Tests (Linux, race detector) (push) Successful in 1m11s
Release / Build hub image (amd64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 16s
Release / Publish tags (probe) (push) Successful in 15s
2026-11-23 13:18:07 +00:00
Lucas Rayan 6738876893 chore(release): 2.3.1
CI / Dependency audit (pull_request) Successful in 17s
CI / Tests (Linux, race detector) (pull_request) Successful in 1m38s
CI / Format and vet (pull_request) Successful in 38s
2026-11-23 10:16:20 -03:00
Lucas RayanandClaude Sonnet 5.5 91cdb4acbf perf(replay): threats-only by default, no duplicate first-page or summary fetch
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 10:15:50 -03:00
lucasrguerra 19bec553f4 Merge pull request 'Urutau 2.3.0: own traffic recorded, firewall telemetry, fast long-range studies' (#5) from release/2.3.0 into main
CI / Tests (Linux, race detector) (push) Successful in 1m18s
CI / Dependency audit (push) Successful in 22s
Release / Plan (reuse the published image?) (push) Successful in 7s
Release / Build hub image (amd64) (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 17s
Release / Publish tags (probe) (push) Successful in 15s
Release / Gitea release (push) Successful in 4s
CI / Format and vet (push) Successful in 28s
Release / ci (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
2026-11-23 12:19:14 +00:00
Lucas Rayan 5e472bc6c4 docs(changelog): 2.3.0 links in pt-BR
CI / Tests (Linux, race detector) (pull_request) Successful in 1m58s
CI / Dependency audit (pull_request) Successful in 19s
CI / Format and vet (pull_request) Successful in 1m6s
2026-11-23 09:15:29 -03:00
Lucas Rayan 7f9db226db chore(release): 2.3.0 2026-11-23 09:15:18 -03:00
Lucas Rayan f9a6783a1f Merge branch 'perf/long-range-studies' into release/2.3.0
# Conflicts:
#	CHANGELOG.md
2026-11-23 09:13:32 -03:00
Lucas RayanandClaude Sonnet 5.5 4ca9c7bf0c perf: serve long-range studies from a decoded closed-day cache
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 09:13:02 -03:00
Lucas Rayan 554ea1340c Merge branch 'feat/inbound-firewall-telemetry' into release/2.3.0
# Conflicts:
#	CHANGELOG.md
#	CHANGELOG.pt-BR.md
2026-11-23 09:09:54 -03:00
Lucas RayanandClaude Sonnet 5.5 aefdcea8d2 feat(ingress): firewall telemetry of inbound attempts (host kit --ingress)
Observation-only nftables table (prerouting -150, counters and a
rate-limited log, never drops or modifies), a per-minute counters file,
probe sources ingress and ingresscnt, a per-host hourly aggregate in the
hub (exact totals, sampled ports/ASNs/countries, banned share by the
hub's own ban state, no ban feedback loop), GET /api/v1/ingress, a
Defense section, doctor check, docs EN/pt-BR and tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 09:09:16 -03:00
Lucas RayanandClaude Sonnet 5.5 3511a7141c feat: record own and trusted web traffic in its own classes instead of dropping it
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-23 09:03:57 -03:00
lucasrguerra 4143bf599e Merge pull request 'fix(egress): container map refreshed on start; no new_geo for anycast CDNs (2.2.2)' (#4) from fix/egress-attribution-anycast into main
Release / ci (push) Skipped
CI / Format and vet (push) Successful in 1m21s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / Build probe image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Publish tags (probe) (push) Successful in 21s
Release / Publish tags (hub) (push) Successful in 21s
CI / Dependency audit (push) Successful in 47s
CI / Tests (Linux, race detector) (push) Successful in 2m26s
Release / Build hub image (amd64) (push) Skipped
Release / Gitea release (push) Successful in 4s
2026-11-19 18:43:51 +00:00
Lucas RayanandClaude Opus 5.5 65015158dc fix(egress): container map refreshed on start; no new_geo for anycast CDNs (2.2.2)
CI / Format and vet (pull_request) Successful in 1m43s
CI / Dependency audit (pull_request) Successful in 39s
CI / Tests (Linux, race detector) (pull_request) Successful in 2m37s
A LambdaMail redeploy swapped rspamd and clamav addresses and the hub judged
the next minute with the stale containers.map, filing SURBL/DNS traffic under
clamav and freshclam under dns. The host kit now runs urutau-containers-watch
(docker events -> map rewrite) and the probe polls the file every 2 s.

new_geo is skipped for large CDNs/clouds: anycast addresses carry a
meaningless database country (1.1.1.1 in AU, Cloudflare edges in CA).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-19 15:25:23 -03:00
Lucas RayanandClaude Opus 5.5 87178dbc94 fix: head fingerprint covers the whole first line; hub no longer drops traefik generations whose first 64 bytes repeat (2.2.1)
CI / Tests (Linux, race detector) (push) Successful in 2m7s
Release / Build probe image (amd64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Gitea release (push) Successful in 4s
CI / Format and vet (push) Successful in 1m15s
CI / Dependency audit (push) Successful in 36s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Build hub image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 18s
Release / Publish tags (probe) (push) Successful in 18s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:57:25 -03:00
Lucas RayanandClaude Opus 5.5 c2bee81bc1 fix: back to all hosts in the filter; release 2.2.0
Release / Plan (reuse the published image?) (push) Successful in 7s
Release / Build probe image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / ci (push) Skipped
Release / Publish tags (probe) (push) Successful in 16s
CI / Dependency audit (push) Successful in 38s
CI / Tests (Linux, race detector) (push) Successful in 2m6s
Release / Build hub image (amd64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 17s
Release / Gitea release (push) Successful in 5s
CI / Format and vet (push) Successful in 1m9s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 20:32:25 -03:00
Lucas Rayan 551b0ebc40 Merge branch 'fix/traffic-hosts' 2026-11-16 20:27:36 -03:00
Lucas RayanandClaude Sonnet 5.5 7b90d9e40f fix: host filter accepts all and comma lists; hub no longer drops traefik lines after a copytruncate rotation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 20:27:18 -03:00
Lucas RayanandClaude Sonnet 5.5 0db50c05c4 fix(ip): show egress destination view instead of ambiguous 404
Add GET /api/v1/ip/{ip}/egress and Engine.Dst; the IP page renders who
connected, findings and linked incidents, or a definitive never-seen message.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-16 20:22:20 -03:00
Lucas RayanandClaude Opus 5.5 19afd221e2 fix: keep probe files across hub restarts; phone filter sheet above the tab bar (2.1.2)
CI / Format and vet (push) Successful in 1m4s
CI / Dependency audit (push) Successful in 33s
CI / Tests (Linux, race detector) (push) Successful in 2m10s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Gitea release (push) Successful in 5s
Release / Build hub image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 16s
Release / Publish tags (probe) (push) Successful in 16s
The hub kept a probe's resolv.conf and containers.map only in memory, so
after a restart the egress lines replayed on reconnect were judged with
the hub's own resolvers (false dns_bypass, hostinger/INC-8). They are now
saved in the node directory and loaded at start.

Phone: the global filter sheet opens above the bottom tab bar, the tab
bar closes it, and the sticky filter bar no longer covers the More menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 08:41:28 -03:00
Lucas RayanandClaude Opus 5.5 fb2dfa3fb2 fix(ui): incidents status tabs had a 1 px vertical micro-scroll (2.1.1)
CI / Dependency audit (pull_request) Successful in 31s
CI / Tests (Linux, race detector) (pull_request) Successful in 1m50s
Release / ci (push) Skipped
Release / Build hub image (amd64) (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 15s
Release / Publish tags (probe) (push) Successful in 15s
Release / Gitea release (push) Successful in 5s
CI / Format and vet (pull_request) Successful in 1m1s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:41:27 -03:00
Lucas RayanandClaude Opus 5.5 77bea54fb3 test(probeagent): wait for Run to return before TempDir cleanup
CI / Format and vet (push) Successful in 59s
CI / Dependency audit (push) Successful in 31s
CI / Tests (Linux, race detector) (push) Successful in 1m39s
Release / ci (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / Build hub image (amd64) (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 15s
Release / Publish tags (probe) (push) Successful in 16s
Release / Gitea release (push) Successful in 5s
Tests started probes with a deferred cancel and never waited for Run, so a
final state write could race t.TempDir's RemoveAll ('directory not empty').
startRun now registers a cleanup that cancels and waits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:26:39 -03:00
Lucas RayanandClaude Opus 5.5 fa31cd2ccb ci(release): build when the skipped ci is a reusable workflow
Release / Plan (reuse the published image?) (push) Successful in 5s
CI / Format and vet (push) Successful in 1m2s
Release / Publish tags (probe) (push) Skipped
CI / Dependency audit (push) Successful in 29s
CI / Tests (Linux, race detector) (push) Failing after 1m34s
Release / ci (push) Failing after 1m34s
Release / Build hub image (amd64) (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Publish tags (hub) (push) Skipped
Release / Gitea release (push) Skipped
Gitea does not report result == 'skipped' for a skipped 'uses:' job, so the
builds were skipped with it and v2.1.0 published nothing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:22:13 -03:00
Lucas RayanandClaude Opus 5.5 00c4ab6d4a feat: 2.1.0 incidents, filter bar and IP analysis redesign; probe egress files fix
CI / Format and vet (pull_request) Successful in 1m1s
CI / Dependency audit (pull_request) Successful in 32s
Release / Build hub image (amd64) (push) Skipped
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Publish tags (hub) (push) Skipped
Release / Publish tags (probe) (push) Skipped
Release / Gitea release (push) Skipped
CI / Tests (Linux, race detector) (pull_request) Successful in 1m55s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 23:18:38 -03:00
Lucas RayanandClaude Opus 5.5 7c92d4b359 ci: build and test each tree once
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Build hub image (amd64) (push) Skipped
Release / Build probe image (amd64) (push) Skipped
Release / Publish tags (probe) (push) Successful in 16s
Release / Build hub image (arm64) (push) Skipped
Release / Build probe image (arm64) (push) Skipped
Release / Publish tags (hub) (push) Successful in 17s
Release / Gitea release (push) Skipped
The release ran per ref, so main and a tag pushed together both planned
before any image existed and built everything twice; it also re-ran the
whole CI that the pull request had already passed on the same commit, and
the PR CI built the images a third time. Now: one release queue (the tag
waits for main and only re-points tags), the release skips CI when the
pull request already passed for this commit, and the PR CI no longer
builds images (the release builds once per input hash and smoke-tests
before publishing).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:47:18 -03:00
Lucas RayanandClaude Opus 5.5 dc8e390dba fix(ci): pull the probe image before the smoke test in the release
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / Build probe image (amd64) (push) Successful in 21s
CI / Dependency audit (push) Successful in 35s
CI / Docker images (build and smoke test) (push) Skipped
Release / Publish tags (probe) (push) Successful in 13s
Release / Gitea release (push) Successful in 5s
Release / Publish tags (hub) (push) Successful in 19s
Release / ci (push) Successful in 2m17s
Release / Build hub image (amd64) (push) Successful in 21s
Release / Build hub image (arm64) (push) Successful in 23s
Release / Build probe image (arm64) (push) Successful in 25s
CI / Format and vet (push) Successful in 1m8s
CI / Tests (Linux, race detector) (push) Successful in 1m42s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:39:15 -03:00
Lucas RayanandClaude Opus 5.5 0895e43693 fix(probe): dedicated urutau-probe binary for the probe image; CI shellcheck via docker cp
CI / Format and vet (pull_request) Successful in 1m9s
CI / Tests (Linux, race detector) (pull_request) Successful in 2m2s
CI / Docker images (build and smoke test) (pull_request) Successful in 50s
Release / Build probe image (arm64) (push) Failing after 21s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 2m15s
Release / Build hub image (arm64) (push) Successful in 24s
CI / Format and vet (push) Successful in 1m3s
CI / Dependency audit (push) Successful in 29s
Release / Build hub image (amd64) (push) Successful in 21s
Release / Build probe image (amd64) (push) Failing after 20s
Release / Publish tags (probe) (push) Skipped
CI / Dependency audit (pull_request) Successful in 32s
CI / Tests (Linux, race detector) (push) Successful in 1m46s
CI / Docker images (build and smoke test) (push) Skipped
Release / Publish tags (hub) (push) Skipped
Release / Gitea release (push) Skipped
The probe image linked the whole hub (24 MB uncompressed, over the 15 MB
limit). cmd/urutau-probe links only probeagent, tail and wire (6.8 MB);
'urutau probe' still works and shares probeagent.Main. The shellcheck step
bind-mounted the workspace, which the runner's DinD daemon cannot see.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:30:18 -03:00
Lucas RayanandClaude Opus 5.5 8546d14cef feat!: Urutau 2.0.0, ultralight probes and a single analysis hub
CI / Format and vet (pull_request) Failing after 53s
CI / Dependency audit (pull_request) Successful in 33s
CI / Tests (Linux, race detector) (pull_request) Successful in 2m1s
CI / Docker images (build and smoke test) (pull_request) Failing after 47s
Each server runs an ultralight probe (scratch image, ~7 MiB RSS) that
tails the logs, ships raw lines to the hub over HTTPS with an on-disk
spool, and applies enforce decisions locally. The hub keeps one node per
probe (primary node = the 1.x data dir, unchanged), does all analysis and
serves the UI. Peer federation is removed. 'urutau import' brings 1.x
data dirs in with hash and count verification. UI: probes page, host
qualified incidents, IPs never wrap, egress heatmap labels, live and
replay globes no longer auto-rotate, replay repeat, live traffic metrics.

BREAKING CHANGE: URUTAU_PEERS, URUTAU_PEER_* and /api/v1/peer/* are gone;
log path variables move from the hub to the probe. See docs/migration-2.0.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 22:14:50 -03:00
Lucas RayanandClaude Opus 5.5 23a7a5963a feat(wire): probe-hub protocol package for 2.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:49:08 -03:00
Lucas RayanandClaude Opus 5.5 6941106172 docs: bring README, docs, screenshots and changelog up to 1.6.0
Release / ci (push) Skipped
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Successful in 17s
Release / Gitea release (push) Skipped
Release / Plan (reuse the published image?) (push) Successful in 6s
Rewritten README and interface/configuration/CLI/Docker/support/architecture
docs (EN and pt-BR) from the 1.6.0 code; all 80 screenshots regenerated,
incidents pages added; changelog audited against the tags (1.4.0 date,
1.4.6/1.4.7 items, 1.5.0 details, 1.5.8 shipped inside 1.6.0, compare
links); compose and .env.example expose the enforce, egress, probe and
Tor settings.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 21:41:50 -03:00
Lucas RayanandClaude Opus 5.5 22ccde539b chore: merge fix-bloqueio (1.6.0) with mobile tables (1.5.8)
Release / ci (push) Successful in 1m44s
Release / Build image (arm64) (push) Successful in 1m15s
Release / Plan (reuse the published image?) (push) Successful in 6s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 1m9s
CI / Dependency audit (push) Successful in 35s
Release / Publish tags (push) Successful in 14s
Release / Gitea release (push) Successful in 5s
Release / Build image (amd64) (push) Successful in 24s
CI / Tests (Linux, race detector) (push) Successful in 36s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:31:13 -03:00
Lucas RayanandClaude Opus 5.5 bc3ce09088 fix: phones render plain data tables as stacked cards (1.5.8)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:30:18 -03:00
Lucas RayanandClaude Opus 5.5 54b9ae65cd fix: forge browsing, verified crawlers, ban feedback loop, coverage metrics and slow-attacker policy (1.6.0)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 20:26:56 -03:00
Lucas RayanandClaude Opus 5.5 393a31cebe fix: 1.5.7 protocols & TLS page legend, methods panel and mobile layout
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m52s
Release / Build image (arm64) (push) Successful in 1m10s
Release / Publish tags (push) Successful in 17s
CI / Format and vet (push) Successful in 1m14s
CI / Dependency audit (push) Successful in 38s
Release / Gitea release (push) Successful in 4s
Release / Build image (amd64) (push) Successful in 22s
CI / Tests (Linux, race detector) (push) Successful in 1m6s
CI / Docker image (build and smoke test) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 10:44:13 -03:00
Lucas RayanandClaude Opus 5.5 2a14924ed9 fix: 1.5.6 mobile horizontal overflow from sr-only chart table
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m41s
CI / Tests (Linux, race detector) (push) Successful in 48s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 4s
Release / Publish tags (push) Successful in 16s
Release / Build image (amd64) (push) Successful in 23s
Release / Build image (arm64) (push) Successful in 1m14s
CI / Format and vet (push) Successful in 54s
CI / Dependency audit (push) Successful in 39s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 10:36:41 -03:00
Lucas RayanandClaude Opus 5.5 7e1f70bf40 fix: 1.5.5 incidents mobile layout
Release / ci (push) Successful in 1m32s
Release / Publish tags (push) Successful in 18s
CI / Tests (Linux, race detector) (push) Successful in 1m4s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 4s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 1m10s
CI / Format and vet (push) Successful in 56s
CI / Dependency audit (push) Successful in 32s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 10:14:13 -03:00
Lucas RayanandClaude Opus 5.5 a689dd8824 fix: 1.5.4 incidents list two-line rows and compact tabs
Release / Publish tags (push) Successful in 14s
Release / ci (push) Successful in 1m43s
Release / Build image (amd64) (push) Successful in 22s
Release / Build image (arm64) (push) Successful in 1m15s
CI / Format and vet (push) Successful in 1m2s
CI / Dependency audit (push) Successful in 40s
CI / Docker image (build and smoke test) (push) Skipped
Release / Plan (reuse the published image?) (push) Successful in 5s
CI / Tests (Linux, race detector) (push) Successful in 53s
Release / Gitea release (push) Successful in 5s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 10:07:37 -03:00
Lucas RayanandClaude Opus 5.5 804d2c6e8d fix: 1.5.3 incidents copy button and list column widths
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Successful in 1m40s
Release / Build image (amd64) (push) Successful in 25s
Release / Build image (arm64) (push) Successful in 1m18s
CI / Tests (Linux, race detector) (push) Successful in 1m4s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 4s
Release / Publish tags (push) Successful in 13s
CI / Format and vet (push) Successful in 1m1s
CI / Dependency audit (push) Successful in 28s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:57:10 -03:00
Lucas RayanandClaude Opus 5.5 612516db76 feat: 1.5.2 incidents UX redesign
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Successful in 1m34s
Release / Build image (amd64) (push) Successful in 25s
Release / Build image (arm64) (push) Successful in 1m11s
CI / Tests (Linux, race detector) (push) Successful in 53s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 4s
Release / Publish tags (push) Successful in 18s
CI / Format and vet (push) Successful in 1m4s
CI / Dependency audit (push) Successful in 29s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:51:29 -03:00
Lucas RayanandClaude Opus 5.5 3c7caef0c8 fix: 1.5.1 incidents status deep link and creation history wording
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / Build image (arm64) (push) Successful in 1m12s
CI / Format and vet (push) Successful in 48s
CI / Tests (Linux, race detector) (push) Successful in 1m7s
Release / Publish tags (push) Successful in 14s
Release / ci (push) Successful in 1m21s
Release / Build image (amd64) (push) Successful in 24s
CI / Dependency audit (push) Successful in 33s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 5s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:33:56 -03:00
Lucas RayanandClaude Opus 5.5 e5058968e2 feat: 1.5.0 incident management (tickets from egress findings, triage, comments, suppression with expiry)
Release / Publish tags (push) Successful in 14s
Release / ci (push) Successful in 1m14s
Release / Build image (amd64) (push) Successful in 24s
CI / Dependency audit (push) Successful in 33s
Release / Gitea release (push) Successful in 4s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / Build image (arm64) (push) Successful in 1m13s
CI / Format and vet (push) Successful in 41s
CI / Tests (Linux, race detector) (push) Successful in 1m1s
CI / Docker image (build and smoke test) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 09:18:06 -03:00
Lucas RayanandClaude Opus 5.5 3ae72e27d6 fix: 1.4.8 egress false positives (non-SYN replies, IMDS on host, Akamai/Telegram)
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m20s
Release / Build image (amd64) (push) Successful in 24s
Release / Build image (arm64) (push) Successful in 1m11s
Release / Gitea release (push) Skipped
CI / Tests (Linux, race detector) (push) Successful in 50s
CI / Docker image (build and smoke test) (push) Skipped
Release / Publish tags (push) Successful in 13s
CI / Format and vet (push) Successful in 51s
CI / Dependency audit (push) Successful in 29s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 08:51:42 -03:00
Lucas RayanandClaude Opus 5.5 873219416f fix: 1.4.7 default unban log path
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / Publish tags (push) Successful in 19s
CI / Dependency audit (push) Successful in 37s
Release / ci (push) Successful in 1m10s
Release / Build image (arm64) (push) Successful in 1m20s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 5s
CI / Format and vet (push) Successful in 33s
CI / Tests (Linux, race detector) (push) Successful in 37s
Release / Build image (amd64) (push) Successful in 23s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 02:01:31 -03:00
Lucas RayanandClaude Opus 5.5 da333d70f1 feat: 1.4.6 unban from the UI, operator allows, day-counter fallback for long windows
Release / ci (push) Successful in 1m47s
Release / Build image (amd64) (push) Successful in 21s
CI / Format and vet (push) Successful in 27s
CI / Dependency audit (push) Successful in 31s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / Gitea release (push) Successful in 5s
Release / Publish tags (push) Successful in 16s
Release / Build image (arm64) (push) Successful in 23s
CI / Tests (Linux, race detector) (push) Successful in 1m20s
CI / Docker image (build and smoke test) (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 01:53:24 -03:00
Lucas RayanandClaude Opus 5.5 1ef5a0ce9f fix: 1.4.5 second firewall uses history, reputation and a periodic sweep
Release / ci (push) Successful in 1m2s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 1m10s
CI / Docker image (build and smoke test) (push) Skipped
Release / Publish tags (push) Successful in 15s
Release / Plan (reuse the published image?) (push) Successful in 5s
CI / Format and vet (push) Successful in 26s
CI / Tests (Linux, race detector) (push) Successful in 20s
CI / Dependency audit (push) Successful in 35s
Release / Gitea release (push) Successful in 4s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 01:37:25 -03:00
Lucas RayanandClaude Opus 5.5 0dc3268b29 fix: 1.4.4 read Traefik text logs, degraded source alert, mobile menu
Release / Publish tags (push) Successful in 16s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 1m46s
CI / Tests (Linux, race detector) (push) Successful in 1m22s
CI / Dependency audit (push) Successful in 27s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 23s
CI / Format and vet (push) Successful in 24s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 4s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 01:20:03 -03:00
Lucas RayanandClaude Opus 5.5 50cd2bd3ce fix: mobile More menu scrolls when it is taller than the screen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 01:18:10 -03:00
Lucas RayanandClaude Opus 5.5 045ed53e43 feat: 1.4.3 Tor lists and classification, egress provider and peer allowlist
Release / Plan (reuse the published image?) (push) Successful in 6s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 4s
Release / Publish tags (push) Successful in 17s
Release / ci (push) Successful in 59s
Release / Build image (amd64) (push) Successful in 24s
Release / Build image (arm64) (push) Successful in 1m29s
CI / Format and vet (push) Successful in 26s
CI / Tests (Linux, race detector) (push) Successful in 33s
CI / Dependency audit (push) Successful in 33s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 00:57:22 -03:00
Lucas RayanandClaude Opus 5.5 ec46fb94ff feat: 1.4.2 services page redesign
Release / Publish tags (push) Successful in 14s
Release / Build image (arm64) (push) Successful in 1m19s
CI / Format and vet (push) Successful in 37s
CI / Dependency audit (push) Successful in 21s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Successful in 58s
Release / Build image (amd64) (push) Successful in 21s
CI / Tests (Linux, race detector) (push) Successful in 34s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 4s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 00:30:50 -03:00
Lucas RayanandClaude Opus 5.5 432f521ed1 feat: 1.4.1 pagination, network probes, survival by blocker, report polish
Release / ci (push) Successful in 1m47s
CI / Format and vet (push) Successful in 23s
CI / Tests (Linux, race detector) (push) Successful in 1m24s
CI / Docker image (build and smoke test) (push) Skipped
Release / Gitea release (push) Successful in 5s
Release / Publish tags (push) Successful in 18s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / Build image (amd64) (push) Successful in 21s
Release / Build image (arm64) (push) Successful in 28s
CI / Dependency audit (push) Successful in 24s
Backend pagination with one pager for sessions, IPs, campaigns and events;
network probe source (port-scan, T1046, second firewall reason port-scan);
host kit logs inbound probes; urutau call on the report cover.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 00:21:43 -03:00
Lucas RayanandClaude Opus 5.5 f27d8441a9 fix: report preview is always an A4 sheet, scaled to fit
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 00:09:17 -03:00
Lucas RayanandClaude Opus 5.5 b267b98f18 feat: outbound traffic page redesign
Verdict, evidence cards (beacon rhythm and interval histogram), destination
map, workload x hour heatmap, compact workloads, authorised scan timeline.
API: findings[].samples and by_country.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 00:08:15 -03:00
Lucas RayanandClaude Opus 5.5 9bdfdb491b feat: report preview page, sharp report logo, time to ban by blocker
The Reports page now previews the HTML report itself (same document as the
download and the print), with only Download and Print. The report logo is
the repository logo at 800 px. Survival splits fail2ban and the Urutau
second firewall.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 00:06:29 -03:00
Lucas RayanandClaude Opus 5.5 5d3374ee11 docs: screenshots of every page, egress and enforce demo data
Release / Build image (amd64) (push) Skipped
Release / Publish tags (push) Successful in 14s
Release / Plan (reuse the published image?) (push) Successful in 5s
Release / ci (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Gitea release (push) Skipped
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 23:51:34 -03:00
Lucas RayanandClaude Opus 5.5 c33cca22e3 feat: 1.4.0 second firewall, egress analysis and HTML report
CI / Format and vet (push) Successful in 28s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / Gitea release (push) Successful in 3s
CI / Docker image (build and smoke test) (push) Skipped
CI / Dependency audit (push) Successful in 16s
CI / Tests (Linux, race detector) (push) Successful in 1m3s
Release / ci (push) Skipped
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Successful in 13s
Optional second firewall (URUTAU_ENFORCE off/observe/on) through the host
fail2ban, outbound traffic analysis (beaconing, mining, spam, DNS bypass,
unauthorised scans) with authorised scanner workloads, host kit in
deploy/host and a printable HTML report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 23:35:34 -03:00
337 changed files with 30700 additions and 3669 deletions

No files matched your search

+19 -13
View File
@@ -1,4 +1,5 @@
# Variables read by docker-compose.yml. Other URUTAU_* settings need a line in
# Variables read by docker-compose.yml (the hub). A probe has its own file:
# deploy/probe/.env.example. Other URUTAU_* settings need a line in
# the compose `environment` block (see docs/configuration.md).
# Image tag: latest (last release), X.Y.Z / X.Y (pinned), or edge (main).
@@ -14,23 +15,13 @@ URUTAU_PUBLISH=127.0.0.1:8790
URUTAU_TOKEN=
# Name of this instance in the dashboard.
URUTAU_NAME=urutau
# Token shared between a hub and its peers (same rules as URUTAU_TOKEN, and
# different from it). It only opens /api/v1/peer/export. Empty: no export (a
# hub with peers needs a token for each: this one, or URUTAU_PEER_TOKEN_<NAME>
# added to the compose environment).
URUTAU_PEER_TOKEN=
# Source CIDRs allowed to call the export (e.g. the hub's address). Empty: any
# source that has the token.
URUTAU_PEER_ALLOW=
# Reverse proxies whose X-Forwarded-For is trusted (login rate limit, peer allow).
# Reverse proxies whose X-Forwarded-For is trusted (login rate limit, probe auth limiter).
# The compose file puts the service on the urutau-edge network (10.250.0.0/24)
# and trusts only that; connect the proxy to it (see docs/docker.md).
URUTAU_TRUSTED_PROXY=10.250.0.0/24
# SSH users whose successful logins keep their IP out of the blocklist for 24 h
# (comma separated). Empty: no admin immunity.
URUTAU_ADMIN_USERS=
# Peers this instance aggregates (hub mode), comma separated name=https://url.
URUTAU_PEERS=
# Your own servers and monitors: their events are dropped entirely
# (comma separated CIDRs or IPs). Private, link-local and CGNAT ranges are
# already dropped (see --ignore).
@@ -45,7 +36,8 @@ URUTAU_DOMAINS=
# CIDRs the monitoring User-Agents come from. When set, the monitor User-Agent
# only counts from them. Empty: only `ok` answers are filtered.
URUTAU_MONITOR_FROM=
# Time zone of the host: fail2ban.log timestamps are local time.
# Time zone of the probes: fail2ban.log timestamps are local time and the hub
# parses them, so it must be the same on the hub and on every probe.
TZ=UTC
# Event registry size cap in <data-dir>/events (0 turns it off). Not passed by the
# compose file as is: add it to the `environment` block to change the 512MB default.
@@ -54,3 +46,17 @@ URUTAU_EVENTS_MAX=512MB
URUTAU_RETENTION=720h
# File with Tor exit addresses (one per line); same note as above.
URUTAU_TOR_EXITS=
# Tor exit/relay lists
URUTAU_TOR_AUTO=on
# Second firewall: off | observe | on (needs deploy/host/install.sh --probe --enforce
# on each probe host; the decisions travel through the probes)
URUTAU_ENFORCE=off
URUTAU_ENFORCE_SHARE=off
URUTAU_ENFORCE_THRESHOLD=5
# Outbound traffic analysis (egress log sent by the probes): auto | on | off
URUTAU_EGRESS=auto
URUTAU_EGRESS_WORKLOADS=
URUTAU_EGRESS_RESOLVERS=
+15 -15
View File
@@ -39,8 +39,19 @@ jobs:
for f in glob.glob('.gitea/**/*.yml', recursive=True):
yaml.safe_load(open(f))
"
- name: Docker compose config
run: docker compose config --quiet
- name: Docker compose config (hub and probe)
run: |
docker compose config --quiet
URUTAU_HUB=https://hub.example.org URUTAU_PROBE_NAME=ci docker compose -f deploy/probe/docker-compose.yml config --quiet
- name: shellcheck (host kit)
# The job workspace is not visible to the runner's Docker daemon (DinD):
# copy the file into the container instead of bind mounting it.
run: |
cid=$(docker create -w /mnt koalaman/shellcheck:v0.10.0 install.sh)
docker cp deploy/host/install.sh "$cid:/mnt/install.sh"
docker start -a "$cid"; status=$?
docker rm "$cid" >/dev/null
exit "$status"
- name: gofmt
run: test -z "$(gofmt -l .)"
- run: go vet ./...
@@ -69,16 +80,5 @@ jobs:
export PATH="$PATH:$(go env GOPATH)/bin"
govulncheck ./...
image:
name: Docker image (build and smoke test)
if: ${{ gitea.event_name == 'pull_request' }}
runs-on: linux-arm64
steps:
- uses: actions/checkout@v7
- name: Build
run: docker build -t "urutau-ci:${{ gitea.run_id }}" .
- name: Smoke test
run: scripts/smoke-image.sh "urutau-ci:${{ gitea.run_id }}"
- name: Clean up
if: always()
run: docker rmi -f "urutau-ci:${{ gitea.run_id }}" >/dev/null 2>&1 || true
# No image build here: the release builds each image once per input hash,
# natively per architecture, and smoke-tests it before publishing any tag.
+72 -31
View File
@@ -1,9 +1,10 @@
name: Release
# Publishes the multi-arch Urutau image (linux/amd64 + linux/arm64) to the Gitea
# container registry. A merge into main publishes `edge`; a v* tag re-points the
# image already built for the same inputs to X.Y.Z, X.Y and latest (no rebuild)
# and creates the Gitea Release. Needs the secret REGISTRY_TOKEN (Gitea token
# Publishes the two multi-arch Urutau images (linux/amd64 + linux/arm64) to the
# Gitea container registry: the hub (<repo>) and the probe (<repo>-probe), both
# built from the same Dockerfile. A merge into main publishes `edge`; a v* tag
# re-points the images already built for the same inputs to X.Y.Z, X.Y and
# latest (no rebuild) and creates the Gitea Release. Needs the secret REGISTRY_TOKEN (Gitea token
# with write:package) visible to this repository.
on:
push:
@@ -11,16 +12,19 @@ on:
tags: ['v*']
workflow_dispatch:
# One queue for main and tags: a tag pushed together with main waits for the
# main run, then finds the images already published and only re-points tags.
# (A per-ref group let both runs plan at once, see nothing, and build twice.)
concurrency:
group: release-${{ gitea.ref }}
group: release
cancel-in-progress: false
env:
REGISTRY: git.lucasrguerra.dev.br
jobs:
# The image is built only from these paths, so their tree hashes identify it.
# When inputs-<hash> already exists (docs-only merge, workflow change, or a tag
# The images are built only from these paths, so their tree hashes identify
# them. When inputs-<hash> already exists for BOTH images (docs-only merge, workflow change, or a tag
# on a commit main already published), nothing is built or tested again.
plan:
name: Plan (reuse the published image?)
@@ -28,7 +32,9 @@ jobs:
outputs:
inputs: ${{ steps.plan.outputs.inputs }}
reuse: ${{ steps.plan.outputs.reuse }}
tested: ${{ steps.tested.outputs.tested }}
image: ${{ steps.plan.outputs.image }}
probe_image: ${{ steps.plan.outputs.probe_image }}
steps:
- uses: actions/checkout@v7
- id: plan
@@ -40,35 +46,59 @@ jobs:
git cat-file -e HEAD:go.sum 2>/dev/null && paths="$paths go.sum"
inputs=$(for p in $paths; do git rev-parse "HEAD:$p"; done | sha256sum | cut -c1-16)
ns="${REPO,,}"
token=$(curl -fsS "https://$REGISTRY/v2/token?service=container_registry&scope=repository:$ns:pull" | jq -r .token)
code=$(curl -s -o /dev/null -w '%{http_code}' -I \
-H "Authorization: Bearer $token" \
-H 'Accept: application/vnd.oci.image.index.v1+json,application/vnd.docker.distribution.manifest.list.v2+json' \
"https://$REGISTRY/v2/$ns/manifests/inputs-$inputs")
echo "inputs-$inputs -> HTTP $code"
reuse=false; [ "$code" = 200 ] && reuse=true
reuse=true
for repo in "$ns" "$ns-probe"; do
token=$(curl -fsS "https://$REGISTRY/v2/token?service=container_registry&scope=repository:$repo:pull" | jq -r .token)
code=$(curl -s -o /dev/null -w '%{http_code}' -I \
-H "Authorization: Bearer $token" \
-H 'Accept: application/vnd.oci.image.index.v1+json,application/vnd.docker.distribution.manifest.list.v2+json' \
"https://$REGISTRY/v2/$repo/manifests/inputs-$inputs")
echo "$repo inputs-$inputs -> HTTP $code"
[ "$code" = 200 ] || reuse=false
done
echo "inputs=$inputs" >> "$GITHUB_OUTPUT"
echo "reuse=$reuse" >> "$GITHUB_OUTPUT"
echo "image=$REGISTRY/$ns" >> "$GITHUB_OUTPUT"
echo "probe_image=$REGISTRY/$ns-probe" >> "$GITHUB_OUTPUT"
# The pull request already ran the whole CI on this exact commit (the
# merge is a fast-forward): do not run the same tests again here.
- id: tested
env:
REPO: ${{ gitea.repository }}
SHA: ${{ gitea.sha }}
# The job token reads this repository's runs; on any error the answer
# is false and the CI simply runs (never skips tests by mistake).
TOKEN: ${{ gitea.token }}
run: |
tested=$(curl -fsS -H "Authorization: token $TOKEN" "https://$REGISTRY/api/v1/repos/$REPO/actions/runs?limit=50" \
| jq -r --arg sha "$SHA" '[.workflow_runs[] | select(.head_sha == $sha and (.path | startswith("ci.yml")) and .conclusion == "success")] | length > 0' 2>/dev/null) || tested=false
[ "$tested" = true ] || tested=false
echo "CI already passed for $SHA: $tested"
echo "tested=$tested" >> "$GITHUB_OUTPUT"
ci:
needs: plan
if: ${{ needs.plan.outputs.reuse != 'true' }}
if: ${{ needs.plan.outputs.reuse != 'true' && needs.plan.outputs.tested != 'true' }}
uses: ./.gitea/workflows/ci.yml
# Each architecture is built on a native runner (no QEMU) and pushed under a
# per-architecture tag; publish joins them into one manifest list.
# Each architecture of each image is built on a native runner (no QEMU) and
# pushed under a per-architecture tag; publish joins them into one manifest list.
build:
name: Build image (${{ matrix.arch }})
name: Build ${{ matrix.target }} image (${{ matrix.arch }})
needs: [plan, ci]
if: ${{ needs.plan.outputs.reuse != 'true' }}
# ci is skipped (not failed) when the pull request already tested this commit.
# A skipped reusable-workflow job does not report result == 'skipped' on
# Gitea, so test for "did not fail and was not cancelled" instead.
if: ${{ !cancelled() && needs.plan.result == 'success' && needs.plan.outputs.reuse != 'true' && needs.ci.result != 'failure' && needs.ci.result != 'cancelled' }}
runs-on: ${{ matrix.runner }}
strategy:
fail-fast: false
matrix:
include:
- { arch: amd64, platform: linux/amd64, runner: linux-amd64 }
- { arch: arm64, platform: linux/arm64, runner: linux-arm64 }
- { target: hub, arch: amd64, platform: linux/amd64, runner: linux-amd64 }
- { target: hub, arch: arm64, platform: linux/arm64, runner: linux-arm64 }
- { target: probe, arch: amd64, platform: linux/amd64, runner: linux-amd64 }
- { target: probe, arch: arm64, platform: linux/arm64, runner: linux-arm64 }
steps:
- uses: actions/checkout@v7
- uses: docker/setup-buildx-action@v4
@@ -82,23 +112,33 @@ jobs:
# Same end result, no action to clone.
- name: Build and push (per architecture)
run: |
image='${{ matrix.target == 'probe' && needs.plan.outputs.probe_image || needs.plan.outputs.image }}'
docker buildx build \
--target "${{ matrix.target }}" \
--platform "${{ matrix.platform }}" \
--push \
-t "${{ needs.plan.outputs.image }}:build-${{ gitea.sha }}-${{ matrix.arch }}" \
--cache-from "type=registry,ref=${{ needs.plan.outputs.image }}:buildcache-${{ matrix.arch }}" \
--cache-to "type=registry,ref=${{ needs.plan.outputs.image }}:buildcache-${{ matrix.arch }},mode=max" \
-t "$image:build-${{ gitea.sha }}-${{ matrix.arch }}" \
--cache-from "type=registry,ref=$image:buildcache-${{ matrix.arch }}" \
--cache-to "type=registry,ref=$image:buildcache-${{ matrix.arch }},mode=max" \
.
# Runs the image that was just pushed, on its own architecture.
- name: Smoke test
run: scripts/smoke-image.sh "${{ needs.plan.outputs.image }}:build-${{ gitea.sha }}-${{ matrix.arch }}"
run: |
image='${{ matrix.target == 'probe' && needs.plan.outputs.probe_image || needs.plan.outputs.image }}'
scripts/smoke-${{ matrix.target == 'probe' && 'probe' || 'image' }}.sh "$image:build-${{ gitea.sha }}-${{ matrix.arch }}"
publish:
name: Publish tags
name: Publish tags (${{ matrix.target }})
needs: [plan, build]
# build is skipped, not successful, when the image is reused.
if: ${{ !cancelled() && needs.plan.result == 'success' && (needs.build.result == 'success' || needs.plan.outputs.reuse == 'true') }}
runs-on: linux-arm64
strategy:
fail-fast: false
matrix:
target: [hub, probe]
env:
IMAGE: ${{ matrix.target == 'probe' && needs.plan.outputs.probe_image || needs.plan.outputs.image }}
steps:
- uses: docker/setup-buildx-action@v4
- uses: docker/login-action@v4
@@ -110,7 +150,7 @@ jobs:
id: meta
uses: docker/metadata-action@v6
with:
images: ${{ needs.plan.outputs.image }}
images: ${{ env.IMAGE }}
flavor: latest=false
tags: |
type=semver,pattern={{version}}
@@ -120,7 +160,7 @@ jobs:
type=sha,format=long
- name: Apply tags
run: |
image='${{ needs.plan.outputs.image }}'
image="$IMAGE"
tags=$(jq -cr '.tags | map("-t " + .) | join(" ")' <<< '${{ steps.meta.outputs.json }}')
inputs='${{ needs.plan.outputs.inputs }}'
if [ '${{ needs.plan.outputs.reuse }}' = true ]; then
@@ -131,14 +171,14 @@ jobs:
fi
- name: Check architectures
run: |
docker buildx imagetools inspect "${{ needs.plan.outputs.image }}:inputs-${{ needs.plan.outputs.inputs }}" \
docker buildx imagetools inspect "$IMAGE:inputs-${{ needs.plan.outputs.inputs }}" \
--format '{{json .Manifest}}' \
| jq -r '.manifests[] | select(.platform.os == "linux") | "\(.platform.os)/\(.platform.architecture)"' \
| tee platforms.txt
grep -qx linux/amd64 platforms.txt && grep -qx linux/arm64 platforms.txt
- name: Summary
run: |
{ echo "### Urutau image published (linux/amd64, linux/arm64)"; echo; echo '```'
{ echo "### Urutau ${{ matrix.target }} image published (linux/amd64, linux/arm64)"; echo; echo '```'
echo "${{ steps.meta.outputs.tags }}"; echo '```'; } >> "$GITHUB_STEP_SUMMARY"
gitea-release:
@@ -156,11 +196,12 @@ jobs:
TOKEN: ${{ gitea.token }}
API: ${{ gitea.server_url }}/api/v1/repos/${{ gitea.repository }}
IMAGE: ${{ needs.plan.outputs.image }}
PROBE_IMAGE: ${{ needs.plan.outputs.probe_image }}
run: |
if curl -fsS -H "Authorization: token $TOKEN" "$API/releases/tags/$TAG" >/dev/null 2>&1; then
echo "release $TAG already exists"; exit 0
fi
{ scripts/release-notes.sh "$TAG"; echo; echo '```bash'; echo "docker pull $IMAGE:${TAG#v}"; echo '```'; } > notes.md
{ scripts/release-notes.sh "$TAG"; echo; echo '```bash'; echo "docker pull $IMAGE:${TAG#v}"; echo "docker pull $PROBE_IMAGE:${TAG#v}"; echo '```'; } > notes.md
pre=false; case "$TAG" in *-*) pre=true ;; esac
jq -n --arg tag "$TAG" --arg name "Urutau ${TAG#v}" --rawfile body notes.md --argjson pre "$pre" \
'{tag_name:$tag, name:$name, body:$body, prerelease:$pre}' > release.json
+1
View File
@@ -25,3 +25,4 @@ __pycache__/
# Runtime pid files left by local test scripts
*.pid
pid
+292 -3
View File
@@ -6,12 +6,263 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio
## [Unreleased]
## [1.1.1] - 2026-11-14
## [2.3.1] - 2026-11-23
### Changed
- Replay plays threats only by default. 96% of the events the page downloaded were `ok` (legitimate traffic, such as crawlers browsing a Git forge), so a 2000-event page covered about 44 minutes and 24 h took about 21 pages. The events API accepts a negated category list (`cat=!ok`, a leading `!` excludes), the Replay category filter has "Threats (default)" and "All, including legitimate traffic" (`cat=all` in the link), and the timeline strip and lead sentence count the same filter.
### Fixed
- Live page, globe mode: sea and land colors no longer swap while the globe turns. Each country ring is now clipped at the horizon and closed along the edge of the globe, and long edges follow the map projection.
- World map data: countries crossing the 180th meridian (Russia, Fiji) are closed along the map edge, so the Sea of Okhotsk is no longer filled as land on the flat maps.
- Opening Replay no longer downloads the same first events page twice (the page was rebuilt when the period study arrived; loaded events are now annotated in place, and a campaign link or "Only incidents" still rebuild) and no longer requests the summary twice (it reuses the shell's request).
## [2.3.0] - 2026-11-23
### Added
- Firewall telemetry (inbound attempts): the application logs cannot see connection attempts to ports where nothing listens, nor packets from addresses that are already banned (the firewall drops them silently), so the panel understated the real scale and SSH attacks seemed to fall only because bans work. New host kit option `install.sh --ingress` adds an observation-only nftables table (`inet urutau_ingress`, prerouting priority -150, before Docker's DNAT; counters and a rate-limited log, it never drops, accepts, marks or rewrites anything) and a timer that writes exact counters to `/var/log/urutau/ingress.counters`, plus a sample of the attempts in `/var/log/urutau/ingress.log`. The probe tails both (`URUTAU_INGRESS_LOG`, `URUTAU_INGRESS_COUNTERS`), the hub aggregates per host in hourly buckets for 30 days, and Defense gets a "Firewall: inbound attempts" section: exact totals and attempts per hour, share to closed ports, share from currently banned sources (estimated from the sample), and top ports, networks and countries labelled as sampled. New endpoint `GET /api/v1/ingress`; `urutau doctor` reports whether the source is present and fresh. The attempts are telemetry only: they never become events or evidence, so there is no ban feedback loop. To upgrade: update the hub and the probes, then on each host run `sudo sh deploy/host/install.sh --ingress` (add `--probe` and `--enforce` as that host already uses). The sources show as `waiting` until then. A cloud provider firewall (for example an Oracle Cloud security list) blocks some ports before the host, so the metric is what reaches the host.
### Changed
- Own and trusted traffic is recorded instead of dropped. Web requests from `URUTAU_TRUSTED` (class `trusted`) and from the `URUTAU_IGNORE` ranges, private networks by default (class `internal`), used to vanish at ingestion, which hid about half of the real requests on a busy host (the other server, a CI runner, the Docker gateway). They are now counted in aggregates only (no event record each, kept in the snapshot) and never score an IP or enter threats, campaigns, sessions, maps, the blocklist, ban evidence, egress logic or visitor analytics. API: `totals.trusted`, `totals.internal`, `totals.requests_all` (`requests` plus both classes), `totals.counts.trusted` and `.internal`, and `own` in `/api/v1/summary` (status classes, timeline `series`, `origins`, `domains`, `paths`). The Traffic page has a new section "Own infrastructure and trusted origins". Probes need no change: the hub classifies. Tests `TestOwnTrafficIsCountedNeverAnalysed` and `TestOwnTrafficThroughFeed`.
### Fixed
- Long-range studies (15 and 30 days) no longer time out: with about 25,000 events a day over 30 days, period, report, campaigns, funnel and metrics took 6 to 19 s and came back `truncated` with partial families, techniques and campaigns. Closed days of the event registry are now decoded once and kept in memory (96 MB cap, invalidated by file size and modification time), the live day is read from the file, sessions are built in parallel and shared by period, funnel and metrics, and path normalisation is memoised. On the synthetic 30-day set (750,000 events, 2 hosts) all three views together went from 7.5 s cold and 5.1 s warm (about 16 s with a 256 MiB memory limit, truncated) to 3.7 s cold and 1.5 s warm under GOMEMLIMIT 256MiB, not truncated, about 200 MB heap. The dashboard shows a note when a study really hits a limit. Top targets with equal counts are now ordered by host too, so results are deterministic. Tests `TestDayCacheEqualsFullScan`, `TestDayCacheInvalidatesOnChange` and `BenchmarkStudy30d`.
## [2.2.2] - 2026-11-19
### Fixed
- Outbound traffic: a redeploy that swapped addresses between containers (LambdaMail's rspamd and clamav traded 172.19.0.2 and .5) was judged with the previous minute's `containers.map`, so findings landed on the wrong workload (rspamd's SURBL and DNS traffic as `clamav`, freshclam as `dns`). The host kit now also runs `urutau-containers-watch`, which rewrites the map on every container start or network attach, and the probe checks the file every 2 seconds instead of 10. Reinstall the host kit (`deploy/host/install.sh`) and update the probes.
- Outbound traffic: `new_geo` no longer fires for large CDNs and clouds (Cloudflare, Google, AWS, Azure, Akamai, Fastly, Telegram): their addresses are anycast or global, and the database country (1.1.1.1 in Australia, a Cloudflare edge in Canada) says nothing about where the traffic goes. Test `TestNewGeoSkipsAnycastCDN`.
## [2.2.1] - 2026-11-16
### Fixed
- Traffic on probe-fed hosts kept disappearing after Traefik's copytruncate rotation even with 2.2.0: the head fingerprint covered only 64 bytes, and Traefik's first line of every generation starts with the same keep-alive client address and port, so every generation looked like the same file and the hub dropped every line below the previous high-water mark. The fingerprint now covers up to 1024 bytes (the whole first line, with its nanosecond timestamp), and the hub treats fingerprints of different lengths as different generations. Update the probes too. Tests `TestHeadCoversFirstLine` and `TestSameHeadCopytruncate`.
## [2.2.0] - 2026-11-16
### Added
- IP analysis: an address that never attacked but is an egress destination (for example the IP of an egress incident) now opens a "Destination" view: which hosts and workloads connected to it, ports, connections, ASN/country, findings and linked incidents. New endpoint `GET /api/v1/ip/{ip}/egress`. When nothing exists the page says definitively that the IP was never seen; if it was seen inbound outside the period it shows the last date and a 30-day button.
- Global host filter: several probes can be selected at once (`host=oracle,hostinger` in the URL and the API); selecting all of them, or "All hosts", means every probe.
### Fixed
- Traffic: the hub dropped Traefik lines after every copytruncate rotation of `access.log` (it compared only inode and offset and ignored the head fingerprint the probe sends), so legitimate traffic on the Oracle host vanished for hours after each rotation. Regression test `TestSameHeadCopytruncate`.
- Global host filter: going back to "All hosts" did nothing, because the URL without `host=` kept the previous host.
## [2.1.2] - 2026-11-16
### Fixed
- Egress, false `dns_bypass` right after a hub restart: the files a probe sends (`resolv.conf`, `containers.map`) lived only in the hub's memory, so after a restart the egress lines the probe replayed on reconnect were judged before the probe sent them again (Hostinger `coolify-sentinel` → its upstream resolver 153.92.2.6, hostinger/INC-8). The hub now keeps the last copy of each file in the node's data directory (`probe-resolv.conf`, `probe-containers.map`) and loads it at start. Regression test `TestProbeFilesSurviveRestart`.
- Phone layout: the global filter sheet (period and host) opens above the bottom tab bar instead of covering it, tapping the tab bar closes it, and the sticky filter bar no longer sits on top of the "More" menu.
## [2.1.1] - 2026-11-16
### Fixed
- Incidents: the status tabs (Active, All, Open, False positive and so on) no longer show a tiny vertical scrollbar; the active tab's underline no longer overflows the scroll area by one pixel, and the focus ring is drawn inside the tab so it is not clipped.
## [2.1.0] - 2026-11-16
### Fixed
- Egress, false `dns_bypass` on probes: the hub judged the egress lines of a batch before applying the `resolv.conf` (and `containers.map`) sent in the same batch, and rebuilding a probe's egress engine (a configuration change) dropped those files. The hub now keeps the last files of each probe, applies them before the lines and to every rebuilt engine; the probe queues them before it starts reading logs. Regression test `TestEgressFilesAppliedBeforeLines`.
- Replay: the Repeat control is a regular toggle in the transport bar, styled and behaving like Compress, Only incidents and Select.
- IP analysis: long domains wrap at their dots instead of mid-label.
### Changed
- Incidents page redesigned: severity in words, host-qualified IDs that no longer overlap the title, occurrences and comment counts in the list, phone cards, a clear detail header, a timeline for activity, and a dedicated suppression block that shows the end date, lets you pick 7, 30 or 90 days, and explains why it is disabled (non-egress, high/critical, or status).
- Global filter bar redesigned: one period control (relative presets and an exact window with date pickers, validated against the 30-day retention), visible time zone, previous/next window, a host picker with probe status, a live/fixed indicator, Clear filters and Copy link, sticky and compact while scrolling, bottom sheets on phones, full keyboard and screen reader support. Its classes no longer collide with the replay page.
- IP analysis page rebuilt: identity header, a four-answer summary (what, when, against what, blocked?), a sticky section bar, per-host defense status with unban, ban history table, raw events in their own section with a category filter, and no truncated text at any width.
## [2.0.0] - 2026-11-15
Breaking release: read [docs/migration-2.0.md](docs/migration-2.0.md) before upgrading.
### Added
- Ultra-light probe: `urutau probe` with its own image (`urutau-probe`, `FROM scratch`, under 15 MB, about 20 MB of memory, no open port). It follows the Traefik, sshd, fail2ban, port-probe and egress logs of its server and sends them to the hub.
- Ingestion over plain HTTPS (`/api/v1/probe/hello`, `push`, `commands`) with a disk spool, gzip, idempotent batches and offset-based deduplication, so a hub outage or a restart loses and duplicates nothing. When the spool is full the oldest batches are dropped and the loss is counted and shown.
- Probe management: `urutau probes create|list|revoke`, `GET/POST/PUT/DELETE /api/v1/probes` and the Sources page. The token (`urp_...`) is shown once and the hub stores only its SHA-256.
- Location and egress settings (workloads, resolvers, allowed destinations) configured per probe on the hub.
- `urutau import` brings a 1.x data directory into the hub as a probe (copy, SHA-256 and count verification, idempotent, `--dry-run`, `--verify`, `--count`), with no loss.
- Incidents qualified by host (`host/INC-n`); a bare `INC-n` means the primary probe.
- Two images from one Dockerfile (targets `hub` and `probe`), both multi-arch, built and published together; `deploy/probe/docker-compose.yml` and `deploy/host/install.sh --probe`.
### Changed
- The hub no longer reads local files: the server of the hub runs a probe like any other. The primary probe (the one named like `URUTAU_NAME`) keeps its data in the data-dir root, unchanged from 1.x.
- Second firewall: the hub queues ban and unban commands for each probe, which validates them (`wire.ValidCmdLine`) and appends them to `decisions.log` and `unban.log`; the fail2ban jail is unchanged.
- Sources shows the state of every probe and of each of its sources.
- The hub image no longer sets the log path variables.
- Docs, README and screenshots updated to 2.0.0.
### Removed
- **Breaking:** the peer federation: `URUTAU_PEERS`, `URUTAU_PEER_TOKEN*`, `URUTAU_PEER_ALLOW`, `URUTAU_PEER_BLOCKLIST` and every `/api/v1/peer/*` route (now 404). The hub refuses to start when one of these variables is set.
- **Breaking:** the log path variables of the hub (`URUTAU_TRAEFIK_LOG`, `URUTAU_AUTH_LOG`, `URUTAU_FAIL2BAN_LOG`, `URUTAU_PROBE_LOG`, `URUTAU_EGRESS_LOG`, `URUTAU_EGRESS_CONTAINERS`, `URUTAU_ENFORCE_LOG`, `URUTAU_ENFORCE_UNBAN_LOG`) now belong to the probe. The old image defaults only produce a warning. See [docs/migration-2.0.md](docs/migration-2.0.md).
## [1.6.0] - 2026-11-15
### Fixed
- Code forge browsing is no longer an attack: crawlers (a Alibaba range and Googlebot) reading `/owner/repo/src/commit/<sha>/.gitignore`, `/raw/commit/...`, `/blame/...`, `/commits/...`, `.env.example` and similar repository files on a public Gitea (also GitHub and GitLab style `blob`/`tree`/`raw` paths) were classified as scanner, env-probe and vcs-probe, about 58% of the "attackers". Real probes (`/.env`, `/.git/config`, `/app/.env`, traversal) are unchanged.
- The second firewall excluded crawlers only when the User-Agent claimed to be one, so a verified Googlebot ("GoogleOther") got banned. A forward-confirmed reverse DNS (googlebot.com, google.com, search.msn.com, applebot.apple.com) now excludes the address whatever the User-Agent says; more crawler User-Agents (GoogleOther, Google-InspectionTool, AdsBot, Apple) are recognized.
- Feedback loop: bans of the `urutau` jail (our own decisions) and of `recidive` (which only repeats bans) no longer count as evidence: no score, no strong signal, no blocklist listing. Bans of independent jails (sshd, traefik...) still count.
- The blocklist coverage was misleading (3%): it counted only listed attackers.
### Changed
- Coverage (`blocklist.coverage_pct`, `blocklist_coverage`) now counts an attacker as protected when it is listed or banned by any jail. New fields, additive: `blocklist.attackers`, `covered`, `one_shot`, `repeat_ips`, `repeat_covered`, `repeat_coverage_pct` in `/api/v1/defense`, and `one_shot`, `repeat_ips`, `repeat_unblocked` in the enforce `coverage`.
- Enforce policy for slow attackers: `ssh-probe` events count half a failure in the SSH rules; a 7-day window bans at 10 SSH failures (probes count half) or 10 web scan/exploit events without a legitimate visit (bounded memory); new reason `neighbor-campaign`: when 3 or more distinct addresses of a /24 (IPv4) or /64 (IPv6) were banned in the last 24 h, one attack event of another address of the prefix is enough. All exclusions (trusted, private, crawler, infrastructure, legitimate visitor, operator) still apply, and peers accept the new reason.
## [1.5.8] - 2026-11-15
Not published on its own: there is no `v1.5.8` tag. This change (commit `bc3ce09`) was merged into the same release as 1.6.0 and shipped with it.
### Fixed
- Phones: plain data tables (Concentration ranking, Errors routes, MITRE techniques, Defense, Integrity sources, and any other table without its own phone layout) rendered as squeezed columns with IPs broken letter by letter or sideways scrolling. Under 768 px their rows now become stacked cards with the column name as label, right-aligned numbers and long text wrapping; desktop is unchanged. One shared rule in `style.css` plus `cardTables()` in `app.js` covers all of them. `TABLES_ONLY=1 scripts/screenshots.sh` captures every table page at 375x812 and checks for horizontal overflow.
## [1.5.7] - 2026-11-15
### Fixed
- Protocols & TLS: the class legend under the stacked bars had no styles (words glued together, no color swatches, overflowing on phones); the Methods panel no longer reserves a fixed 280 px height with empty space; cipher suite names break at underscores instead of mid-word; on phones the per-class breakdown of each method moves under the method name; an invalid CSS selector disabled the page's mobile one-column rule.
## [1.5.6] - 2026-11-15
### Fixed
- Phones: the hidden accessible data table of the charts (`table.sr-only`, ~1300 px wide because tables ignore `width: 1px`) widened the mobile layout viewport on the egress page, dragging the fixed bottom menu sideways. The table is now fixed-layout at 1 px, and `html`/`body` use `overflow-x: clip` so nothing can widen the page again.
## [1.5.5] - 2026-11-15
### Fixed
- Incidents on phones: quick actions wrap instead of being cut, filters share the row evenly, and the workload line is no longer indented.
## [1.5.4] - 2026-11-15
### Fixed
- Incidents list: egress tickets show the pattern on the first line and the workload below, instead of a long auto title cut in the middle; the status tabs are compact and fit in one line at 1280 px.
## [1.5.3] - 2026-11-15
### Fixed
- Incidents: the Copy button of the fingerprint no longer wraps letter by letter; the list shows one tag per row and a wider host/destination column, so titles and IPs stop being cut.
## [1.5.2] - 2026-11-15
### Changed
- Incidents redesigned after a UX review: ticket page with a sticky header and quick actions, a main column (summary + unified activity timeline of comments and changes) and a sidebar with inline-saved properties and compact technical data; the list is a dense table with one-line underlined tabs, and the empty state offers "See all". No more empty gaps between panels.
## [1.5.1] - 2026-11-15
### Fixed
- Incidents: the list accepts `?status=` in the link (alias of `?s=`), so `#/incidents?status=benign` opens filtered.
- Incidents: the ticket creation entry in the history reads "urutau opened the ticket (severity: …)" instead of "changed created".
## [1.5.0] - 2026-11-15
### Added
- Incident management: every egress finding (severity above info) becomes a ticket `INC-<n>` keyed by `host|kind|workload|dst|dport|proto`, created by a sync on each merged egress report and every 60 s. Tickets have status (`open`, `investigating`, `true_positive`, `false_positive`, `benign`, `resolved`), severity, assignee, tags, verdict, comments and a change history; a resolved ticket reopens when the finding reappears. Stored in `<data-dir>/incidents.json` (atomic write, 0600; a corrupt file is moved to `.corrupt`); limits of 5000 tickets, 200 comments and 500 history entries each. Every write is also logged (id, field, author).
- A ticket in `false_positive` or `benign` can suppress the findings with exactly its key: they leave `/api/v1/egress` (and the egress report) unless `?suppressed=1`. Findings now carry `ticket_id`, `ticket_status` and `suppressed`, and the response has `suppressed_count`.
- API: `GET /api/v1/incidents`, `GET /api/v1/incidents/{id}`, `POST /api/v1/incidents`, `PATCH /api/v1/incidents/{id}`, `POST /api/v1/incidents/{id}/comments` and `GET /api/v1/incidents/export.csv` (not open to the peer token; writes refuse cross-site requests).
- Suppression expires: a ticket suppresses its findings for 30 days by default (90 at most), and a host with more than 300 active tickets has the excess grouped in one flood ticket.
## [1.4.8] - 2026-11-15
### Fixed
- Egress analysis, false positives: the nftables kit now logs only TCP connection attempts (SYN without ACK), so replies of banned clients (conntrack recreated mid-flow) no longer show up as `bad_dst` "attacked us". **Re-run `deploy/host/install.sh --enforce` on the host to apply the new nft rules.**
- Hosts with the old kit: the parser drops TCP lines without a pure SYN and counts them as `non_syn_dropped` in the egress source (not as `malformed`).
- Cloud metadata services (169.254.169.254, `fd00:c1::a9fe:a9fe`, `fd00:ec2::254`, link-local) polled by the host itself are `infra` (info), not beacon; a container reaching them stays a finding (SSRF/credential theft).
- Regular connections to Akamai (AS20940/AS16625 and its main ranges) and Telegram (AS62041, 149.154.160.0/20, 91.108.0.0/16) are `low` ("large CDN/cloud network"). Hetzner (e.g. SURBL updates) stays `medium`: there is no name correlation, and no IP is hardcoded.
## [1.4.7] - 2026-11-15
### Fixed
- The unban file now defaults to `unban.log` next to `--enforce-log` (the default was lost, so the Unban button reported the file as not writable).
## [1.4.6] - 2026-11-15
### Added
- Unban from the interface: an "Unban" button on recent decisions and on the address page asks the host (through `unban.log` next to `--enforce-log`, flag `--enforce-unban-log`) to lift the fail2ban block, and can keep the second firewall from banning the address again for 1 h, 24 h or 7 days (operator releases, listed and endable in Defense; shared with peers when sharing is on). API: `POST /api/v1/enforce/unban`, `DELETE /api/v1/enforce/allow`, `allows` in `GET /api/v1/enforce`.
### Fixed
- Second firewall: the 24 h rules also count from the persistent day counters, so they work when the event registry does not cover the whole day (after a reset or upgrade).
## [1.4.5] - 2026-11-15
### Fixed
- Second firewall: it now uses the history. An address whose verdict is hostile (or suspicious with score 100 or more) is banned on its first new malicious event (`known-attacker`); 10 SSH failures or 20 web scan/exploit events in 24 h also ban (slow attackers); a sweep every 10 minutes (and after the start-up backfill) bans the addresses active in the last 24 h that nothing blocks yet, at most `--enforce-max-per-min` per minute, with every exclusion kept. Coverage in `/api/v1/enforce` is computed from the store, so it survives restarts.
## [1.4.4] - 2026-11-15
### Fixed
- Traefik access logs in the default text format are now read too (fewer fields than JSON: no host or service), so a proxy that loses its JSON setting no longer silently drops the web traffic.
- A source with more than 20% unreadable lines in its last 1000 is shown as degraded (red) in Integrity and Sources, logged once an hour, and checked by `urutau doctor`.
- Mobile: the More menu scrolls when it is taller than the screen.
## [1.4.3] - 2026-11-15
### Added
- Tor network: the official exit and relay lists are downloaded every 6 hours (`URUTAU_TOR_AUTO`, cached in the data directory). Requests from Tor exits are marked `tor`; a workload talking to a Tor relay is a high outbound finding.
### Fixed
- Outbound traffic: the servers themselves (trusted addresses, peers, local public addresses) never raise findings; regular connections of the host to its own provider (`URUTAU_EGRESS_PROVIDER_ASN` or the provider of its address) are shown as provider services, outside the verdict; regular connections to large CDNs and clouds are low severity unless the destination attacked the server.
## [1.4.2] - 2026-11-15
### Changed
- Services page redesigned: plain-language verdict, KPIs with sparklines, services from worst to best with availability against the 99.5% SLO, error budget left, burn rate, Apdex and latency, and a service detail with requests and errors, how requests were answered, p95 by hour and failing routes split into service errors, blocked attacks and client mistakes. API: `err_spark` in `/api/v1/services`.
## [1.4.1] - 2026-11-15
### Added
- Network probes source (`URUTAU_PROBE_LOG`, default `/logs/host/probe.log`): the host kit logs new inbound connections to ports nobody listens on; each becomes a `port-scan` event (MITRE T1046), and 10 distinct ports in 10 minutes make the second firewall ban the address (reason `port-scan`).
- Survival: who blocked and how fast, the host fail2ban jails apart from the Urutau second firewall.
- Pagination in the backend for sessions, IPs, campaigns and the events of an address, with one pager for every list; event search pages by cursor.
### Changed
- Outbound traffic page redesigned: plain-language verdict, evidence cards (beacon rhythm and interval histogram), destination map, activity by hour, compact workloads and the timeline of authorised scans. API: `findings[].samples`, `by_country`.
- Reports page: a preview of the HTML report itself, always an A4 sheet scaled to the screen, with only Download and Print; language selector, period and server from the header.
- Report: sharp logo (the repository logo at 800 px) and the cover drawing is now the urutau's call, five descending notes.
## [1.4.0] - 2026-11-14
### Added
- Second firewall (optional, `URUTAU_ENFORCE=off|observe|on`): Urutau decides which attacking addresses to block and writes the decisions to a file; the host fail2ban (jail `urutau`) applies them. Urutau gets no privileges. Observe mode shows what would be blocked. Optional decision sharing between hub and peers (`URUTAU_ENFORCE_SHARE`), applied only when the receiving server also saw the address attack. Never blocks trusted addresses, private ranges, CDN (Cloudflare) and public resolver ranges, peers or the server itself. The ban only drops connections the address starts, so replies to the server's own connections keep flowing.
- Egress analysis (`URUTAU_EGRESS`): new outbound connections of the host and containers, logged by nftables, are checked for beaconing (regular conversations with one destination), mining, IRC and SMTP ports, contact with addresses that attacked the server or Tor exits, DNS outside the allowed resolvers, unauthorised outbound scans and new countries. Workloads by network or container name (`URUTAU_EGRESS_WORKLOADS`); a `scanner` workload (an authorised surface scanner) has only its scan-shaped traffic summarised, everything else is judged like any other workload, so its beaconing is still detected.
- Host kit in `deploy/host` (nftables table, rsyslog, logrotate, container map, fail2ban filter, action and jail, `install.sh`).
- New page Outbound traffic and a Second firewall section in Defense.
- HTML report (`/api/v1/report?format=html`): cover, executive summary in plain language, rule-based recommendations, threats, geography, errors and health, visitors, defense, second firewall and outbound traffic, printable on A4. The Reports page downloads or prints it.
- API: `GET /api/v1/enforce` and `GET /api/v1/egress` (user only), and the federation routes `GET /api/v1/peer/egress`, `GET` and `POST /api/v1/peer/decisions` (decision sharing, only when `URUTAU_ENFORCE_SHARE` is on), which join the peer token routes.
- Screenshot script covers every page.
## [1.3.0] - 2026-11-14
@@ -45,6 +296,13 @@ Format based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versio
- The soft memory limit is 256 MiB (worst case measured: about 54 MiB of heap and a snapshot of about 27 MB). In Docker, `mem_limit: 384m` is recommended.
## [1.1.1] - 2026-11-14
### Fixed
- Live page, globe mode: sea and land colors no longer swap while the globe turns. Each country ring is now clipped at the horizon and closed along the edge of the globe, and long edges follow the map projection.
- World map data: countries crossing the 180th meridian (Russia, Fiji) are closed along the map edge, so the Sea of Okhotsk is no longer filled as land on the flat maps.
## [1.1.0] - 2026-11-14
### Added
@@ -108,3 +366,34 @@ First release.
- The IP address of a legitimate visitor is never persisted; unique visitors use a hash with a daily salt.
- Hostile log content is limited in length and escaped on output; the dashboard ships a strict Content-Security-Policy and the usual hardening headers.
- `--insecure-no-auth` is refused unless the bind address is loopback.
[Unreleased]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.3.1...HEAD
[2.3.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.3.0...v2.3.1
[2.3.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.2.2...v2.3.0
[2.1.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.1.0...v2.1.1
[2.1.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.0.0...v2.1.0
[2.0.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.6.0...v2.0.0
[1.6.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.7...v1.6.0
[1.5.8]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/commit/bc3ce09
[1.5.7]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.6...v1.5.7
[1.5.6]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.5...v1.5.6
[1.5.5]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.4...v1.5.5
[1.5.4]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.3...v1.5.4
[1.5.3]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.2...v1.5.3
[1.5.2]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.1...v1.5.2
[1.5.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.0...v1.5.1
[1.5.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.8...v1.5.0
[1.4.8]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.7...v1.4.8
[1.4.7]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.6...v1.4.7
[1.4.6]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.5...v1.4.6
[1.4.5]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.4...v1.4.5
[1.4.4]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.3...v1.4.4
[1.4.3]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.2...v1.4.3
[1.4.2]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.1...v1.4.2
[1.4.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.0...v1.4.1
[1.4.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.3.0...v1.4.0
[1.3.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.2.0...v1.3.0
[1.2.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.1.1...v1.2.0
[1.1.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.1.0...v1.1.1
[1.1.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.0.0...v1.1.0
[1.0.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/releases/tag/v1.0.0
+292 -3
View File
@@ -6,12 +6,263 @@ Formato baseado no [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/);
## [Unreleased]
## [1.1.1] - 2026-11-14
## [2.3.1] - 2026-11-23
### Alterado
- O Replay toca só ameaças por padrão. 96% dos eventos que a página baixava eram `ok` (tráfego legítimo, como robôs navegando num servidor Git), então uma página de 2000 eventos cobria cerca de 44 minutos e 24 h levavam cerca de 21 páginas. A API de eventos aceita uma lista de categorias negada (`cat=!ok`, um `!` no início exclui), o filtro de categoria do Replay tem "Ameaças (padrão)" e "Tudo, inclusive tráfego legítimo" (`cat=all` no link), e a faixa da linha do tempo e a frase de abertura contam o mesmo filtro.
### Corrigido
- Página Ao vivo, modo globo: as cores do mar e da terra não se trocam mais enquanto o globo gira. Cada contorno de país agora é recortado no horizonte e fechado ao longo da borda do globo, e as arestas longas seguem a projeção do mapa.
- Dados do mapa-múndi: países que cruzam o meridiano 180 (Rússia, Fiji) são fechados ao longo da borda do mapa, então o Mar de Okhotsk não é mais pintado como terra nos mapas planos.
- Abrir o Replay não baixa mais a mesma primeira página de eventos duas vezes (a página era refeita quando o estudo do período chegava; os eventos carregados agora são anotados no lugar, e um link de campanha ou "Só incidentes" ainda refazem) e não pede mais o resumo duas vezes (reaproveita a requisição do shell).
## [2.3.0] - 2026-11-23
### Adicionado
- Telemetria do firewall (tentativas de entrada): os logs das aplicações não enxergam tentativas de conexão a portas em que nada escuta, nem pacotes de endereços já banidos (o firewall os descarta em silêncio), então o painel subestimava a escala real e os ataques ao SSH pareciam diminuir só porque os bans funcionam. A nova opção do kit do host `install.sh --ingress` instala uma tabela nftables só de observação (`inet urutau_ingress`, prerouting com prioridade -150, antes do DNAT do Docker; contadores e um log com limite de ritmo, nunca descarta, aceita, marca nem reescreve nada) e um timer que grava contadores exatos em `/var/log/urutau/ingress.counters`, além de uma amostra das tentativas em `/var/log/urutau/ingress.log`. A sonda acompanha os dois (`URUTAU_INGRESS_LOG`, `URUTAU_INGRESS_COUNTERS`), o hub agrega por host em baldes por hora durante 30 dias, e a Defesa ganha a seção "Firewall: tentativas de entrada": totais exatos e tentativas por hora, parcela para portas fechadas, parcela de origens banidas no momento (estimada pela amostra) e portas, redes e países mais frequentes rotulados como amostrados. Novo endpoint `GET /api/v1/ingress`; o `urutau doctor` informa se a fonte está presente e fresca. As tentativas são só telemetria: nunca viram eventos nem evidência, então não há laço de retroalimentação de bans. Para atualizar: atualize o hub e as sondas e, em cada host, rode `sudo sh deploy/host/install.sh --ingress` (some `--probe` e `--enforce` conforme o host já usa). As fontes ficam em `waiting` até lá. O firewall do provedor de nuvem (por exemplo uma lista de segurança da Oracle Cloud) barra algumas portas antes do host, então a métrica é o que chega ao host.
### Alterado
- O tráfego próprio e confiável é registrado em vez de descartado. As requisições web de `URUTAU_TRUSTED` (classe `trusted`) e das faixas de `URUTAU_IGNORE`, redes privadas por padrão (classe `internal`), sumiam na ingestão, o que escondia cerca de metade das requisições reais de um host movimentado (o outro servidor, um runner de CI, o gateway do Docker). Agora são contadas só em agregados (sem registro de evento cada, mantidas no snapshot) e nunca pontuam um IP nem entram em ameaças, campanhas, sessões, mapas, lista de bloqueio, evidência de banimento, lógica de egress ou análise de visitantes. API: `totals.trusted`, `totals.internal`, `totals.requests_all` (`requests` mais as duas classes), `totals.counts.trusted` e `.internal`, e `own` em `/api/v1/summary` (classes de status, `series` da linha do tempo, `origins`, `domains`, `paths`). A página Tráfego ganhou a seção "Infraestrutura própria e origens confiáveis". As sondas não precisam mudar: o hub classifica. Testes `TestOwnTrafficIsCountedNeverAnalysed` e `TestOwnTrafficThroughFeed`.
### Corrigido
- Estudos de longo prazo (15 e 30 dias) não estouram mais o tempo: com cerca de 25.000 eventos por dia em 30 dias, período, relatório, campanhas, funil e métricas levavam de 6 a 19 s e voltavam `truncated` com famílias, técnicas e campanhas parciais. Os dias fechados do registro de eventos agora são decodificados uma vez e mantidos na memória (teto de 96 MB, invalidados pelo tamanho e data de modificação do arquivo), o dia atual é lido do arquivo, as sessões são montadas em paralelo e compartilhadas por período, funil e métricas, e a normalização de caminhos é memorizada. No conjunto sintético de 30 dias (750.000 eventos, 2 hosts), as três visões juntas foram de 7,5 s a frio e 5,1 s a quente (cerca de 16 s com limite de memória de 256 MiB, truncado) para 3,7 s a frio e 1,5 s a quente sob GOMEMLIMIT 256MiB, sem truncar, cerca de 200 MB de heap. O painel mostra um aviso quando um estudo realmente atinge um limite. Os alvos mais atacados com contagem igual agora também são ordenados por host, então o resultado é determinístico. Testes `TestDayCacheEqualsFullScan`, `TestDayCacheInvalidatesOnChange` e `BenchmarkStudy30d`.
## [2.2.2] - 2026-11-19
### Corrigido
- Tráfego de saída: um redeploy que trocou endereços entre contêineres (o rspamd e o clamav do LambdaMail trocaram 172.19.0.2 e .5) era julgado com o `containers.map` do minuto anterior, e os achados caíam no workload errado (SURBL e DNS do rspamd como `clamav`, freshclam como `dns`). O kit do host agora também roda o `urutau-containers-watch`, que regrava o mapa a cada contêiner que sobe ou entra numa rede, e a sonda confere o arquivo a cada 2 segundos em vez de 10. Reinstale o kit do host (`deploy/host/install.sh`) e atualize as sondas.
- Tráfego de saída: `new_geo` não dispara mais para grandes CDNs e nuvens (Cloudflare, Google, AWS, Azure, Akamai, Fastly, Telegram): os endereços são anycast ou globais, e o país da base (1.1.1.1 na Austrália, uma borda da Cloudflare no Canadá) nada diz sobre o destino do tráfego. Teste `TestNewGeoSkipsAnycastCDN`.
## [2.2.1] - 2026-11-16
### Corrigido
- O tráfego dos hosts alimentados por sonda continuava sumindo depois da rotação copytruncate do Traefik mesmo na 2.2.0: a impressão digital do início do arquivo cobria só 64 bytes, e a primeira linha de cada geração do Traefik começa com o mesmo endereço e porta de uma conexão keep-alive, então toda geração parecia o mesmo arquivo e o hub descartava as linhas abaixo da marca anterior. A impressão digital agora cobre até 1024 bytes (a primeira linha inteira, com carimbo de tempo em nanossegundos), e o hub trata impressões de tamanhos diferentes como gerações diferentes. Atualize também as sondas. Testes `TestHeadCoversFirstLine` e `TestSameHeadCopytruncate`.
## [2.2.0] - 2026-11-16
### Adicionado
- Análise de IP: um endereço que nunca atacou mas é destino de saída (por exemplo o IP de um incidente de egress) agora abre a vista "Destino de saída": quais hosts e cargas de trabalho se conectaram, portas, conexões, ASN/país, achados e incidentes ligados. Endpoint novo `GET /api/v1/ip/{ip}/egress`. Quando não há nada, a página diz de forma definitiva que o IP nunca foi visto; se foi visto como origem fora do período, mostra a última data e um botão de 30 dias.
- Filtro global de host: várias sondas podem ser selecionadas ao mesmo tempo (`host=oracle,hostinger` na URL e na API); marcar todas, ou "Todos os hosts", significa todas as sondas.
### Corrigido
- Tráfego: o hub descartava linhas do Traefik depois de cada rotação copytruncate do `access.log` (comparava só inode e offset e ignorava a impressão digital do início que a sonda envia), então o tráfego legítimo do host Oracle sumia por horas após cada rotação. Teste de regressão `TestSameHeadCopytruncate`.
- Filtro global de host: voltar para "Todos os hosts" não fazia nada, porque a URL sem `host=` mantinha o host anterior.
## [2.1.2] - 2026-11-16
### Corrigido
- Saída, `dns_bypass` falso logo após reiniciar o hub: os arquivos que a sonda envia (`resolv.conf`, `containers.map`) ficavam só na memória do hub, então depois de um reinício as linhas de saída que a sonda reenviava ao reconectar eram julgadas antes de ela mandar os arquivos de novo (`coolify-sentinel` da Hostinger → o resolvedor upstream 153.92.2.6, hostinger/INC-8). O hub agora guarda a última cópia de cada arquivo no diretório do nó (`probe-resolv.conf`, `probe-containers.map`) e a carrega na inicialização. Teste de regressão `TestProbeFilesSurviveRestart`.
- Celular: a folha de filtros globais (período e host) abre acima da barra de navegação inferior em vez de cobri-la, tocar na barra a fecha, e a barra de filtros fixa não fica mais por cima do menu "Mais".
## [2.1.1] - 2026-11-16
### Corrigido
- Incidentes: as abas de status (Ativos, Todos, Aberto, Falso positivo etc.) não mostram mais uma barra de rolagem vertical minúscula; o sublinhado da aba ativa não passa mais 1 px da área rolável, e o anel de foco é desenhado dentro da aba para não ser cortado.
## [2.1.0] - 2026-11-16
### Corrigido
- Egress, falso `dns_bypass` nas sondas: o hub julgava as linhas de egress de um lote antes de aplicar o `resolv.conf` (e o `containers.map`) enviado no mesmo lote, e recriar o engine de egress de uma sonda (mudança de configuração) perdia esses arquivos. Agora o hub guarda os últimos arquivos de cada sonda e os aplica antes das linhas e em todo engine recriado; a sonda os enfileira antes de começar a ler os logs. Teste de regressão `TestEgressFilesAppliedBeforeLines`.
- Replay: o controle Repetir é um alternador comum na barra de transporte, com o mesmo visual e comportamento de Comprimir, Só incidentes e Selecionar.
- Análise de IP: domínios longos quebram nos pontos, não no meio de um rótulo.
### Alterado
- Página de incidentes redesenhada: severidade por extenso, IDs qualificados pelo host que não sobrepõem mais o título, ocorrências e comentários na lista, cartões no celular, cabeçalho de detalhe claro, linha do tempo da atividade e um bloco próprio de supressão que mostra a data de fim, permite escolher 7, 30 ou 90 dias e explica por que está desativado (não é egress, é alta/crítica ou o status).
- Barra de filtros global redesenhada: um controle de período (atalhos relativos e janela exata com calendário, validada contra a retenção de 30 dias), fuso visível, janela anterior/seguinte, seletor de host com o status das sondas, indicador ao vivo/fixo, Limpar filtros e Copiar link, fixa e compacta ao rolar, painel inferior no celular, teclado e leitor de tela completos. As classes não colidem mais com a página de replay.
- Página de análise de IP refeita: cabeçalho de identidade, resumo em quatro respostas (o que, quando, contra o quê, bloqueado?), barra de seções fixa, situação de defesa por host com desbanir, tabela de histórico de bans, eventos brutos em seção própria com filtro por categoria e nenhum texto cortado em qualquer largura.
## [2.0.0] - 2026-11-15
Versão com quebra de compatibilidade: leia [docs/pt-BR/migracao-2.0.md](docs/pt-BR/migracao-2.0.md) antes de atualizar.
### Adicionado
- Sonda ultraleve: `urutau probe`, com imagem própria (`urutau-probe`, `FROM scratch`, menos de 15 MB, cerca de 20 MB de memória, sem porta aberta). Acompanha os logs de Traefik, sshd, fail2ban, sondagens de porta e egress do seu servidor e os envia ao hub.
- Recepção por HTTPS comum (`/api/v1/probe/hello`, `push`, `commands`) com spool em disco, gzip, lotes idempotentes e deduplicação por offset, então uma queda ou reinício do hub não perde nem duplica nada. Com o spool cheio, os lotes mais antigos são descartados e a perda é contada e mostrada.
- Gestão de sondas: `urutau probes create|list|revoke`, `GET/POST/PUT/DELETE /api/v1/probes` e a página Fontes. O token (`urp_...`) aparece uma vez e o hub guarda só o SHA-256 dele.
- Localização e configuração de egress (workloads, resolvers, destinos permitidos) por sonda, no hub.
- `urutau import` traz um diretório de dados da 1.x para o hub como uma sonda (cópia, verificação de SHA-256 e contagens, idempotente, `--dry-run`, `--verify`, `--count`), sem perda.
- Incidentes qualificados por host (`host/INC-n`); `INC-n` sozinho vale para a sonda primária.
- Duas imagens a partir de um só Dockerfile (targets `hub` e `probe`), ambas multi-arquitetura, construídas e publicadas juntas; `deploy/probe/docker-compose.yml` e `deploy/host/install.sh --probe`.
### Alterado
- O hub não lê mais arquivos locais: o servidor do hub roda uma sonda como qualquer outro. A sonda primária (a de nome igual a `URUTAU_NAME`) mantém seus dados na raiz do data-dir, sem mudança em relação à 1.x.
- Segundo firewall: o hub enfileira comandos de ban e desban para cada sonda, que os valida (`wire.ValidCmdLine`) e os acrescenta a `decisions.log` e `unban.log`; a jail do fail2ban não mudou.
- A página Fontes mostra o estado de cada sonda e de cada uma de suas fontes.
- A imagem do hub não define mais as variáveis de caminho de log.
- Documentação, README e capturas de tela atualizados para a 2.0.0.
### Removido
- **Incompatível:** a federação por peers: `URUTAU_PEERS`, `URUTAU_PEER_TOKEN*`, `URUTAU_PEER_ALLOW`, `URUTAU_PEER_BLOCKLIST` e todas as rotas `/api/v1/peer/*` (agora 404). O hub se recusa a subir quando uma dessas variáveis está definida.
- **Incompatível:** as variáveis de caminho de log do hub (`URUTAU_TRAEFIK_LOG`, `URUTAU_AUTH_LOG`, `URUTAU_FAIL2BAN_LOG`, `URUTAU_PROBE_LOG`, `URUTAU_EGRESS_LOG`, `URUTAU_EGRESS_CONTAINERS`, `URUTAU_ENFORCE_LOG`, `URUTAU_ENFORCE_UNBAN_LOG`) agora pertencem à sonda. Os padrões da imagem antiga só geram um aviso. Veja [docs/pt-BR/migracao-2.0.md](docs/pt-BR/migracao-2.0.md).
## [1.6.0] - 2026-11-15
### Corrigido
- Navegar em forja de código não é mais ataque: crawlers (uma faixa da Alibaba e o Googlebot) lendo `/dono/repo/src/commit/<sha>/.gitignore`, `/raw/commit/...`, `/blame/...`, `/commits/...`, `.env.example` e arquivos parecidos de repositório num Gitea público (também caminhos `blob`/`tree`/`raw` no estilo GitHub e GitLab) eram classificados como scanner, env-probe e vcs-probe, cerca de 58% dos "atacantes". Sondagens reais (`/.env`, `/.git/config`, `/app/.env`, traversal) não mudam.
- O segundo firewall só excluía crawler quando o User-Agent dizia ser um, então um Googlebot verificado ("GoogleOther") foi banido. Um DNS reverso confirmado nos dois sentidos (googlebot.com, google.com, search.msn.com, applebot.apple.com) agora exclui o endereço qualquer que seja o User-Agent; mais User-Agents de crawler são reconhecidos (GoogleOther, Google-InspectionTool, AdsBot, Apple).
- Laço de retroalimentação: banimentos do jail `urutau` (decisões nossas) e do `recidive` (que só repete bans) deixam de contar como evidência: sem pontuação, sem sinal forte, sem entrar na lista de bloqueio. Bans de jails independentes (sshd, traefik...) continuam valendo.
- A cobertura da lista de bloqueio enganava (3%): contava só os atacantes listados.
### Alterado
- A cobertura (`blocklist.coverage_pct`, `blocklist_coverage`) passa a contar como protegido o atacante listado ou banido por qualquer jail. Campos novos, só adicionados: `blocklist.attackers`, `covered`, `one_shot`, `repeat_ips`, `repeat_covered`, `repeat_coverage_pct` em `/api/v1/defense`, e `one_shot`, `repeat_ips`, `repeat_unblocked` na `coverage` do enforce.
- Política do enforce para atacantes lentos: eventos `ssh-probe` valem meia falha nas regras de SSH; uma janela de 7 dias bane com 10 falhas de SSH (probes valem metade) ou 10 eventos de scan/exploit web sem visita legítima (memória limitada); novo motivo `neighbor-campaign`: com 3 ou mais endereços distintos de um /24 (IPv4) ou /64 (IPv6) banidos nas últimas 24 h, basta um evento de ataque de outro endereço do prefixo. Todas as exclusões (confiável, privado, crawler, infraestrutura, visitante legítimo, operador) seguem valendo, e os peers aceitam o novo motivo.
## [1.5.8] - 2026-11-15
Não publicada separadamente: não existe a tag `v1.5.8`. Esta alteração (commit `bc3ce09`) foi mesclada na mesma versão da 1.6.0 e saiu junto com ela.
### Corrigido
- Celular: tabelas de dados comuns (ranking da Concentração, rotas de Erros, técnicas MITRE, Defesa, fontes da Integridade e qualquer outra sem layout próprio para celular) apareciam com colunas espremidas, IPs quebrados letra por letra ou rolagem lateral. Abaixo de 768 px as linhas agora viram cartões empilhados com o nome da coluna como rótulo, números alinhados à direita e texto longo quebrando; o desktop não muda. Uma regra única em `style.css` e `cardTables()` em `app.js` cobre todas. `TABLES_ONLY=1 scripts/screenshots.sh` captura todas as páginas com tabela em 375x812 e verifica estouro horizontal.
## [1.5.7] - 2026-11-15
### Corrigido
- Protocolos e TLS: a legenda das classes sob as barras empilhadas não tinha estilo (palavras grudadas, sem as cores e estourando no celular); o painel Métodos não reserva mais 280 px fixos com espaço vazio; os nomes das suítes de cifra quebram nos sublinhados em vez de no meio da palavra; no celular o detalhamento por classe de cada método vai para baixo do nome; um seletor CSS inválido desligava a regra de uma coluna no celular.
## [1.5.6] - 2026-11-15
### Corrigido
- Celular: a tabela acessível oculta dos gráficos (`table.sr-only`, ~1300 px porque tabelas ignoram `width: 1px`) alargava o layout na página de tráfego de saída e arrastava o menu inferior fixo para o lado. A tabela agora tem layout fixo de 1 px, e `html`/`body` usam `overflow-x: clip`, para nada mais alargar a página.
## [1.5.5] - 2026-11-15
### Corrigido
- Incidentes no celular: as ações rápidas quebram linha em vez de ficarem cortadas, os filtros dividem a linha por igual e a linha da carga de trabalho não fica mais recuada.
## [1.5.4] - 2026-11-15
### Corrigido
- Lista de incidentes: chamados de egress mostram o padrão na primeira linha e a carga de trabalho embaixo, em vez de um título automático longo cortado no meio; as abas de status ficaram compactas e cabem numa linha em 1280 px.
## [1.5.3] - 2026-11-15
### Corrigido
- Incidentes: o botão Copiar da impressão digital não quebra mais letra por letra; a lista mostra uma etiqueta por linha e coluna de servidor/destino mais larga, então títulos e IPs deixam de ser cortados.
## [1.5.2] - 2026-11-15
### Alterado
- Incidentes redesenhados após revisão de UX: página do chamado com cabeçalho fixo e ações rápidas, coluna principal (resumo + linha do tempo única de comentários e alterações) e barra lateral com propriedades salvas na hora e dados técnicos compactos; a lista virou tabela densa com abas numa linha e o estado vazio oferece "Ver todos". Acabaram os vazios entre painéis.
## [1.5.1] - 2026-11-15
### Corrigido
- Incidentes: a lista aceita `?status=` no link (sinônimo de `?s=`), então `#/incidents?status=benign` abre filtrado.
- Incidentes: a criação do chamado no histórico aparece como "urutau abriu o chamado (severidade: …)" em vez de "alterou created".
## [1.5.0] - 2026-11-15
### Adicionado
- Gestão de incidentes: cada achado de egress (severidade acima de info) vira um chamado `INC-<n>` com chave `host|kind|workload|dst|dport|proto`, criado por uma sincronização a cada relatório de egress mesclado e a cada 60 s. O chamado tem status (`open`, `investigating`, `true_positive`, `false_positive`, `benign`, `resolved`), severidade, responsável, etiquetas, conclusão, comentários e histórico de mudanças; um chamado resolvido reabre quando o achado reaparece. Fica em `<data-dir>/incidents.json` (escrita atômica, 0600; arquivo corrompido vai para `.corrupt`); limites de 5000 chamados, 200 comentários e 500 entradas de histórico cada. Toda escrita também vai para o log (id, campo, autor).
- Um chamado em `false_positive` ou `benign` pode suprimir os achados com exatamente a sua chave: eles saem de `/api/v1/egress` (e do relatório de egress), salvo com `?suppressed=1`. Os achados agora trazem `ticket_id`, `ticket_status` e `suppressed`, e a resposta tem `suppressed_count`.
- API: `GET /api/v1/incidents`, `GET /api/v1/incidents/{id}`, `POST /api/v1/incidents`, `PATCH /api/v1/incidents/{id}`, `POST /api/v1/incidents/{id}/comments` e `GET /api/v1/incidents/export.csv` (fechada ao token de peer; escritas recusam requisições cross-site).
- A supressão expira: um chamado suprime seus achados por 30 dias por padrão (90 no máximo), e um host com mais de 300 chamados ativos tem o excedente agrupado em um chamado de inundação.
## [1.4.8] - 2026-11-15
### Corrigido
- Análise de egress, falsos positivos: o kit nftables agora registra só tentativas de conexão TCP (SYN sem ACK), então respostas a clientes banidos (conntrack recriado no meio do fluxo) não aparecem mais como `bad_dst` "nos atacou". **Rode `deploy/host/install.sh --enforce` de novo no host para aplicar o nft novo.**
- Hosts com o kit antigo: o parser descarta linhas TCP sem SYN puro e as conta como `non_syn_dropped` na fonte de egress (não como `malformed`).
- Serviços de metadados de nuvem (169.254.169.254, `fd00:c1::a9fe:a9fe`, `fd00:ec2::254`, link-local) consultados pelo próprio host são `infra` (info), não beacon; container acessando continua alerta (SSRF/roubo de credencial).
- Conexões regulares para Akamai (AS20940/AS16625 e faixas principais) e Telegram (AS62041, 149.154.160.0/20, 91.108.0.0/16) ficam `low` ("rede grande de CDN/nuvem"). Hetzner (ex.: atualização do SURBL) continua `medium`: não há correlação por nome e nenhum IP foi fixado no código.
## [1.4.7] - 2026-11-15
### Corrigido
- O arquivo de desban agora tem como padrão `unban.log` ao lado de `--enforce-log` (o padrão se perdia, e o botão Desbanir dizia que o arquivo não era gravável).
## [1.4.6] - 2026-11-15
### Adicionado
- Desbanir pela interface: botão "Desbanir" nas decisões recentes e na página do endereço pede ao host (por `unban.log` ao lado de `--enforce-log`, flag `--enforce-unban-log`) que libere o bloqueio do fail2ban, e pode impedir o segundo firewall de banir de novo por 1 h, 24 h ou 7 dias (liberações do operador, listadas e encerráveis em Defesa; compartilhadas com os parceiros quando o compartilhamento está ligado). API: `POST /api/v1/enforce/unban`, `DELETE /api/v1/enforce/allow`, `allows` em `GET /api/v1/enforce`.
### Corrigido
- Segundo firewall: as regras de 24 h também contam pelos contadores diários persistentes, então funcionam quando o registro de eventos não cobre o dia inteiro (após um reset ou atualização).
## [1.4.5] - 2026-11-15
### Corrigido
- Segundo firewall: agora usa o histórico. Endereço com veredito hostil (ou suspeito com score 100 ou mais) é banido no primeiro evento malicioso novo (`known-attacker`); 10 falhas SSH ou 20 eventos de varredura/exploração web em 24 h também banem (atacantes lentos); uma varredura a cada 10 minutos (e após o backfill da partida) bane os endereços ativos nas últimas 24 h que nada bloqueia ainda, no máximo `--enforce-max-per-min` por minuto, mantidas todas as exclusões. A cobertura de `/api/v1/enforce` sai do store e sobrevive a reinícios.
## [1.4.4] - 2026-11-15
### Corrigido
- O log de acesso do Traefik no formato texto padrão agora também é lido (menos campos que o JSON: sem host nem serviço), então um proxy que perde a configuração JSON não descarta mais o tráfego web em silêncio.
- Uma fonte com mais de 20% de linhas ilegíveis nas últimas 1000 aparece como degradada (vermelho) em Integridade e Fontes, é registrada no log uma vez por hora e é verificada pelo `urutau doctor`.
- Celular: o menu Mais rola quando é maior que a tela.
## [1.4.3] - 2026-11-15
### Adicionado
- Rede Tor: as listas oficiais de saídas e relays são baixadas a cada 6 horas (`URUTAU_TOR_AUTO`, com cache no diretório de dados). Requisições vindas de saídas Tor são marcadas `tor`; um workload falando com um relay Tor é um achado de saída de gravidade alta.
### Corrigido
- Tráfego de saída: os próprios servidores (endereços confiáveis, peers, endereços públicos locais) nunca geram achados; conexões regulares do host com o próprio provedor (`URUTAU_EGRESS_PROVIDER_ASN` ou o provedor do seu endereço) aparecem como serviços do provedor, fora do veredito; conexões regulares com grandes CDNs e nuvens têm gravidade baixa, salvo se o destino atacou o servidor.
## [1.4.2] - 2026-11-15
### Alterado
- Página Serviços refeita: veredito em linguagem leiga, indicadores com mini gráficos, serviços dos piores para os melhores com disponibilidade contra o SLO de 99,5%, orçamento de erro restante, consumo, Apdex e latência, e detalhe do serviço com requisições e erros, como as requisições foram respondidas, p95 por hora e rotas que falham separadas em erros do serviço, ataques barrados e enganos do cliente. API: `err_spark` em `/api/v1/services`.
## [1.4.1] - 2026-11-15
### Adicionado
- Fonte de sondagens de rede (`URUTAU_PROBE_LOG`, padrão `/logs/host/probe.log`): o kit do host registra conexões novas de entrada para portas em que nada escuta; cada uma vira um evento `port-scan` (MITRE T1046), e 10 portas distintas em 10 minutos fazem o segundo firewall banir o endereço (motivo `port-scan`).
- Sobrevivência: quem bloqueou e com que rapidez, os jails do fail2ban do host separados do segundo firewall do Urutau.
- Paginação no backend para sessões, IPs, campanhas e eventos de um endereço, com um paginador único em todas as listas; a busca de eventos pagina por cursor.
### Alterado
- Página Tráfego de saída refeita: veredito em linguagem leiga, cartões de evidência (ritmo do beacon e histograma dos intervalos), mapa de destinos, atividade por hora, workloads compactos e a linha do tempo das varreduras autorizadas. API: `findings[].samples`, `by_country`.
- Página Relatórios: prévia do próprio relatório HTML, sempre uma folha A4 em escala, só com Baixar e Imprimir; seletor de idioma, período e servidor do topo.
- Relatório: logo nítida (a logo do repositório em 800 px) e o desenho da capa agora é o canto do urutau, cinco notas descendentes.
## [1.4.0] - 2026-11-14
### Adicionado
- Segundo firewall (opcional, `URUTAU_ENFORCE=off|observe|on`): o Urutau decide quais endereços atacantes bloquear e grava as decisões num arquivo; o fail2ban do host (jail `urutau`) as aplica. O Urutau não ganha privilégios. O modo observação mostra o que seria bloqueado. Compartilhamento opcional de decisões entre hub e peers (`URUTAU_ENFORCE_SHARE`), aplicado só quando o servidor que recebe também viu o endereço atacar. Nunca bloqueia endereços confiáveis, redes privadas, faixas de CDN (Cloudflare) e de resolvedores públicos, peers nem o próprio servidor. O banimento só derruba conexões que o endereço inicia, então as respostas às conexões do próprio servidor continuam passando.
- Análise do tráfego de saída (`URUTAU_EGRESS`): as conexões novas de saída do host e dos contêineres, registradas pelo nftables, são analisadas em busca de beaconing (conversa regular com um destino), mineração, portas de IRC e SMTP, contato com endereços que atacaram o servidor ou saídas Tor, DNS fora dos resolvedores permitidos, varreduras de saída não autorizadas e países novos. Workloads por rede ou nome de contêiner (`URUTAU_EGRESS_WORKLOADS`); um workload `scanner` (scanner de superfície autorizado) só tem resumido o tráfego em formato de varredura, todo o resto é julgado como o de qualquer workload, então o beaconing dele continua sendo detectado.
- Kit de host em `deploy/host` (tabela nftables, rsyslog, logrotate, mapa de contêineres, filtro, ação e jail do fail2ban, `install.sh`).
- Página nova Tráfego de saída e seção Segundo firewall em Defesa.
- Relatório HTML (`/api/v1/report?format=html`): capa, sumário executivo em linguagem leiga, recomendações por regras, ameaças, geografia, erros e saúde, visitantes, defesa, segundo firewall e tráfego de saída, imprimível em A4. A página Relatórios baixa ou imprime.
- API: `GET /api/v1/enforce` e `GET /api/v1/egress` (só usuário) e as rotas de federação `GET /api/v1/peer/egress` e `GET` e `POST /api/v1/peer/decisions` (compartilhamento de decisões, só com `URUTAU_ENFORCE_SHARE` ligado), que se juntam às rotas do token de peer.
- O script de capturas cobre todas as páginas.
## [1.3.0] - 2026-11-14
@@ -45,6 +296,13 @@ Formato baseado no [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/);
- O limite suave de memória é 256 MiB (pior caso medido: cerca de 54 MiB de heap e um snapshot de cerca de 27 MB). No Docker, recomenda-se `mem_limit: 384m`.
## [1.1.1] - 2026-11-14
### Corrigido
- Página Ao vivo, modo globo: as cores do mar e da terra não se trocam mais enquanto o globo gira. Cada contorno de país agora é recortado no horizonte e fechado ao longo da borda do globo, e as arestas longas seguem a projeção do mapa.
- Dados do mapa-múndi: países que cruzam o meridiano 180 (Rússia, Fiji) são fechados ao longo da borda do mapa, então o Mar de Okhotsk não é mais pintado como terra nos mapas planos.
## [1.1.0] - 2026-11-14
### Adicionado
@@ -108,3 +366,34 @@ Primeira versão.
- O endereço IP de um visitante legítimo nunca é persistido; visitantes únicos usam um hash com sal diário.
- O conteúdo hostil dos logs tem tamanho limitado e é escapado na saída; o dashboard envia uma Content-Security-Policy estrita e os cabeçalhos de endurecimento usuais.
- `--insecure-no-auth` é recusado a menos que o endereço de bind seja loopback.
[Não lançado]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.3.1...HEAD
[2.3.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.3.0...v2.3.1
[2.3.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.2.2...v2.3.0
[2.1.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.1.0...v2.1.1
[2.1.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v2.0.0...v2.1.0
[2.0.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.6.0...v2.0.0
[1.6.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.7...v1.6.0
[1.5.8]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/commit/bc3ce09
[1.5.7]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.6...v1.5.7
[1.5.6]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.5...v1.5.6
[1.5.5]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.4...v1.5.5
[1.5.4]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.3...v1.5.4
[1.5.3]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.2...v1.5.3
[1.5.2]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.1...v1.5.2
[1.5.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.5.0...v1.5.1
[1.5.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.8...v1.5.0
[1.4.8]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.7...v1.4.8
[1.4.7]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.6...v1.4.7
[1.4.6]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.5...v1.4.6
[1.4.5]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.4...v1.4.5
[1.4.4]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.3...v1.4.4
[1.4.3]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.2...v1.4.3
[1.4.2]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.1...v1.4.2
[1.4.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.4.0...v1.4.1
[1.4.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.3.0...v1.4.0
[1.3.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.2.0...v1.3.0
[1.2.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.1.1...v1.2.0
[1.1.1]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.1.0...v1.1.1
[1.1.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/compare/v1.0.0...v1.1.0
[1.0.0]: https://git.lucasrguerra.dev.br/ciberfauna/urutau/releases/tag/v1.0.0
+5 -5
View File
@@ -2,10 +2,10 @@
**English** · [Português](CONTRIBUTING.pt-BR.md)
Thanks for helping. Urutau is a lightweight threat intelligence panel for self-hosted servers: it reads logs, classifies hostile activity and scores IPs. The most useful contributions right now are tests, log fixtures, new detection rules and documentation.
Thanks for helping. Urutau is a lightweight threat intelligence panel for self-hosted servers: it reads logs, classifies hostile activity and scores IPs. It has two roles in one binary, the hub (`urutau serve`) and the probe (`urutau probe`). The most useful contributions right now are tests, log fixtures, new detection rules and documentation.
1. **Defensive use only.** Urutau reads logs on servers you own or administer. Do not add features that send traffic to the IPs it lists, scan third parties or hide what the tool does.
2. **Log content is hostile.** Every field that comes from a log (path, User-Agent, user name, host, jail) was written by an attacker. It must be length-limited when parsed, never executed or interpolated into a command, and escaped on output. A new parser comes with tests for malformed and oversized input.
2. **Log content is hostile, and so is what a probe sends.** Every field that comes from a log (path, User-Agent, user name, host, jail) was written by an attacker. It must be length-limited when parsed, never executed or interpolated into a command, and escaped on output. A new parser comes with tests for malformed and oversized input. The probe stays tiny: it must not import the store, geolocation or intelligence packages (its memory target is under 20 MB), and anything the hub asks it to write must pass `wire.ValidCmdLine`.
3. **A classification change pins its category.** New or changed detection rules need a test that shows the expected category and, for a weight change, the resulting score.
4. **Standard library first.** The binary is static and dependency-free on purpose. Adding a module needs a clear reason, and `go.sum` then enters the image inputs.
5. **100% English codebase.** Source code, comments, scripts, workflows and commit messages are in English. The dashboard is bilingual (English and Portuguese in `internal/server/web/i18n.js`).
@@ -17,7 +17,7 @@ scripts/install-hooks.sh
scripts/check.sh
```
`check.sh` validates `gofmt`, `go vet`, UI translation coverage, shell script syntax, workflow YAML files and `docker compose config` in seconds, skipping with a warning whatever the machine lacks. `scripts/check.sh --full` also runs `go test -race ./...` and `govulncheck`.
`check.sh` validates `gofmt`, `go vet`, UI translation coverage, shell script syntax, workflow YAML files and `docker compose config` (hub and probe) in seconds, skipping with a warning whatever the machine lacks. `scripts/check.sh --full` also runs `go test -race ./...` and `govulncheck`.
## Interface and translation
@@ -29,9 +29,9 @@ Always maintain document pairs: every `*.md` and `docs/*` file has an English ve
## Commits and releases
Commits follow Conventional Commits 1.0.0 in English (`feat:`, `fix:`, `chore:`, `ci:`, `docs:`, `refactor:`, `test:`, `perf:`, `build:`). Versions follow SemVer 2.0.0. Update the CHANGELOG in the same pull request as a user-visible change.
Commits follow Conventional Commits 1.0.0 in English (`feat:`, `fix:`, `chore:`, `ci:`, `docs:`, `refactor:`, `test:`, `perf:`, `build:`). Versions follow SemVer 2.0.0. Update the CHANGELOG in the same pull request as a user-visible change: add it under `[Unreleased]`, and at release time rename that section to the version and date and add the comparison link at the end of the file.
Releases are multi-arch container images (`linux/amd64` and `linux/arm64`) published to the Gitea registry. Pushing a `v*` tag triggers the release workflow, which reuses the image already built for the same inputs when there is one, and creates the Gitea release from the CHANGELOG section.
Releases are two multi-arch container images, the hub `urutau` and the probe `urutau-probe` (`linux/amd64` and `linux/arm64`, built from the same Dockerfile targets), published to the Gitea registry. Pushing a `v*` tag triggers the release workflow, which reuses the images already built for the same inputs when there are, and creates the Gitea release from the CHANGELOG section.
## License
+5 -5
View File
@@ -2,10 +2,10 @@
[English](CONTRIBUTING.md) · **Português**
Obrigado por ajudar. O Urutau é um painel leve de threat intelligence para servidores self-hosted: lê logs, classifica atividade hostil e pontua IPs. As contribuições mais úteis agora são testes, fixtures de logs, novas regras de detecção e documentação.
Obrigado por ajudar. O Urutau é um painel leve de threat intelligence para servidores self-hosted: lê logs, classifica atividade hostil e pontua IPs. Ele tem dois papéis em um só binário, o hub (`urutau serve`) e a sonda (`urutau probe`). As contribuições mais úteis agora são testes, fixtures de logs, novas regras de detecção e documentação.
1. **Apenas uso defensivo.** O Urutau lê logs de servidores que você possui ou administra. Não adicione recursos que enviem tráfego aos IPs listados, varram terceiros ou escondam o que a ferramenta faz.
2. **O conteúdo dos logs é hostil.** Todo campo vindo de um log (caminho, User-Agent, usuário, host, jail) foi escrito por um atacante. Ele deve ter tamanho limitado no parse, nunca ser executado ou interpolado em um comando, e ser escapado na saída. Um parser novo vem com testes para entrada malformada e gigante.
2. **O conteúdo dos logs é hostil, e o que uma sonda envia também.** Todo campo vindo de um log (caminho, User-Agent, usuário, host, jail) foi escrito por um atacante. Ele deve ter tamanho limitado no parse, nunca ser executado ou interpolado em um comando, e ser escapado na saída. Um parser novo vem com testes para entrada malformada e gigante. A sonda continua minúscula: não pode importar os pacotes de store, geolocalização nem intel (a meta de memória é abaixo de 20 MB), e tudo que o hub pedir a ela para gravar precisa passar por `wire.ValidCmdLine`.
3. **Mudança de classificação fixa sua categoria.** Regras de detecção novas ou alteradas precisam de um teste que mostre a categoria esperada e, numa mudança de peso, a pontuação resultante.
4. **Biblioteca padrão primeiro.** O binário é estático e sem dependências de propósito. Adicionar um módulo exige um motivo claro, e então o `go.sum` entra nas entradas da imagem.
5. **Base de código 100% em inglês.** Código-fonte, comentários, scripts, workflows e mensagens de commit são em inglês. O dashboard é bilíngue (inglês e português em `internal/server/web/i18n.js`).
@@ -17,7 +17,7 @@ scripts/install-hooks.sh
scripts/check.sh
```
O `check.sh` valida `gofmt`, `go vet`, cobertura de tradução da UI, sintaxe dos scripts, YAML dos workflows e `docker compose config` em segundos, pulando com aviso o que faltar na máquina. `scripts/check.sh --full` também roda `go test -race ./...` e `govulncheck`.
O `check.sh` valida `gofmt`, `go vet`, cobertura de tradução da UI, sintaxe dos scripts, YAML dos workflows e `docker compose config` (hub e sonda) em segundos, pulando com aviso o que faltar na máquina. `scripts/check.sh --full` também roda `go test -race ./...` e `govulncheck`.
## Interface e tradução
@@ -29,9 +29,9 @@ Mantenha sempre os pares de documentos: todo arquivo `*.md` e `docs/*` tem uma v
## Commits e releases
Commits seguem Conventional Commits 1.0.0 em inglês (`feat:`, `fix:`, `chore:`, `ci:`, `docs:`, `refactor:`, `test:`, `perf:`, `build:`). Versões seguem SemVer 2.0.0. Atualize o CHANGELOG no mesmo pull request de uma mudança visível ao usuário.
Commits seguem Conventional Commits 1.0.0 em inglês (`feat:`, `fix:`, `chore:`, `ci:`, `docs:`, `refactor:`, `test:`, `perf:`, `build:`). Versões seguem SemVer 2.0.0. Atualize o CHANGELOG no mesmo pull request de uma mudança visível ao usuário: registre em `[Não lançado]` e, na hora do release, renomeie essa seção para a versão e a data e acrescente o link de comparação no fim do arquivo.
Os releases são imagens de container multi-arquitetura (`linux/amd64` e `linux/arm64`) publicadas no registro do Gitea. Enviar uma tag `v*` dispara o workflow de release, que reaproveita a imagem já construída para as mesmas entradas, quando existe, e cria o release no Gitea a partir da seção do CHANGELOG.
Os releases são duas imagens de container multi-arquitetura, o hub `urutau` e a sonda `urutau-probe` (`linux/amd64` e `linux/arm64`, construídas dos targets do mesmo Dockerfile), publicadas no registro do Gitea. Enviar uma tag `v*` dispara o workflow de release, que reaproveita as imagens já construídas para as mesmas entradas, quando existem, e cria o release no Gitea a partir da seção do CHANGELOG.
## Licença
+45 -13
View File
@@ -1,6 +1,10 @@
# syntax=docker/dockerfile:1
#
# Urutau image: one static binary (no CGO, standard library only) on Alpine.
# Urutau 2: static binaries (no CGO, standard library only), two images.
# --target hub the hub: dashboard, API, probe ingestion (Alpine), cmd/urutau
# --target probe the probe only (FROM scratch), cmd/urutau-probe: links just the
# probe agent, the tailer and the wire protocol (~7 MB binary)
# The default (last) stage is the hub, so a plain `docker build .` is the hub.
# Build stage.
FROM golang:1.26.11-alpine3.24 AS build
@@ -8,18 +12,49 @@ WORKDIR /src
COPY go.mod ./
COPY cmd cmd
COPY internal internal
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/urutau ./cmd/urutau
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/urutau ./cmd/urutau \
&& v=$(sed -n 's/^var Version = "\(.*\)"/\1/p' internal/app/version.go) \
&& CGO_ENABLED=0 go build -trimpath -ldflags="-s -w -X main.version=$v" -o /out/urutau-probe ./cmd/urutau-probe
# Runtime stage: CA certificates (peers over HTTPS, geo database download) and
# tzdata so TZ can match the host's fail2ban log. The HEALTHCHECK is the binary
# itself (`urutau healthcheck`): no curl in the image.
# Runs unprivileged (uid 10001). To read /var/log/auth.log (group adm) the
# compose file adds the host group with `group_add: ["4"]`.
FROM alpine:3.24
# Files the scratch image needs: CA certificates (HTTPS to the hub), zoneinfo
# (TZ must match the host's fail2ban log) and an owned empty /state.
FROM alpine:3.24 AS probe-files
RUN apk add --no-cache ca-certificates tzdata \
&& mkdir -p /rootfs/state \
&& chown 10001:10001 /rootfs/state
# Probe image: no shell, no package manager, no listening port. It reads the
# host logs (read-only mounts), sends them to the hub over HTTPS and appends the
# hub's ban decisions to a file. The HEALTHCHECK is the binary itself
# (`urutau probe --check` reads the liveness mark in the state volume).
# Runs unprivileged (uid 10001); the compose file adds the host group adm
# (`group_add: ["4"]`) to read /var/log.
FROM scratch AS probe
COPY --from=probe-files /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=probe-files /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=probe-files --chown=10001:10001 /rootfs/state /state
COPY --from=build /out/urutau-probe /urutau
LABEL org.opencontainers.image.title="Urutau probe" \
org.opencontainers.image.description="Ultra-light Urutau probe: ships host logs to an Urutau hub" \
org.opencontainers.image.source="https://git.lucasrguerra.dev.br/ciberfauna/urutau" \
org.opencontainers.image.licenses="MIT OR Apache-2.0"
ENV URUTAU_STATE_DIR=/state \
SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt \
ZONEINFO=/usr/share/zoneinfo
USER 10001:10001
VOLUME /state
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
CMD ["/urutau", "probe", "--check"]
ENTRYPOINT ["/urutau", "probe"]
# Hub image: CA certificates (hub-to-hub downloads: geo database, Tor lists) and
# tzdata. The HEALTHCHECK is the binary itself (`urutau healthcheck`): no curl in
# the image. The hub reads no log file: the probes bring the lines.
FROM alpine:3.24 AS hub
RUN apk add --no-cache ca-certificates tzdata \
&& addgroup -S -g 10001 urutau \
&& adduser -S -u 10001 -G urutau -h /data -s /sbin/nologin urutau \
&& mkdir -p /data /logs \
&& mkdir -p /data \
&& chown urutau:urutau /data
COPY --from=build /out/urutau /usr/local/bin/urutau
LABEL org.opencontainers.image.title="Urutau" \
@@ -27,10 +62,7 @@ LABEL org.opencontainers.image.title="Urutau" \
org.opencontainers.image.source="https://git.lucasrguerra.dev.br/ciberfauna/urutau" \
org.opencontainers.image.licenses="MIT OR Apache-2.0"
ENV URUTAU_BIND=0.0.0.0:8790 \
URUTAU_DATA_DIR=/data \
URUTAU_TRAEFIK_LOG=/logs/traefik/access.log \
URUTAU_AUTH_LOG=/logs/host/auth.log \
URUTAU_FAIL2BAN_LOG=/logs/host/fail2ban.log
URUTAU_DATA_DIR=/data
USER urutau
WORKDIR /data
VOLUME /data
+96 -43
View File
@@ -2,7 +2,7 @@
<h1 align="center">Urutau</h1>
<p align="center">Lightweight, always-on threat intelligence and privacy-friendly web analytics for self-hosted servers.<br>Go, single static binary · local-first · authorized use.</p>
<p align="center"><a href="docs/cli.md">Terminal</a> · <a href="docs/interface.md">Interface</a> · <a href="docs/architecture.md">Architecture</a> · <a href="docs/configuration.md">Configuration</a> · <a href="docs/docker.md">Docker</a> · <a href="docs/support.md">Support</a> · <a href="ROADMAP.md">Roadmap</a> · <a href="CHANGELOG.md">Changelog</a></p>
<p align="center"><a href="docs/cli.md">Terminal</a> · <a href="docs/interface.md">Interface</a> · <a href="docs/architecture.md">Architecture</a> · <a href="docs/configuration.md">Configuration</a> · <a href="docs/docker.md">Docker</a> · <a href="docs/support.md">Support</a> · <a href="docs/migration-2.0.md">Migrating to 2.0</a> · <a href="ROADMAP.md">Roadmap</a> · <a href="CHANGELOG.md">Changelog</a></p>
<p align="center"><b>English</b> · <a href="README.pt-BR.md">Português</a></p>
@@ -14,71 +14,116 @@
<p align="center"><img src="docs/img/ip-analysis-dark.png" width="900" alt="Urutau IP analysis page: verdict, score, critical exposure and recommended actions for one attacker"><br><sub>IP analysis: verdict, evidence and recommended actions for one address.</sub></p>
**Status: stable, v1.0.0.** See [CHANGELOG.md](CHANGELOG.md) for exactly what shipped.
<p align="center"><img src="docs/img/defense-dark.png" width="900" alt="Urutau defense page with the second firewall section"><br><sub>Defense: the second firewall in observe mode, next to the host fail2ban.</sub></p>
Urutau is a small panel that runs on each of your servers (as a container), reads the logs the server already writes, and answers one question: who is attacking me right now? It classifies hostile activity, scores every source IP, keeps a rolling window on disk and serves an embedded dashboard, a JSON API and an exportable blocklist.
<p align="center"><img src="docs/img/egress-dark.png" width="900" alt="Urutau outbound traffic page: verdict, beacons, scan bursts and mining from containers"><br><sub>Outbound traffic: scan bursts, beacons and mining from containers.</sub></p>
- **Reads what already exists:** the Traefik JSON access log, `/var/log/auth.log` (sshd) and `/var/log/fail2ban.log`. No agent on the network path, no packet capture, no telemetry.
- **Classifies:** `scanner`, `exploit`, `bruteforce`, `ssh-fail`, `ssh-probe`, `ban`, plus the benign `ok`, `notfound` and `ssh-ok`.
- **Scores IPs:** every event adds weight to its source IP. A score of 10 or more is **suspicious**; **hostile** needs 50 or more **and** a strong signal (an attack tool, two or more attack categories, a ban, or a clear exploit attempt that was refused). Scanner and exploit probes that got a 2xx or 3xx answer weigh only 0.5. An IP with a successful SSH login is never hostile and never reaches the blocklist.
<p align="center"><img src="docs/img/incidents-dark.png" width="900" alt="Urutau incidents page: tickets for outbound-traffic findings"><br><sub>Incidents: every outbound finding becomes a ticket you triage.</sub></p>
<p align="center"><img src="docs/img/overview-mobile.png" height="420" alt="Urutau overview on a phone"> <img src="docs/img/defense-mobile.png" height="420" alt="Urutau defense page on a phone"><br><sub>The phone layout: a tab bar replaces the side rail and tables become cards.</sub></p>
**Status: stable, v2.0.0.** See [CHANGELOG.md](CHANGELOG.md) for exactly what shipped.
Urutau is a small hub plus one ultra-light probe per server. The probe (a container of a few MB, no open port) reads the logs the server already writes and sends them to the hub, which answers one question for the whole fleet: who is attacking me right now? It classifies hostile activity, scores every source IP, keeps 30 days on disk, serves an embedded dashboard, a JSON API and an exportable blocklist, and can decide which attackers to block (a second firewall), watch what your own containers send out (outbound traffic analysis) and turn what it finds into tickets and an HTML report.
- **Reads what already exists, through probes:** on each server the probe follows the Traefik access log (JSON, or the default text format with fewer fields), `/var/log/auth.log` (sshd) and `/var/log/fail2ban.log`. Two optional sources come from the host kit in `deploy/host`: the network probe log (new inbound connections to ports nobody listens on, each a `port-scan` event) and the outbound connection log. No agent on the network path, no packet capture, no telemetry.
- **Classifies:** `scanner`, `exploit`, `bruteforce`, `ssh-fail`, `ssh-probe`, `ban`, `port-scan`, plus the benign `ok`, `notfound` and `ssh-ok`. Browsing a public code forge (`/owner/repo/src/commit/<sha>/...`, `raw`, `blame`, `blob`, `tree` paths) is not an attack; real probes such as `/.env` or `/.git/config` still are.
- **Scores IPs:** every event adds weight to its source IP. A score of 10 or more is **suspicious**; **hostile** needs 50 or more **and** a strong signal (an attack tool, two or more attack categories, a ban, or a clear exploit attempt that was refused). Scanner and exploit probes that got a 2xx or 3xx answer weigh only 0.5. An IP with a successful SSH login is never hostile and never reaches the blocklist. Bans of the `urutau` jail (Urutau's own decisions) and of `recidive` do not count as evidence, so the system does not feed itself.
- **Second firewall (optional):** `URUTAU_ENFORCE=off|observe|on`. The hub decides which attacking addresses to block and sends each decision to the probe of the host, which appends it to a file; the host fail2ban (jail `urutau`) applies them, so Urutau needs no privileges. `observe` shows what would be blocked. See [Second firewall](#second-firewall).
- **Outbound traffic analysis (optional):** new outbound connections of the host and containers are checked for beaconing, mining, IRC and SMTP ports, contact with attackers or Tor relays, DNS outside the allowed resolvers, unauthorised scans and new countries. See [Outbound traffic and incidents](#outbound-traffic-and-incidents).
- **Incident management:** every outbound finding becomes a ticket (`INC-<n>`) with status, severity, assignee, tags, verdict, comments and history.
- **HTML report:** a printable A4 report (`/api/v1/report?format=html`): cover, executive summary in plain language, rule-based recommendations, threats, geography, errors and health, visitors, defense, second firewall and outbound traffic. The Reports page previews, downloads or prints it.
- **Tor:** the official exit and relay lists are downloaded every 6 hours (`URUTAU_TOR_AUTO`, on by default); requests from Tor exits are marked `tor`, and a workload talking to a Tor relay is a high outbound finding. `--tor-exits` adds your own file.
- **Geolocation, offline:** country, city and ASN for every IP from the free DB-IP Lite databases, downloaded and refreshed by Urutau itself, read by a built-in MMDB reader with no dependency. Nothing is looked up online.
- **Understands User-Agents:** browser, operating system, device, bots and attack tools.
- **Understands User-Agents:** browser, operating system, device, bots and attack tools. Googlebot, Bingbot and Applebot are recognized by forward-confirmed reverse DNS whatever the User-Agent says.
- **Web analytics for legitimate traffic:** unique visitors, pages, referrers, countries, browsers, devices, latency (p50 and p95) and bytes, with a world map, replacing your proxy's analytics. Separate **Threats** and **Traffic** pages.
- **Lightweight:** Go standard library only, one static binary, a soft memory limit of 256 MiB, state in a single snapshot file. No database.
- **Live dashboard:** embedded vanilla UI (English and Portuguese, light and dark), updated through Server-Sent Events, with nine pages (see below).
- **Live dashboard:** embedded vanilla UI (English and Portuguese, light and dark, with a phone layout), updated through Server-Sent Events, with 23 pages in five groups (see [Interface](#interface)).
- **Blocklist:** hostile, globally routable IPs as plain text or JSON, ready for fail2ban, ipset, nginx or a firewall. IPv6 is aggregated by /64 and exported as `x:x:x:x::/64`.
- **Federation:** one instance (the hub) aggregates others with `--peer name=url`, pulling `/api/v1/peer/export` and relaying their live events through `/api/v1/peer/stream`.
- **Probes and hub:** one hub holds the data and the dashboard; each server runs `urutau probe` (image `urutau-probe`, under 15 MB, about 20 MB of memory), which dials out over HTTPS, spools to disk if the hub is away and loses nothing. The token of each probe is stored on the hub only as a hash, and the Sources page creates, edits and revokes probes. Coming from 1.x: [docs/migration-2.0.md](docs/migration-2.0.md).
## How it works
```
Traefik access.log auth.log (sshd) fail2ban.log
│ │ │
└─────────┬───────────┴────────────────────┘
▼
tail + parse (rotation aware, bounded lines)
▼
classify ──► score per IP ──► state in memory ──► snapshot (/data)
│
┌─────────────────────────┼─────────────────────┐
▼ ▼ ▼
dashboard (SSE) /api/v1/* JSON blocklist.txt / .json
on each server: urutau probe (no open port)
Traefik access.log auth.log (sshd) fail2ban.log probe.log* egress.log*
└────────────────────┬───────────────────────────────────────┘
▼
tail (rotation aware) ──► batches ──► disk spool ──► HTTPS push ─┐
▲ │
decisions.log ◄── validated ban/unban lines ◄── long-poll ◄─────┐ │
│ │ │
host fail2ban (jail urutau) │ │
│ ▼
on the hub: urutau serve │ one node per probe
parse + classify ──► score per IP ──► state in memory ──► snapshot (/data)
│ │ │
▼ │ ▼
second firewall* ─────────────────────┘ outbound analysis ──► incident tickets
┌────────────────────────┼─────────────────────┐
▼ ▼ ▼
dashboard (SSE) /api/v1/* JSON blocklist.txt / .json
(all servers) HTML report
hub ── GET /api/v1/peer/export (peer token) ──► peer A
│ ── GET /api/v1/peer/stream (live events) ──► peer A
│ ── GET /api/v1/peer/export (peer token) ──► peer B
│ ── GET /api/v1/peer/stream (live events) ──► peer B
└──► one dashboard for the whole fleet
* optional, fed by the host kit in deploy/host
```
## Investigation
Beyond live numbers, Urutau remembers and explains. It keeps 30 days of state and an event registry on disk (`<data-dir>/events/`, capped by `--events-max`, 512 MB by default), so you can pick any period (twelve named ranges or a custom `from`/`to`), replay it, and open an IP analysis page with a verdict and its reasons, attack families, MITRE ATT&CK techniques, network type, cadence, sessions, campaigns and recommended actions, with a STIX 2.1 export. The registry holds attackers only: never the address of a legitimate visitor. See [docs/architecture.md](docs/architecture.md).
## Second firewall
Optional (`URUTAU_ENFORCE`, default `off`; `observe` decides in memory only, `on` also sends the decisions to the probes, which write them to their `URUTAU_ENFORCE_LOG`). The host kit in `deploy/host` (`install.sh --probe --enforce`) installs the fail2ban filter, action and jail `urutau`, which apply the decisions; the ban only drops connections the address starts, so replies to the server's own connections keep flowing. A decision has a reason, among them:
- a burst of attack events in 10 minutes (`--enforce-threshold`, default 5);
- `known-attacker`: an address already hostile (or suspicious with score 100 or more) is banned on its first new malicious event;
- slow attackers: 10 SSH failures (`ssh-probe` counts half) or 10 to 20 web scan/exploit events in 24 h or 7 days without a legitimate visit;
- `port-scan`: 10 distinct unserved ports in 10 minutes;
- `neighbor-campaign`: 3 or more distinct addresses of a /24 (IPv4) or /64 (IPv6) banned in the last 24 h make one attack event of another address of the prefix enough;
- a sweep every 10 minutes bans addresses active in the last 24 h that nothing blocks yet, at most `--enforce-max-per-min` (default 60) decisions per minute.
It never blocks trusted addresses, private ranges, CDN (Cloudflare) and public resolver ranges, probes, the server itself, legitimate visitors, crawlers verified by forward-confirmed reverse DNS (Googlebot, Bingbot, Applebot) or addresses you released. The Defense page shows mode, recent decisions, coverage and releases; the **Unban** button (IPs, IP analysis and Defense) asks the host, through `unban.log` next to `--enforce-log`, to lift the block and can keep the address from being banned again for 1 h, 24 h or 7 days. With `URUTAU_ENFORCE_SHARE=on` a hub and its peers exchange decisions, applied only when the receiving server also saw the address attack. Coverage counts an attacker as protected when it is listed or banned by any jail.
## Outbound traffic and incidents
Optional (`URUTAU_EGRESS=auto|on|off`; `auto` turns it on for a probe that sends the outbound log). The host kit logs only new TCP connection attempts through nftables, and a container map names the workloads. Urutau checks them for beaconing (regular conversations with one destination), mining, IRC and SMTP ports, contact with addresses that attacked the server or with Tor relays, DNS outside the allowed resolvers (`URUTAU_EGRESS_RESOLVERS`), unauthorised outbound scans and new countries. Workloads are defined by network or container name (`URUTAU_EGRESS_WORKLOADS`); a `scanner` workload (an authorised surface scanner) has only its scan-shaped traffic summarised, everything else is judged like any other workload. The servers themselves, peers and the host's own provider never raise findings, cloud metadata services polled by the host are `infra`, and regular connections to large CDNs and clouds are low severity, and they never raise a new country (their database country means nothing for anycast).
Every finding above info severity becomes a ticket `INC-<n>` (list, ticket page, manual tickets, CSV export, `/api/v1/incidents`). A ticket marked `false_positive` or `benign` can suppress findings with exactly its key; a resolved ticket reopens if the finding comes back.
## Interface
Pages are grouped in a side rail, with the view kept in the URL hash. A "?" button next to metrics and categories explains what they mean and what to do.
Pages are grouped in a side rail (a tab bar on phones), with the view kept in the URL hash. A "?" button next to metrics and categories explains what they mean and what to do.
- **Monitor:** Overview (headline numbers, timeline, top IPs; a period selector applies everywhere), Live (attacks as animated arcs on a flat map or a 3D globe, including your peers; `--location` sets where this server sits on the map), Services (SLO, error budget and Apdex per service).
- **Investigate:** IPs (the scored table and the IP analysis page, `#/ip/<ip>`), Sessions, Campaigns, Replay (a period played back on the map) and Event search.
- **Analyze:** Threats, MITRE ATT&CK, Geography (country, state, city, `#/geo/BR/Pernambuco/Recife`), Evolution, Concentration, Survival (time to ban), Traffic (privacy-friendly analytics for legitimate visitors), Where errors come from (app, proxy, blocked, attack, bot, client) and Protocols and TLS.
- **Operate:** Defense, Sources and hosts (log sources, peers and the blocklist) and Integrity.
- **Reports.**
- **Monitor:** Overview (headline numbers, timeline, top IPs; a period selector applies everywhere), Live (attacks as animated arcs on a flat map or a 3D globe, from every probe; each probe's location is set on the Sources page), Services (SLO, error budget, burn rate and Apdex per service).
- **Investigate:** IPs (the scored table and the IP analysis page, `#/ip/<ip>`), Sessions, Campaigns, Replay (a period played back on the map), Event search, Incidents (tickets for outbound findings) and Outbound traffic.
- **Analyze:** Threats, MITRE ATT&CK, Geography (country, state, city, `#/geo/BR/Pernambuco/Recife`), Evolution, Concentration, Survival (time to ban), Traffic (privacy-friendly analytics for legitimate visitors), Where errors come from (app, proxy, blocked, attack, bot, client, unknown) and Protocols and TLS.
- **Operate:** Defense (ban and blocklist coverage, second firewall, Unban), Sources and hosts (probes, their log sources and the blocklist) and Integrity (health of sources, registry and snapshot).
- **Reports:** the HTML report of a period.
See [docs/interface.md](docs/interface.md).
On phones, plain data tables become stacked cards, so nothing scrolls sideways. See [docs/interface.md](docs/interface.md) for every page with screenshots and the HTTP routes.
## Install
Run it with Docker Compose (recommended):
Two images from one Dockerfile: the **hub** (`urutau`) once, and the **probe** (`urutau-probe`) on every server you want to watch. With Docker Compose (recommended), first the hub:
```bash
cp .env.example .env
# set URUTAU_TOKEN (32+ characters, 128+ bits of entropy; `openssl rand -base64 48` works):
sed -i "s|^URUTAU_TOKEN=.*|URUTAU_TOKEN=$(openssl rand -base64 48 | tr -d '\n')|" .env
docker compose pull && docker compose up -d
docker compose exec urutau urutau probes create web1 # prints the probe token ONCE
```
The dashboard answers at `http://127.0.0.1:8790` and asks for the token. The image is public: `docker pull git.lucasrguerra.dev.br/ciberfauna/urutau:latest`. Or build it locally with `docker compose up -d --build`.
Then on each monitored server (after `sudo sh deploy/host/install.sh --probe`, see [docs/docker.md](docs/docker.md)):
```bash
cd deploy/probe && cp .env.example .env
# set URUTAU_HUB=https://urutau.example.com URUTAU_PROBE_NAME=web1 URUTAU_PROBE_TOKEN=urp_...
docker compose up -d
```
The dashboard answers at `http://127.0.0.1:8790` and asks for the token; the Sources page shows the probe connected. The images are public: `docker pull git.lucasrguerra.dev.br/ciberfauna/urutau:latest` and `.../urutau-probe:latest`. Or build locally with `docker compose up -d --build`.
To compile from source (Go 1.26.11 or newer, no dependency to fetch):
@@ -92,14 +137,18 @@ Supported platform matrix for container images: `linux/amd64` and `linux/arm64`.
## Getting started
```bash
# Check the sources and the data directory
# Check the data directory and the probes
urutau doctor
# Run the daemon and the dashboard
# Run the hub (dashboard, API, probe ingestion)
urutau serve --bind 127.0.0.1:8790
# Aggregate other instances
urutau serve --peer web1=https://urutau.web1.example --peer-token "$URUTAU_PEER_TOKEN"
# Register a probe and run it on the server to watch
urutau probes create web1
URUTAU_HUB=https://urutau.example.com URUTAU_PROBE_NAME=web1 URUTAU_PROBE_TOKEN=urp_... urutau probe
# Bring a 1.x data directory in, losing nothing
urutau import --from /backup/data --host old-server
```
See [docs/cli.md](docs/cli.md) for the command reference and [docs/configuration.md](docs/configuration.md) for every `URUTAU_*` variable.
@@ -166,7 +215,7 @@ The list only holds globally routable addresses, never anything in `--ignore` or
## Security
Urutau handles hostile text by design. Every field it reads from a log (paths, User-Agents, user names, hosts) was written by an attacker: it is length-limited, never executed and always escaped before it reaches the page. The dashboard and the API require a token (`URUTAU_TOKEN`, at least 32 characters, e.g. `openssl rand -base64 48`), the session cookie is `HttpOnly` and `SameSite=Strict`, failed logins are rate limited per IP, and the peer token only opens `GET /api/v1/peer/export`. Put it behind a reverse proxy with TLS before exposing it. See [SECURITY.md](SECURITY.md).
Urutau handles hostile text by design. Every field it reads from a log (paths, User-Agents, user names, hosts) was written by an attacker: it is length-limited, never executed and always escaped before it reaches the page. The dashboard and the API require a token (`URUTAU_TOKEN`, at least 32 characters, e.g. `openssl rand -base64 48`), the session cookie is `HttpOnly` and `SameSite=Strict`, failed logins are rate limited per IP, each probe token (stored only as a hash on the hub) opens only the three probe routes, and the probe itself opens no port and writes only lines that pass a strict format check. Put it behind a reverse proxy with TLS before exposing it. See [SECURITY.md](SECURITY.md).
## Authorized use
@@ -184,10 +233,12 @@ See **[CONTRIBUTING.md](CONTRIBUTING.md)** and **[docs/architecture.md](docs/arc
## Known limits
- Only three sources: Traefik JSON access log, sshd lines from `auth.log` (ISO timestamps) and `fail2ban.log`.
- State is kept for 30 days at most (`--retention`), with up to 20,000 tracked IPs; the event registry is capped by `--events-max`.
- The dashboard login is a single shared token; there are no user accounts.
- Scores are heuristics, not proof of malicious intent.
- Sources (read by the probes): Traefik access log (JSON or default text format), sshd lines from `auth.log` (ISO timestamps), `fail2ban.log`, and the optional port-probe and outbound connection logs written by the host kit.
- The probe needs the hub reachable over HTTPS (plain HTTP only for private addresses); it spools up to `URUTAU_PROBE_SPOOL_MAX` (64 MiB) while the hub is away and drops the oldest batches beyond that, counting them.
- State is kept for 30 days at most (`--retention`), with up to 20,000 tracked IPs; the event registry is capped by `--events-max`; incidents hold up to 5000 tickets.
- The dashboard login is a single shared token; there are no user accounts, and a ticket author is a free-text name.
- Scores and second firewall decisions are heuristics, not proof of malicious intent. Start with `observe`.
- Outbound analysis and the second firewall need the host kit (nftables, rsyslog, fail2ban); without it those pages stay empty.
## Where it's going
@@ -197,6 +248,8 @@ Summary of the [ROADMAP](ROADMAP.md):
|---|---|
| **Done (1.0.0)** | Log collection, classification and scoring, offline geolocation, User-Agent parsing, privacy-friendly web analytics, snapshot persistence, dashboard with SSE, token login, blocklist, federation, Docker image and CI/CD |
| **Done (1.2.0)** | 30-day retention, any period, on-disk event registry, replay, IP analysis with verdict, MITRE ATT&CK, campaigns, STIX 2.1 and stable metrics |
| **Done (1.4.0 to 1.6.0)** | Second firewall with Unban and decision sharing, outbound traffic analysis, incident management, HTML report, Tor lists, network probes, text-format Traefik logs, verified crawlers and forge browsing recognized, phone layout |
| **Done (2.0.0)** | Hub and ultra-light probes (own image), HTTPS ingestion with disk spool, per-probe tokens, enforce decisions through the probes, `urutau import` for 1.x data |
| **Next** | More log sources, webhook alerts, Prometheus metrics |
| **Later** | IP reputation enrichment |
| **Not planned** | Active scanning or counterattack, mandatory cloud services, telemetry |
+96 -43
View File
@@ -2,7 +2,7 @@
<h1 align="center">Urutau</h1>
<p align="center">Threat intelligence leve e sempre ligado e web analytics amigável à privacidade para servidores self-hosted.<br>Go, binário estático único · local-first · uso autorizado.</p>
<p align="center"><a href="docs/pt-BR/cli.md">Terminal</a> · <a href="docs/pt-BR/interface.md">Interface</a> · <a href="docs/pt-BR/arquitetura.md">Arquitetura</a> · <a href="docs/pt-BR/configuracao.md">Configuração</a> · <a href="docs/pt-BR/docker.md">Docker</a> · <a href="docs/pt-BR/suporte.md">Suporte</a> · <a href="ROADMAP.pt-BR.md">Roadmap</a> · <a href="CHANGELOG.pt-BR.md">Changelog</a></p>
<p align="center"><a href="docs/pt-BR/cli.md">Terminal</a> · <a href="docs/pt-BR/interface.md">Interface</a> · <a href="docs/pt-BR/arquitetura.md">Arquitetura</a> · <a href="docs/pt-BR/configuracao.md">Configuração</a> · <a href="docs/pt-BR/docker.md">Docker</a> · <a href="docs/pt-BR/suporte.md">Suporte</a> · <a href="docs/pt-BR/migracao-2.0.md">Migrar para a 2.0</a> · <a href="ROADMAP.pt-BR.md">Roadmap</a> · <a href="CHANGELOG.pt-BR.md">Changelog</a></p>
<p align="center"><a href="README.md">English</a> · <b>Português</b></p>
@@ -14,71 +14,116 @@
<p align="center"><img src="docs/img/ip-analysis-dark-pt.png" width="900" alt="Página de análise de IP do Urutau: veredito, pontuação, exposição crítica e ações recomendadas para um atacante"><br><sub>Análise de IP: veredito, evidências e ações recomendadas para um endereço.</sub></p>
**Status: estável, v1.0.0.** Veja o [CHANGELOG.pt-BR.md](CHANGELOG.pt-BR.md) para saber exatamente o que foi entregue.
<p align="center"><img src="docs/img/defense-dark-pt.png" width="900" alt="Página Defesa do Urutau com a seção do segundo firewall"><br><sub>Defesa: o segundo firewall em modo observe, ao lado do fail2ban do host.</sub></p>
O Urutau é um painel pequeno que roda em cada um dos seus servidores (como container), lê os logs que o servidor já escreve e responde a uma pergunta: quem está me atacando agora? Ele classifica a atividade hostil, pontua cada IP de origem, mantém uma janela móvel em disco e serve um dashboard embutido, uma API JSON e uma blocklist exportável.
<p align="center"><img src="docs/img/egress-dark-pt.png" width="900" alt="Página Tráfego de saída do Urutau: veredito, beacons, rajadas de varredura e mineração em contêineres"><br><sub>Tráfego de saída: rajadas de varredura, beacons e mineração em contêineres.</sub></p>
- **Lê o que já existe:** o access log JSON do Traefik, `/var/log/auth.log` (sshd) e `/var/log/fail2ban.log`. Sem agente no caminho da rede, sem captura de pacotes, sem telemetria.
- **Classifica:** `scanner`, `exploit`, `bruteforce`, `ssh-fail`, `ssh-probe`, `ban`, além dos benignos `ok`, `notfound` e `ssh-ok`.
- **Pontua IPs:** cada evento soma peso ao IP de origem. Pontuação 10 ou mais é **suspeito**; **hostil** exige 50 ou mais **e** um sinal forte (uma ferramenta de ataque, duas ou mais categorias de ataque, um ban ou uma tentativa clara de exploit recusada). Sondas de scanner e exploit que receberam resposta 2xx ou 3xx pesam só 0,5. Um IP com login SSH bem-sucedido nunca é hostil e nunca vai para a blocklist.
<p align="center"><img src="docs/img/incidents-dark-pt.png" width="900" alt="Página Incidentes do Urutau: chamados para achados do tráfego de saída"><br><sub>Incidentes: cada achado de saída vira um chamado que você tria.</sub></p>
<p align="center"><img src="docs/img/overview-mobile.png" height="420" alt="Visão geral do Urutau no celular"> <img src="docs/img/defense-mobile.png" height="420" alt="Página Defesa do Urutau no celular"><br><sub>O layout de celular: uma barra de abas substitui a lateral e as tabelas viram cartões.</sub></p>
**Status: estável, v2.0.0.** Veja o [CHANGELOG.pt-BR.md](CHANGELOG.pt-BR.md) para saber exatamente o que foi entregue.
O Urutau é um hub mais uma sonda ultraleve por servidor. A sonda (um container de poucos MB, sem porta aberta) lê os logs que o servidor já escreve e os envia ao hub, que responde a uma pergunta para toda a frota: quem está me atacando agora? Ele classifica a atividade hostil, pontua cada IP de origem, guarda 30 dias em disco, serve um dashboard embutido, uma API JSON e uma blocklist exportável, e ainda pode decidir quais atacantes bloquear (um segundo firewall), vigiar o que seus próprios contêineres enviam para fora (análise de tráfego de saída) e transformar o que encontra em chamados e num relatório HTML.
- **Lê o que já existe, por meio das sondas:** em cada servidor a sonda acompanha o access log do Traefik (JSON, ou o formato texto padrão, com menos campos), `/var/log/auth.log` (sshd) e `/var/log/fail2ban.log`. Duas fontes opcionais vêm do kit de host em `deploy/host`: o log de sondagens de rede (novas conexões de entrada a portas em que ninguém escuta, cada uma um evento `port-scan`) e o log de conexões de saída. Sem agente no caminho da rede, sem captura de pacotes, sem telemetria.
- **Classifica:** `scanner`, `exploit`, `bruteforce`, `ssh-fail`, `ssh-probe`, `ban`, `port-scan`, além dos benignos `ok`, `notfound` e `ssh-ok`. Navegar num forge de código público (caminhos `/owner/repo/src/commit/<sha>/...`, `raw`, `blame`, `blob`, `tree`) não é ataque; sondas reais como `/.env` ou `/.git/config` continuam sendo.
- **Pontua IPs:** cada evento soma peso ao IP de origem. Pontuação 10 ou mais é **suspeito**; **hostil** exige 50 ou mais **e** um sinal forte (uma ferramenta de ataque, duas ou mais categorias de ataque, um ban ou uma tentativa clara de exploit recusada). Sondas de scanner e exploit que receberam resposta 2xx ou 3xx pesam só 0,5. Um IP com login SSH bem-sucedido nunca é hostil e nunca vai para a blocklist. Bans da jail `urutau` (decisões do próprio Urutau) e da `recidive` não contam como evidência, para o sistema não se alimentar de si mesmo.
- **Segundo firewall (opcional):** `URUTAU_ENFORCE=off|observe|on`. O hub decide quais endereços atacantes bloquear e envia cada decisão à sonda do host, que a grava num arquivo; o fail2ban do host (jail `urutau`) as aplica, então o Urutau não precisa de privilégios. `observe` mostra o que seria bloqueado. Veja [Segundo firewall](#segundo-firewall).
- **Análise de tráfego de saída (opcional):** as novas conexões de saída do host e dos contêineres são checadas quanto a beaconing, mineração, portas de IRC e SMTP, contato com atacantes ou relays Tor, DNS fora dos resolvers permitidos, varreduras não autorizadas e países novos. Veja [Tráfego de saída e incidentes](#tráfego-de-saída-e-incidentes).
- **Gestão de incidentes:** cada achado de saída vira um chamado (`INC-<n>`) com status, severidade, responsável, tags, conclusão, comentários e histórico.
- **Relatório HTML:** um relatório A4 imprimível (`/api/v1/report?format=html`): capa, resumo executivo em linguagem simples, recomendações por regras, ameaças, geografia, erros e saúde, visitantes, defesa, segundo firewall e tráfego de saída. A página Relatórios mostra uma prévia, baixa ou imprime.
- **Tor:** as listas oficiais de saída e de relays são baixadas a cada 6 horas (`URUTAU_TOR_AUTO`, ligado por padrão); requisições de saídas Tor são marcadas `tor`, e um workload falando com um relay Tor é um achado de saída alto. `--tor-exits` soma um arquivo seu.
- **Geolocalização offline:** país, cidade e ASN de todo IP a partir das bases gratuitas DB-IP Lite, baixadas e atualizadas pelo próprio Urutau, lidas por um leitor MMDB embutido e sem dependências. Nada é consultado online.
- **Entende User-Agents:** navegador, sistema operacional, dispositivo, bots e ferramentas de ataque.
- **Entende User-Agents:** navegador, sistema operacional, dispositivo, bots e ferramentas de ataque. Googlebot, Bingbot e Applebot são reconhecidos por DNS reverso confirmado, seja qual for o User-Agent declarado.
- **Web analytics do tráfego legítimo:** visitantes únicos, páginas, referrers, países, navegadores, dispositivos, latência (p50 e p95) e bytes, com mapa-múndi, no lugar do analytics do seu proxy. Páginas **Ameaças** e **Tráfego** separadas.
- **Leve:** só biblioteca padrão do Go, um binário estático, limite suave de memória de 256 MiB, estado em um único arquivo de snapshot. Sem banco de dados.
- **Dashboard ao vivo:** UI vanilla embutida (inglês e português, claro e escuro), atualizada por Server-Sent Events, com nove páginas (veja abaixo).
- **Dashboard ao vivo:** UI vanilla embutida (inglês e português, claro e escuro, com layout para celular), atualizada por Server-Sent Events, com 23 páginas em cinco grupos (veja [Interface](#interface)).
- **Blocklist:** IPs hostis e globalmente roteáveis em texto ou JSON, prontos para fail2ban, ipset, nginx ou firewall. O IPv6 é agregado por /64 e exportado como `x:x:x:x::/64`.
- **Federação:** uma instância (o hub) agrega outras com `--peer nome=url`, puxando `/api/v1/peer/export` e repassando os eventos ao vivo deles por `/api/v1/peer/stream`.
- **Sondas e hub:** um hub guarda os dados e o dashboard; cada servidor roda `urutau probe` (imagem `urutau-probe`, abaixo de 15 MB, cerca de 20 MB de memória), que conecta de dentro para fora por HTTPS, guarda em disco se o hub sumir e não perde nada. O token de cada sonda fica no hub só como hash, e a página Fontes cria, edita e revoga sondas. Vindo da 1.x: [docs/pt-BR/migracao-2.0.md](docs/pt-BR/migracao-2.0.md).
## Como funciona
```
access.log do Traefik auth.log (sshd) fail2ban.log
│ │ │
└─────────┬───────────┴────────────────────┘
▼
tail + parse (tolera rotação, linhas limitadas)
▼
classifica ──► pontua por IP ──► estado em memória ──► snapshot (/data)
│
┌───────────────────────────┼─────────────────────┐
▼ ▼ ▼
dashboard (SSE) /api/v1/* JSON blocklist.txt / .json
em cada servidor: urutau probe (sem porta aberta)
access.log Traefik auth.log (sshd) fail2ban.log probe.log* egress.log*
└────────────────────┬───────────────────────────────────────┘
▼
tail (ciente de rotação) ──► lotes ──► spool em disco ──► push HTTPS ─┐
▲ │
decisions.log ◄── linhas de ban/unban validadas ◄── long-poll ◄────┐ │
│ │ │
fail2ban do host (jail urutau) │ │
│ ▼
no hub: urutau serve │ um nó por sonda
parse + classificação ──► score por IP ──► estado em memória ──► snapshot (/data)
│ │ │
▼ │ ▼
segundo firewall* ──────────────────────┘ análise de saída ──► tickets de incidente
┌────────────────────────┼─────────────────────┐
▼ ▼ ▼
dashboard (SSE) JSON /api/v1/* blocklist.txt / .json
(todos os servidores) relatório HTML
hub ── GET /api/v1/peer/export (token de peer) ──► peer A
│ ── GET /api/v1/peer/stream (eventos ao vivo) ──► peer A
│ ── GET /api/v1/peer/export (token de peer) ──► peer B
│ ── GET /api/v1/peer/stream (eventos ao vivo) ──► peer B
└──► um dashboard para a frota inteira
* opcional, alimentado pelo kit de host em deploy/host
```
## Investigação
Além dos números ao vivo, o Urutau lembra e explica. Ele guarda 30 dias de estado e um registro de eventos em disco (`<data-dir>/events/`, limitado por `--events-max`, 512 MB por padrão), então você pode escolher qualquer período (doze intervalos nomeados ou um `from`/`to` personalizado), reproduzi-lo e abrir uma página de análise de IP com um veredito e suas razões, famílias de ataque, técnicas MITRE ATT&CK, tipo de rede, cadência, sessões, campanhas e ações recomendadas, com exportação STIX 2.1. O registro guarda só atacantes: nunca o endereço de um visitante legítimo. Veja [docs/pt-BR/arquitetura.md](docs/pt-BR/arquitetura.md).
## Segundo firewall
Opcional (`URUTAU_ENFORCE`, padrão `off`; `observe` decide só em memória, `on` também envia as decisões às sondas, que as gravam no `URUTAU_ENFORCE_LOG` delas). O kit de host em `deploy/host` (`install.sh --probe --enforce`) instala o filtro, a ação e a jail `urutau` do fail2ban, que aplicam as decisões; o ban só derruba conexões que o endereço inicia, então as respostas às conexões do próprio servidor continuam fluindo. Cada decisão tem um motivo, entre eles:
- uma rajada de eventos de ataque em 10 minutos (`--enforce-threshold`, padrão 5);
- `known-attacker`: um endereço já hostil (ou suspeito com pontuação 100 ou mais) é banido no primeiro novo evento malicioso;
- atacantes lentos: 10 falhas de SSH (`ssh-probe` conta metade) ou 10 a 20 eventos de scan/exploit web em 24 h ou 7 dias sem uma visita legítima;
- `port-scan`: 10 portas sem serviço distintas em 10 minutos;
- `neighbor-campaign`: 3 ou mais endereços distintos de um /24 (IPv4) ou /64 (IPv6) banidos nas últimas 24 h fazem um evento de ataque de outro endereço do prefixo bastar;
- uma varredura a cada 10 minutos bane endereços ativos nas últimas 24 h que nada bloqueia ainda, no máximo `--enforce-max-per-min` (padrão 60) decisões por minuto.
Nunca bloqueia endereços confiáveis, faixas privadas, faixas de CDN (Cloudflare) e de resolvers públicos, sondas, o próprio servidor, visitantes legítimos, crawlers verificados por DNS reverso confirmado (Googlebot, Bingbot, Applebot) nem endereços que você liberou. A página Defesa mostra modo, decisões recentes, cobertura e liberações; o botão **Desbanir** (IPs, análise de IP e Defesa) pede ao host, por `unban.log` ao lado de `--enforce-log`, que levante o bloqueio e pode impedir novo ban do endereço por 1 h, 24 h ou 7 dias. Com `URUTAU_ENFORCE_SHARE=on` um hub e seus peers trocam decisões, aplicadas só quando o servidor receptor também viu o endereço atacar. A cobertura conta um atacante como protegido quando ele está listado ou banido por qualquer jail.
## Tráfego de saída e incidentes
Opcional (`URUTAU_EGRESS=auto|on|off`; `auto` liga para a sonda que envia o log de saída). O kit de host registra, pelo nftables, só tentativas novas de conexão TCP, e um mapa de contêineres nomeia os workloads. O Urutau checa beaconing (conversas regulares com um destino), mineração, portas de IRC e SMTP, contato com endereços que atacaram o servidor ou com relays Tor, DNS fora dos resolvers permitidos (`URUTAU_EGRESS_RESOLVERS`), varreduras de saída não autorizadas e países novos. Os workloads são definidos por nome de rede ou de contêiner (`URUTAU_EGRESS_WORKLOADS`); um workload `scanner` (um scanner de superfície autorizado) tem só o tráfego em forma de varredura resumido, o resto é julgado como qualquer outro workload. Os próprios servidores, peers e o provedor do host nunca geram achados, serviços de metadados de nuvem consultados pelo host são `infra`, e conexões regulares a grandes CDNs e nuvens têm severidade baixa e nunca geram país novo (o país da base nada diz sobre anycast).
Todo achado acima de info vira um chamado `INC-<n>` (lista, página do chamado, chamados manuais, exportação CSV, `/api/v1/incidents`). Um chamado marcado `false_positive` ou `benign` pode suprimir achados com exatamente a sua chave; um chamado resolvido reabre se o achado voltar.
## Interface
As páginas são agrupadas numa barra lateral, com a visão guardada no hash da URL. Um botão "?" ao lado de métricas e categorias explica o que significam e o que fazer.
As páginas são agrupadas numa barra lateral (barra de abas no celular), com a visão guardada no hash da URL. Um botão "?" ao lado de métricas e categorias explica o que significam e o que fazer.
- **Monitorar:** Visão geral (números principais, linha do tempo, principais IPs; um seletor de período vale em todo lugar), Ao vivo (ataques como arcos animados em mapa plano ou globo 3D, incluindo seus peers; `--location` define onde este servidor fica no mapa), Serviços (SLO, orçamento de erro e Apdex por serviço).
- **Investigar:** IPs (a tabela pontuada e a página de análise de IP, `#/ip/<ip>`), Sessões, Campanhas, Replay (um período reproduzido no mapa) e Busca de eventos.
- **Analisar:** Ameaças, MITRE ATT&CK, Geografia (país, estado, cidade, `#/geo/BR/Pernambuco/Recife`), Evolução, Concentração, Sobrevivência (tempo até o ban), Tráfego (analytics amigável à privacidade para visitantes legítimos), De onde vêm os erros (app, proxy, blocked, attack, bot, client) e Protocolos e TLS.
- **Operar:** Defesa, Fontes e hosts (fontes de log, peers e a blocklist) e Integridade.
- **Relatórios.**
- **Monitorar:** Visão geral (números principais, linha do tempo, principais IPs; um seletor de período vale em todo lugar), Ao vivo (ataques como arcos animados em mapa plano ou globo 3D, de todas as sondas; a localização de cada sonda é definida na página Fontes), Serviços (SLO, orçamento de erro, burn rate e Apdex por serviço).
- **Investigar:** IPs (a tabela pontuada e a página de análise de IP, `#/ip/<ip>`), Sessões, Campanhas, Replay (um período reproduzido no mapa), Busca de eventos, Incidentes (chamados dos achados de saída) e Tráfego de saída.
- **Analisar:** Ameaças, MITRE ATT&CK, Geografia (país, estado, cidade, `#/geo/BR/Pernambuco/Recife`), Evolução, Concentração, Sobrevivência (tempo até o ban), Tráfego (analytics amigável à privacidade para visitantes legítimos), De onde vêm os erros (app, proxy, blocked, attack, bot, client, unknown) e Protocolos e TLS.
- **Operar:** Defesa (cobertura de bans e da blocklist, segundo firewall, Desbanir), Fontes e hosts (sondas, suas fontes de log e a blocklist) e Integridade (saúde das fontes, do registro e do snapshot).
- **Relatórios:** o relatório HTML de um período.
Veja [docs/pt-BR/interface.md](docs/pt-BR/interface.md).
No celular, tabelas de dados simples viram cartões empilhados, e nada rola para o lado. Veja [docs/pt-BR/interface.md](docs/pt-BR/interface.md) para cada página com capturas de tela e as rotas HTTP.
## Instalação
Rode com Docker Compose (recomendado):
Duas imagens a partir de um só Dockerfile: o **hub** (`urutau`), uma vez, e a **sonda** (`urutau-probe`) em cada servidor que você quer vigiar. Com Docker Compose (recomendado), primeiro o hub:
```bash
cp .env.example .env
# defina URUTAU_TOKEN (32+ caracteres, 128+ bits de entropia; `openssl rand -base64 48` serve):
sed -i "s|^URUTAU_TOKEN=.*|URUTAU_TOKEN=$(openssl rand -base64 48 | tr -d '\n')|" .env
docker compose pull && docker compose up -d
docker compose exec urutau urutau probes create web1 # mostra o token da sonda UMA vez
```
O dashboard responde em `http://127.0.0.1:8790` e pede o token. A imagem é pública: `docker pull git.lucasrguerra.dev.br/ciberfauna/urutau:latest`. Ou construa localmente com `docker compose up -d --build`.
Depois, em cada servidor monitorado (após `sudo sh deploy/host/install.sh --probe`, veja [docs/pt-BR/docker.md](docs/pt-BR/docker.md)):
```bash
cd deploy/probe && cp .env.example .env
# defina URUTAU_HUB=https://urutau.example.com URUTAU_PROBE_NAME=web1 URUTAU_PROBE_TOKEN=urp_...
docker compose up -d
```
O dashboard responde em `http://127.0.0.1:8790` e pede o token; a página Fontes mostra a sonda conectada. As imagens são públicas: `docker pull git.lucasrguerra.dev.br/ciberfauna/urutau:latest` e `.../urutau-probe:latest`. Ou construa localmente com `docker compose up -d --build`.
Para compilar do código-fonte (Go 1.26.11 ou mais novo, sem dependência para baixar):
@@ -92,14 +137,18 @@ Matriz de plataformas das imagens: `linux/amd64` e `linux/arm64`. Veja [docs/pt-
## Primeiros passos
```bash
# Confira as fontes e o diretório de dados
# Confira o diretório de dados e as sondas
urutau doctor
# Rode o daemon e o dashboard
# Rode o hub (dashboard, API, recepção das sondas)
urutau serve --bind 127.0.0.1:8790
# Agregue outras instâncias
urutau serve --peer web1=https://urutau.web1.example --peer-token "$URUTAU_PEER_TOKEN"
# Cadastre uma sonda e rode-a no servidor a vigiar
urutau probes create web1
URUTAU_HUB=https://urutau.example.com URUTAU_PROBE_NAME=web1 URUTAU_PROBE_TOKEN=urp_... urutau probe
# Traga um diretório de dados da 1.x, sem perder nada
urutau import --from /backup/data --host servidor-antigo
```
Veja [docs/pt-BR/cli.md](docs/pt-BR/cli.md) para a referência de comandos e [docs/pt-BR/configuracao.md](docs/pt-BR/configuracao.md) para cada variável `URUTAU_*`.
@@ -166,7 +215,7 @@ A lista só traz endereços globalmente roteáveis, nunca algo em `--ignore` ou
## Segurança
O Urutau lida com texto hostil por definição. Todo campo que ele lê de um log (caminhos, User-Agents, nomes de usuário, hosts) foi escrito por um atacante: é limitado em tamanho, nunca executado e sempre escapado antes de chegar à página. O dashboard e a API exigem token (`URUTAU_TOKEN`, no mínimo 32 caracteres, por exemplo `openssl rand -base64 48`), o cookie de sessão é `HttpOnly` e `SameSite=Strict`, logins errados têm limite de tentativas por IP, e o token de peer só abre `GET /api/v1/peer/export`. Coloque-o atrás de um proxy reverso com TLS antes de expor. Veja [SECURITY.pt-BR.md](SECURITY.pt-BR.md).
O Urutau lida com texto hostil por definição. Todo campo que ele lê de um log (caminhos, User-Agents, nomes de usuário, hosts) foi escrito por um atacante: é limitado em tamanho, nunca executado e sempre escapado antes de chegar à página. O dashboard e a API exigem token (`URUTAU_TOKEN`, no mínimo 32 caracteres, por exemplo `openssl rand -base64 48`), o cookie de sessão é `HttpOnly` e `SameSite=Strict`, logins errados têm limite de tentativas por IP, e o token de cada sonda (guardado só como hash no hub) abre apenas as três rotas de sonda; a própria sonda não abre porta e só grava linhas que passam por uma checagem rígida de formato. Coloque-o atrás de um proxy reverso com TLS antes de expor. Veja [SECURITY.pt-BR.md](SECURITY.pt-BR.md).
## Uso autorizado
@@ -184,10 +233,12 @@ Veja **[CONTRIBUTING.pt-BR.md](CONTRIBUTING.pt-BR.md)** e **[docs/pt-BR/arquitet
## Limites conhecidos
- Só três fontes: access log JSON do Traefik, linhas do sshd no `auth.log` (timestamps ISO) e `fail2ban.log`.
- O estado é mantido por no máximo 30 dias (`--retention`), com até 20.000 IPs rastreados; o registro de eventos é limitado por `--events-max`.
- O login do dashboard é um token único compartilhado; não há contas de usuário.
- Pontuações são heurísticas, não prova de intenção maliciosa.
- Fontes (lidas pelas sondas): access log do Traefik (JSON ou formato texto padrão), linhas do sshd no `auth.log` (timestamps ISO), `fail2ban.log` e os logs opcionais de sondagens e de conexões de saída escritos pelo kit de host.
- A sonda precisa alcançar o hub por HTTPS (HTTP puro só para endereços privados); ela guarda até `URUTAU_PROBE_SPOOL_MAX` (64 MiB) em disco enquanto o hub está fora e descarta os lotes mais antigos além disso, contando-os.
- O estado é mantido por no máximo 30 dias (`--retention`), com até 20.000 IPs rastreados; o registro de eventos é limitado por `--events-max`; os incidentes comportam até 5000 chamados.
- O login do dashboard é um token único compartilhado; não há contas de usuário, e o autor de um chamado é um nome em texto livre.
- Pontuações e decisões do segundo firewall são heurísticas, não prova de intenção maliciosa. Comece por `observe`.
- A análise de saída e o segundo firewall precisam do kit de host (nftables, rsyslog, fail2ban); sem ele essas páginas ficam vazias.
## Para onde vai
@@ -197,6 +248,8 @@ Resumo do [ROADMAP](ROADMAP.pt-BR.md):
|---|---|
| **Feito (1.0.0)** | Coleta de logs, classificação e pontuação, geolocalização offline, parse de User-Agent, web analytics amigável à privacidade, snapshot em disco, dashboard com SSE, login por token, blocklist, federação, imagem Docker e CI/CD |
| **Feito (1.2.0)** | Retenção de 30 dias, qualquer período, registro de eventos em disco, replay, análise de IP com veredito, MITRE ATT&CK, campanhas, STIX 2.1 e métricas estáveis |
| **Feito (1.4.0 a 1.6.0)** | Segundo firewall com Desbanir e compartilhamento de decisões, análise de tráfego de saída, gestão de incidentes, relatório HTML, listas Tor, sondagens de rede, logs de texto do Traefik, crawlers verificados e navegação em forge reconhecidos, layout de celular |
| **Feito (2.0.0)** | Hub e sondas ultraleves (imagem própria), recepção por HTTPS com spool em disco, token por sonda, decisões do enforce pelas sondas, `urutau import` para dados da 1.x |
| **Próximo** | Mais fontes de log, alertas por webhook, métricas Prometheus |
| **Depois** | Enriquecimento com reputação de IP |
| **Fora do plano** | Varredura ativa ou contra-ataque, serviços de nuvem obrigatórios, telemetria |
+14 -2
View File
@@ -2,7 +2,7 @@
**English** · [Português](ROADMAP.pt-BR.md)
Urutau is lightweight, always-on threat intelligence for self-hosted servers: it reads the logs your server already writes, classifies hostile activity, scores IPs and exports a blocklist. Always read-only toward the network, with no telemetry.
Urutau is lightweight, always-on threat intelligence for self-hosted servers: a hub plus an ultra-light probe on each server, which read the logs your servers already write, classifies hostile activity, scores IPs and exports a blocklist. It never sends traffic to the IPs it lists and has no telemetry; the optional second firewall only makes the probe write a file that a host jail reads.
## Done
@@ -11,7 +11,7 @@ Urutau is lightweight, always-on threat intelligence for self-hosted servers: it
- **Persistence (1.0.0):** a 7-day rolling state saved to a snapshot with the file offsets, so a restart never replays a log.
- **Dashboard and API (1.0.0):** embedded bilingual UI with live updates over SSE, token login, JSON API, IP detail.
- **Blocklist (1.0.0):** text and JSON export with a score threshold.
- **Federation (1.0.0):** a hub aggregates peers through `/api/v1/peer/export` with a separate peer token that opens nothing else.
- **Federation (1.0.0, replaced by probes in 2.0.0):** a hub aggregated peers through `/api/v1/peer/export` with a separate peer token.
- **Geolocation and web analytics (1.0.0):** offline DB-IP Lite geolocation, User-Agent parsing and privacy-friendly traffic analytics.
- **Noise filters (1.0.0):** trusted CIDRs and monitoring User-Agents.
- **Container and CI/CD (1.0.0):** multi-arch image, Coolify deployment, Gitea CI with an image-reuse release workflow, weekly audit.
@@ -21,6 +21,18 @@ Urutau is lightweight, always-on threat intelligence for self-hosted servers: it
- **Investigation (1.2.0):** 30-day retention, twelve ranges and custom periods, an on-disk event registry, replay, IP analysis with verdict and reasons, attack families, MITRE ATT&CK, campaigns, STIX 2.1 export and stable metrics.
- **Service health and error classes (1.3.0):** per-service SLO, error budget, burn rate and Apdex, error classes, episodes with Kaplan-Meier survival, visitors counted as people with a real browser, a side rail of pages (Monitor, Investigate, Analyze, Operate, Reports) and the anonymous visits stream.
- **Second firewall and egress (1.4.0):** `--enforce` decisions applied by a host fail2ban jail, outbound connection analysis (beacons, mining, DNS bypass, unauthorised scans), the host kit in `deploy/host` and the HTML report.
- **Probes, Tor and unban (1.4.1 to 1.4.8):** network probes on closed ports, backend pagination, automatic Tor lists, text Traefik logs, history-based bans, unban from the interface with operator allowances and fewer egress false positives.
- **Incident management (1.5.0 to 1.5.7):** tickets from egress findings with status, comments, history and suppression, and mobile fixes.
- **Forge browsing, verified crawlers and coverage (1.6.0):** repository pages are not attacks, crawlers confirmed by reverse DNS are never banned, our own bans no longer feed the score, honest blocklist coverage and a slow-attacker policy; phone tables as cards (1.5.8, shipped inside 1.6.0).
- **Hub and probes (2.0.0):** the hub no longer reads files; a probe of a few MB (own image, no open port) on each server sends the logs over HTTPS with a disk spool and receives the second firewall decisions; per-probe tokens stored as hashes, the Sources page to create, edit and revoke probes, per-probe location and egress settings, incidents qualified by host (`host/INC-n`) and `urutau import` to bring 1.x data directories in without loss. Breaking: the peer federation and the log path variables of the hub are gone ([docs/migration-2.0.md](docs/migration-2.0.md)).
## Next
- **More log sources:** other web servers and proxies (nginx, Caddy), and more daemons' auth failures.
+14 -2
View File
@@ -2,7 +2,7 @@
[English](ROADMAP.md) · **Português**
O Urutau é threat intelligence leve e sempre ligado para servidores self-hosted: lê os logs que o servidor já escreve, classifica atividade hostil, pontua IPs e exporta uma blocklist. Sempre somente leitura em relação à rede, sem telemetria.
O Urutau é threat intelligence leve e sempre ligado para servidores self-hosted: um hub mais uma sonda ultraleve em cada servidor, que leem os logs que os servidores já escrevem, classifica atividade hostil, pontua IPs e exporta uma blocklist. Nunca envia tráfego aos IPs que lista e não tem telemetria; o segundo firewall opcional só faz a sonda escrever um arquivo que uma jail do host lê.
## Feito
@@ -11,7 +11,7 @@ O Urutau é threat intelligence leve e sempre ligado para servidores self-hosted
- **Persistência (1.0.0):** estado móvel de 7 dias salvo em snapshot junto com as posições dos arquivos, para que um reinício nunca reprocesse um log.
- **Dashboard e API (1.0.0):** UI bilíngue embutida com atualização ao vivo por SSE, login por token, API JSON, detalhe do IP.
- **Blocklist (1.0.0):** exportação em texto e JSON com limiar de pontuação.
- **Federação (1.0.0):** um hub agrega peers por `/api/v1/peer/export` com um token de peer separado que não abre mais nada.
- **Federação (1.0.0, substituída por sondas na 2.0.0):** um hub agregava peers por `/api/v1/peer/export` com um token de peer separado.
- **Geolocalização e web analytics (1.0.0):** geolocalização offline DB-IP Lite, interpretação de User-Agent e analytics de tráfego amigável à privacidade.
- **Filtros de ruído (1.0.0):** CIDRs confiáveis e User-Agents de monitoramento.
- **Container e CI/CD (1.0.0):** imagem multi-arquitetura, deploy no Coolify, CI no Gitea com release que reaproveita imagem, auditoria semanal.
@@ -21,6 +21,18 @@ O Urutau é threat intelligence leve e sempre ligado para servidores self-hosted
- **Investigação (1.2.0):** retenção de 30 dias, doze intervalos e períodos personalizados, registro de eventos em disco, replay, análise de IP com veredito e razões, famílias de ataque, MITRE ATT&CK, campanhas, exportação STIX 2.1 e métricas estáveis.
- **Saúde dos serviços e classes de erro (1.3.0):** SLO por serviço, orçamento de erro, burn rate e Apdex, classes de erro, episódios com sobrevivência de Kaplan-Meier, visitantes contados como pessoas com navegador de verdade, um menu lateral de páginas (Monitorar, Investigar, Analisar, Operar, Relatórios) e o stream de visitas anônimas.
- **Segundo firewall e egress (1.4.0):** decisões de `--enforce` aplicadas por uma jail do fail2ban no host, análise das conexões de saída (beacons, mineração, desvio de DNS, varreduras não autorizadas), o kit do host em `deploy/host` e o relatório HTML.
- **Probes, Tor e desban (1.4.1 a 1.4.8):** probes de rede em portas fechadas, paginação no backend, listas Tor automáticas, logs de texto do Traefik, bans pelo histórico, desban pela interface com liberações do operador e menos falsos positivos no egress.
- **Gestão de incidentes (1.5.0 a 1.5.7):** chamados a partir dos achados de egress com status, comentários, histórico e supressão, e ajustes para celular.
- **Navegação em forge, crawlers verificados e cobertura (1.6.0):** páginas de repositório não são ataque, crawlers confirmados por DNS reverso nunca são banidos, nossos próprios bans deixam de alimentar a pontuação, cobertura honesta da blocklist e uma política para atacantes lentos; tabelas em cartões no celular (1.5.8, entregue dentro da 1.6.0).
- **Hub e sondas (2.0.0):** o hub não lê mais arquivos; uma sonda de poucos MB (imagem própria, sem porta aberta) em cada servidor envia os logs por HTTPS com spool em disco e recebe as decisões do segundo firewall; token por sonda guardado como hash, página Fontes para criar, editar e revogar sondas, localização e egress por sonda, incidentes qualificados por host (`host/INC-n`) e `urutau import` para trazer diretórios de dados da 1.x sem perda. Incompatível: a federação por peers e as variáveis de caminho de log do hub saíram ([docs/pt-BR/migracao-2.0.md](docs/pt-BR/migracao-2.0.md)).
## Próximo
- **Mais fontes de log:** outros servidores web e proxies (nginx, Caddy) e falhas de autenticação de mais daemons.
+12 -8
View File
@@ -2,7 +2,7 @@
**English** · [Português](SECURITY.pt-BR.md)
Urutau is defensive software, but its whole input is hostile: every line of the Traefik access log, `auth.log` and `fail2ban.log` can carry text an attacker chose on purpose (request paths, User-Agents, user names, host names). Treat every log field as untrusted.
Urutau is defensive software, but its whole input is hostile: every line of the Traefik access log, `auth.log` and `fail2ban.log` can carry text an attacker chose on purpose (request paths, User-Agents, user names, host names). Treat every log field as untrusted, and everything a probe sends as untrusted too.
## Reporting a vulnerability
@@ -12,20 +12,24 @@ Do not open a public issue with exploit details. Open a minimal issue asking for
- **Hostile log fields:** paths, User-Agents, user names, hosts and jails are length-limited when parsed, kept as data, and escaped when rendered. A malformed, oversized or crafted line must be counted as malformed, never crash the daemon, exhaust memory or inject markup, a command or a script into the dashboard. The dashboard ships a Content-Security-Policy that forbids inline script and style.
- **Authentication:** the dashboard and every API route except `/api/health` need `URUTAU_TOKEN` (at least 32 characters and about 128 bits of estimated entropy, compared in constant time; it can come from `URUTAU_TOKEN_FILE`), either as a bearer token or through a login that sets a session cookie (`HttpOnly`, `SameSite=Strict`, `Secure` over HTTPS) valid for 12 hours. The session is revocable: it is a random id kept in memory, logout revokes it and closes its live stream, and a restart invalidates all sessions. Login and logout reject cross-site requests. After 5 failures per 10 minutes from a client (IPv6 counted per /64) the login answers 429, yet the correct token still gets in after a 1 second delay, so an attacker cannot lock the owner out; wrong bearer tokens count as failures too. The client IP comes from the TCP peer; `X-Forwarded-For` is honored only when the peer is in `--trusted-proxy` (default: the private networks), read from right to left, so it cannot be spoofed from outside. Generate tokens with `openssl rand -base64 48` (`-hex 32` also works).
- **Peer token:** The server token (`URUTAU_PEER_TOKEN`, also as `_FILE`; 32+ characters, about 128 bits of estimated entropy, not periodic or sequential, different from `URUTAU_TOKEN`) is the only credential the local export accepts, and it only opens the three federation routes, `GET /api/v1/peer/export`, the live stream `GET /api/v1/peer/stream` (at most 10 connections, malicious events only) and `GET /api/v1/peer/period` (the study a hub merges; at most two run at once); every other route answers 403 to it, and `URUTAU_TOKEN` is refused (401) on all three. Without a peer token they are a 404. `--peer-allow` restricts them to source CIDRs. `URUTAU_PEER_TOKEN_<NAME>` values are client credentials a hub sends to that peer; they never open the local export, and peer names that collide in the variable name are refused. A hub refuses to start with a peer that has no token, only talks to those two routes, requires `https` outside loopback, does not follow redirects, uses a 4 s timeout and an 8 MB limit, and sanitizes and caps everything a peer sends: an `admin` flag coming from a peer is ignored and a peer's `Strong` flag only counts with a score of 50 or more. The live relay from each peer is capped at about 50 events per second and about 1 MB/s (a peer that sends more is disconnected), lines of at most 16 KB, a 500-event buffer, reconnection with exponential backoff up to 60 s, and every relayed event is rebuilt from validated fields (address, known category, clipped strings without control characters, valid coordinates; the `host` is always the configured peer name). A compromised peer can still add hostile-looking global IPs to the hub's blocklist (only with score 50+ and a strong signal; `admin` and `forged` flags from peers are ignored); set `URUTAU_PEER_BLOCKLIST=off` to keep the blocklist to local observations. Treat a peer as able to read the top 500 IPs, paths and traffic figures its export carries, and its live attack events.
- **Probe tokens and ingestion (2.0):** each probe has its own token (`urp_` plus 43 base64url characters, 256 random bits) shown once at creation. The hub stores only its SHA-256 in `probes.json` (mode 0600, written atomically), never the token, and compares in constant time; a lost token is replaced by revoking the probe and creating it again, and revoking refuses the probe at once while keeping its data. The token opens only `POST /api/v1/probe/hello`, `POST /api/v1/probe/push` and `GET /api/v1/probe/commands` (together with the `X-Urutau-Probe` header, which must match it); every other route refuses it, and the user token is refused on those three. A wrong token is a bare 401 with no detail, under the same attempt limiter as the login. Plain `http://` is accepted only for loopback and private addresses (`wire.CheckHubURL`); otherwise the probe requires HTTPS. The hub treats everything a probe sends as hostile input: bodies are limited to 2 MiB on the wire and 8 MiB inflated, a batch to 5,000 lines of at most 64 KiB, the source name must be one of the known ones, one push at a time per probe (429) and a bounded ingestion queue (503 with `Retry-After`); the hub never trusts a path, an `admin` flag or a host name from a probe, and the host of every event is the registered name of the probe. A compromised probe can inject false events for its own host (and so shape that host's data and, with `URUTAU_ENFORCE=on`, trigger bans of addresses that pass the exclusions); it cannot read data, touch another probe's node or run anything on the hub. Treat a probe token like the right to write lines into your logs.
- **Probe process (2.0):** the probe opens no listening port: it only dials out to the hub. It reads log files read-only and keeps a spool and its positions in its own state directory. Its image is `FROM scratch` (the binary, CA certificates and zoneinfo: no shell, no package manager), runs as uid 10001 with a read-only root filesystem, no capabilities and `no-new-privileges`. A spool that fills drops the oldest batches and counts them, never growing without limit.
- **Command validation on the probe (2.0):** the hub sends ban and unban lines to the probe, which is the only process that writes them to the host. The probe accepts a line only if `wire.ValidCmdLine` passes: exactly the shape the hub's `FormatLine` and `UnbanLine` produce, a valid address, a reason from the fixed list of slugs, a bounded TTL and a bounded length, with no control character or newline; anything else is counted as a command error and never written. Lines are appended with `O_APPEND` and `fsync`, and a repeated command is not written twice. The hub itself never gains write access to a host file.
- **HTTP server limits:** header and body timeouts, `MaxHeaderBytes` of 16 KB, `POST /login` capped at 4 KB, and at most 20 simultaneous live-stream clients (a 21st gets 503 with `Retry-After`; the stream sends a heartbeat every 20 s).
- **Information exposure:** `/api/health` returns only `{"status":"ok"}` (no version), log file paths are never shown in the dashboard or to peers, responses carry `Referrer-Policy: same-origin` and a strict Content-Security-Policy.
- **Information exposure:** `/api/health` returns only `{"status":"ok"}` (no version), log file paths never leave the probe and are never shown in the dashboard, responses carry `Referrer-Policy: same-origin` and a strict Content-Security-Policy.
- **Framed requests:** with the `Sec-Fetch-Site`, `Sec-Fetch-Dest` and `Referer` headers in the Traefik log, a request embedded by another page (cross-site or same-site, or a sub-resource destination such as image or script) creates an IP record like any other but weighs 0.25 per event, with at most 30 points per IP from such requests (below the hostile threshold), and never counts as a strong signal. With an attack-tool User-Agent the headers are ignored. The headers come from the client, so a framed visitor never becomes hostile, and a scanner that forges them shows up as suspicious instead of vanishing.
- **Admin immunity:** an IP with a successful SSH login (of a user in `--admin-users`; the immunity is off unless that list is set) is kept out of the hostile level and the blocklist for 24 hours after its last login, and a strong signal after that login cancels it. A login in the same second as a strong attack gives no immunity.
- **Analytics and blocklist hygiene:** a domain gets an analytics slot only after a 2xx answer (optionally restricted by `--domains`) and inactive domains are pruned, so forged `Host` headers cannot fill memory. The blocklist only contains hostile, globally routable addresses, never `--ignore` or `--trusted` ranges or an IP with a successful SSH login; IPv6 is aggregated by /64 (up to 20,000 tracked entries), so one attacker cannot flood the table. A monitoring User-Agent never excuses an attack request, and with `--monitor-from` it only counts from your monitor networks.
- **No unauthenticated mode on the network:** `--insecure-no-auth` is refused unless the bind address is loopback. Exposing the port on a public interface still needs a reverse proxy with TLS.
- **Container hardening:** the image runs as an unprivileged user (no `curl` or shell tools needed: its `HEALTHCHECK` is `urutau healthcheck`) with a read-only root filesystem and no capabilities. Logs are mounted read-only, and only the Traefik log directory is mounted from the proxy, never `acme.json` or its configuration. Logs come from a dedicated host directory, `/var/log/urutau`, not the whole `/var/log`. `--trusted-proxy` defaults to loopback only; the compose file creates the `urutau-edge` network (`10.250.0.0/24`) and trusts just that, so keep only the reverse proxy on it, since another container there could forge `X-Forwarded-For`. The only write target is the data volume (snapshot, mode `0700` directory).
- **Read-only by design:** Urutau reads logs and never sends traffic to the IPs it lists. The only outbound connections are reverse DNS lookups, the periodic download of the DB-IP Lite databases from `download.db-ip.com` (verified by opening the file before it replaces the old one; a failure never stops the service) and, on a hub, the polls to the configured peers. Geolocation lookups are local.
- **Container hardening:** both images run as an unprivileged user without `curl` (the hub's `HEALTHCHECK` is `urutau healthcheck`, the probe's is `urutau probe --check`) with a read-only root filesystem and no capabilities. The hub mounts no log at all; the probe mounts logs read-only, and only the Traefik log directory is mounted from the proxy, never `acme.json` or its configuration. Logs come from a dedicated host directory, `/var/log/urutau`, not the whole `/var/log`. `--trusted-proxy` defaults to loopback only; the compose file creates the `urutau-edge` network (`10.250.0.0/24`) and trusts just that, so keep only the reverse proxy on it, since another container there could forge `X-Forwarded-For`. The only write target of the hub is the data volume (snapshots, mode `0700` directory); the probe writes its `/state` volume and, only for the second firewall, the decision files.
- **Read-only by design:** Urutau reads logs and never sends traffic to the IPs it lists. The only outbound connections are reverse DNS lookups, the periodic download of the DB-IP Lite databases from `download.db-ip.com` (verified by opening the file before it replaces the old one; a failure never stops the service), the Tor exit and relay lists from `check.torproject.org` and `onionoo.torproject.org` every 6 hours (`--tor-auto=off` turns it off) Geolocation lookups are local. A probe's only outbound connection is to its hub.
- **Second firewall:** it is off by default (`--enforce=off`). Urutau gains no privileges: the hub queues a line for the probe, the probe validates it and appends it to a decision file, and a jail of the host fail2ban applies it. A line carries nothing the attacker controls (the address is re-formatted, the reason is one of a fixed list of slugs, host and source names are reduced to `[A-Za-z0-9._-]`), the file rotates at 20 MB, and at most `--enforce-max-per-min` decisions are written per minute. It never bans private ranges, `--trusted`, Cloudflare ranges, public resolvers, peers, the server itself, verified crawlers or addresses with a legitimate visit in the last 24 hours. With `--enforce-share`, a decision of one node is accepted by another only with a fixed reason, a TTL capped at 6 hours and an address that node also saw attacking. The unban file is written only through an authenticated user (`POST /api/v1/enforce/unban`), as a command to the probe of the chosen host.
- **Egress and incidents:** egress analysis only reads a kernel log written by the host kit, which logs and never drops. Tickets in each node's `incidents.json` are written with mode 0600, bounded (5,000 tickets, 200 comments, 500 history entries), refuse cross-site writes and are closed to a probe token.
- **Privacy and local-first:** there is no telemetry. IPs and request details stay on your servers (and on the hub you configure).
- **Visitor privacy (LGPD and GDPR):** the Traffic page counts unique visitors with a hash computed with a daily salt, so a visitor cannot be followed across days, and the IP address of a legitimate visitor is never persisted. There are no cookies for visitors, no fingerprinting and no request to third parties. IPs are retained only for hostile activity, for at most the retention period (7 days). Whether this is enough for your legal basis and notices is your responsibility as the controller.
- **Anonymous visits:** legitimate visitors are never stored. The optional `?visits=1` stream carries no address, User-Agent or referrer (city-level position only, at most 20 per second) and is never written to disk. Paths and `Referer` values are normalized to `:id` when they carry an e-mail address, a token or a long identifier, so personal data in a URL does not reach the lists. The newer analysis routes (`/api/v1/techniques`, `/evolution`, `/concentration`, `/survival`, `/sessions/funnel`, `/campaigns`, `/defense`, `/errors`, `/integrity`, `/report`, `/services`, `/protocols`) are user-only: the peer token gets 403 on them.
- **Anonymous visits:** legitimate visitors are never stored. The optional `?visits=1` stream carries no address, User-Agent or referrer (city-level position only, at most 20 per second) and is never written to disk. Paths and `Referer` values are normalized to `:id` when they carry an e-mail address, a token or a long identifier, so personal data in a URL does not reach the lists. The newer analysis routes (`/api/v1/techniques`, `/evolution`, `/concentration`, `/survival`, `/sessions/funnel`, `/campaigns`, `/defense`, `/errors`, `/integrity`, `/report`, `/services`, `/protocols`) are user-only: a probe token is refused on them.
- **Event registry (privacy):** `<data-dir>/events/` keeps one line per event for replay and investigation, but only about attackers: malicious events, bans, successful SSH logins, a 404 to an attack tool, and answers to addresses that are already suspicious or hostile. The address of a legitimate visitor is never written. Files are removed after the retention (30 days at most) and the total is capped by `--events-max` (512 MB by default, `0` turns the registry off). Treat the directory as personal data under the LGPD and the GDPR: same retention, same access control as the rest of the data volume. A full disk or the size cap drops events instead of stopping the service, and a corrupted line is skipped.
- **Outbound lookups for verdicts:** the network type is inferred locally from the ASN, organisation and reverse DNS (no external API). Forward-confirmed reverse DNS is used only to confirm a claimed Googlebot or Bingbot. The optional Tor exit list is a local file (`--tor-exits`).
- **Outbound lookups for verdicts:** the network type is inferred locally from the ASN, organisation and reverse DNS (no external API). Forward-confirmed reverse DNS is used only to confirm a claimed Googlebot, Bingbot or Applebot (a confirmed crawler is never banned by the second firewall). The Tor lists are cached locally, and `--tor-exits` accepts a local file.
- **Third-party data:** the geolocation databases are DB-IP Lite, CC BY 4.0, and the attribution must be kept where the data is shown. The state and city boundaries on the Geography page are from Natural Earth, public domain.
## Known limitation
@@ -40,4 +44,4 @@ A local user of the host can forge sshd lines with `logger -t sshd`, which rsysl
## Supported versions
Only the latest `1.x` release is supported. There is no long-term support branch.
Only the latest `2.x` release is supported. The 1.x peer federation (`/api/v1/peer/*`, `URUTAU_PEER_*`) was removed in 2.0.0 and gets no fixes; see [docs/migration-2.0.md](docs/migration-2.0.md). There is no long-term support branch.
+11 -7
View File
@@ -12,20 +12,24 @@ Não abra uma issue pública com detalhes de exploração. Abra uma issue mínim
- **Campos hostis de log:** caminhos, User-Agents, usuários, hosts e jails têm tamanho limitado no parse, são mantidos como dado e escapados ao renderizar. Uma linha malformada, gigante ou forjada deve ser contada como malformada, nunca derrubar o daemon, esgotar memória ou injetar marcação, comando ou script no dashboard. O dashboard envia uma Content-Security-Policy que proíbe script e estilo inline.
- **Autenticação:** o dashboard e toda rota da API, exceto `/api/health`, exigem `URUTAU_TOKEN` (no mínimo 32 caracteres e cerca de 128 bits de entropia estimada, comparado em tempo constante; pode vir de `URUTAU_TOKEN_FILE`), como bearer token ou por um login que define um cookie de sessão (`HttpOnly`, `SameSite=Strict`, `Secure` em HTTPS) válido por 12 horas. A sessão é revogável: é um id aleatório guardado em memória, o logout a revoga e fecha o stream ao vivo dela, e um reinício invalida todas as sessões. Login e logout rejeitam requisições cross-site. Após 5 falhas a cada 10 minutos de um cliente (IPv6 contado por /64) o login responde 429, mas o token correto ainda entra após 1 segundo de atraso, para que um atacante não tranque o dono do lado de fora; bearer tokens errados também contam como falha. O IP do cliente vem do peer TCP; `X-Forwarded-For` só vale quando o peer está em `--trusted-proxy` (padrão: as redes privadas), lido da direita para a esquerda, então não pode ser forjado de fora. Gere tokens com `openssl rand -base64 48` (`-hex 32` também serve).
- **Token de peer:** O token de servidor (`URUTAU_PEER_TOKEN`, também via `_FILE`; 32+ caracteres, cerca de 128 bits de entropia estimada, sem padrão periódico nem sequencial, diferente de `URUTAU_TOKEN`) é a única credencial que o export local aceita, e só abre as duas rotas de federação, `GET /api/v1/peer/export` o fluxo ao vivo `GET /api/v1/peer/stream` (no máximo 10 conexões, só eventos maliciosos) e `GET /api/v1/peer/period` (o estudo que um hub mescla; no máximo dois ao mesmo tempo); todas as outras rotas respondem 403 a ele, e o `URUTAU_TOKEN` é recusado (401) nas três. Sem token de peer elas são 404. `--peer-allow` restringe as três a CIDRs de origem. Os valores `URUTAU_PEER_TOKEN_<NOME>` são credenciais de cliente que um hub envia àquele peer; nunca abrem o export local, e nomes de peer que colidem no nome da variável são recusados. Um hub se recusa a iniciar com um peer sem token, só fala com essas duas rotas, exige `https` fora de loopback, não segue redirects, usa timeout de 4 s e limite de 8 MB, e sanitiza e limita tudo o que um peer envia: um sinalizador `admin` vindo de um peer é ignorado e o `Strong` de um peer só vale com pontuação 50 ou mais. O repasse ao vivo de cada peer é limitado a cerca de 50 eventos por segundo e cerca de 1 MB/s (um peer que manda mais é desconectado), linhas de no máximo 16 KB, buffer de 500 eventos e reconexão com backoff exponencial até 60 s, e cada evento repassado é reconstruído a partir de campos validados (endereço, categoria conhecida, textos cortados e sem caracteres de controle, coordenadas válidas; o `host` é sempre o nome configurado do peer). Um peer comprometido ainda pode pôr IPs globais com cara de hostis na blocklist do hub (só com pontuação 50+ e sinal forte; os sinalizadores `admin` e `forged` vindos de peers são ignorados); defina `URUTAU_PEER_BLOCKLIST=off` para restringir a blocklist às observações locais. Trate um peer como alguém que pode ler os 500 IPs principais, caminhos e números de tráfego que o export carrega, e os seus eventos de ataque ao vivo.
- **Tokens de sonda e recepção (2.0):** cada sonda tem o seu token (`urp_` mais 43 caracteres base64url, 256 bits aleatórios), mostrado uma vez na criação. O hub guarda apenas o SHA-256 dele em `probes.json` (modo 0600, gravação atômica), nunca o token, e compara em tempo constante; um token perdido se resolve revogando a sonda e criando de novo, e revogar recusa a sonda na hora mantendo os dados dela. O token abre só `POST /api/v1/probe/hello`, `POST /api/v1/probe/push` e `GET /api/v1/probe/commands` (junto com o cabeçalho `X-Urutau-Probe`, que precisa corresponder); toda outra rota o recusa, e o token de usuário é recusado nessas três. Token errado é um 401 seco, sem detalhe, sob o mesmo limitador de tentativas do login. `http://` puro só é aceito para loopback e endereços privados (`wire.CheckHubURL`); fora disso a sonda exige HTTPS. O hub trata tudo que a sonda envia como entrada hostil: corpos limitados a 2 MiB no fio e 8 MiB descomprimido, lote de no máximo 5.000 linhas de até 64 KiB, nome de fonte entre os conhecidos, um push por vez por sonda (429) e fila de ingestão limitada (503 com `Retry-After`); o hub nunca confia em caminho, em flag `admin` nem em nome de host vindo da sonda, e o host de cada evento é o nome cadastrado da sonda. Uma sonda comprometida pode injetar eventos falsos no próprio host (moldando os dados dele e, com `URUTAU_ENFORCE=on`, provocando bans de endereços que passem pelas exclusões); não consegue ler dados, tocar o nó de outra sonda nem executar nada no hub. Trate o token de uma sonda como o direito de escrever linhas nos seus logs.
- **Processo da sonda (2.0):** a sonda não abre porta nenhuma: só conecta de dentro para fora até o hub. Lê arquivos de log somente leitura e guarda o spool e as posições no próprio diretório de estado. A imagem é `FROM scratch` (o binário, certificados CA e zoneinfo: sem shell nem gerenciador de pacotes), roda como uid 10001 com sistema de arquivos raiz somente leitura, sem capabilities e com `no-new-privileges`. Um spool cheio descarta os lotes mais antigos e os conta, sem crescer sem limite.
- **Validação de comandos na sonda (2.0):** o hub envia linhas de ban e desban à sonda, que é o único processo que as grava no host. A sonda só aceita uma linha se `wire.ValidCmdLine` passar: exatamente o formato que `FormatLine` e `UnbanLine` do hub produzem, endereço válido, motivo de uma lista fixa de slugs, TTL e tamanho limitados, sem caractere de controle nem quebra de linha; qualquer outra coisa é contada como erro de comando e nunca gravada. As linhas entram com `O_APPEND` e `fsync`, e um comando repetido não é gravado duas vezes. O hub nunca ganha escrita em arquivo do host.
- **Limites do servidor HTTP:** timeouts de cabeçalho e corpo, `MaxHeaderBytes` de 16 KB, `POST /login` limitado a 4 KB e no máximo 20 clientes simultâneos no stream ao vivo (o 21º recebe 503 com `Retry-After`; o stream envia heartbeat a cada 20 s).
- **Exposição de informação:** `/api/health` devolve só `{"status":"ok"}` (sem versão), os caminhos dos arquivos de log nunca aparecem no dashboard nem para peers, e as respostas levam `Referrer-Policy: same-origin` e uma Content-Security-Policy estrita.
- **Exposição de informação:** `/api/health` devolve só `{"status":"ok"}` (sem versão), os caminhos dos arquivos de log nunca saem da sonda nem aparecem no dashboard, e as respostas levam `Referrer-Policy: same-origin` e uma Content-Security-Policy estrita.
- **Requisições enquadradas:** com os cabeçalhos `Sec-Fetch-Site`, `Sec-Fetch-Dest` e `Referer` no log do Traefik, uma requisição embutida por outra página (cross-site ou same-site, ou destino de subrecurso como image ou script) aparece na linha do tempo e cria registro de IP como qualquer outra, mas pesa 0,25 por evento, com no máximo 30 pontos por IP vindos delas (abaixo do limiar hostil), e nunca conta como sinal forte. Com User-Agent de ferramenta de ataque os cabeçalhos são ignorados. Os cabeçalhos vêm do cliente, então um visitante enquadrado nunca vira hostil, e um scanner que os forja aparece como suspeito em vez de sumir.
- **Imunidade de admin:** um IP com login SSH bem-sucedido (de um usuário em `--admin-users`; a imunidade fica desligada a menos que essa lista seja definida) fica fora do nível hostil e da blocklist por 24 horas após o último login, e um sinal forte depois desse login a anula. Um login no mesmo segundo de um ataque forte não dá imunidade.
- **Higiene do analytics e da blocklist:** um domínio só ganha vaga no analytics após uma resposta 2xx (opcionalmente restrito por `--domains`) e domínios inativos são podados, então `Host` forjados não enchem a memória. A blocklist só contém endereços hostis e globalmente roteáveis, nunca faixas de `--ignore` ou `--trusted` nem um IP com login SSH bem-sucedido; o IPv6 é agregado por /64 (até 20.000 entradas rastreadas), então um atacante não inunda a tabela. Um User-Agent de monitoramento nunca desculpa uma requisição de ataque, e com `--monitor-from` só vale vindo das suas redes de monitoramento.
- **Sem modo aberto na rede:** `--insecure-no-auth` é recusado a menos que o bind seja loopback. Expor a porta em uma interface pública ainda exige um proxy reverso com TLS.
- **Endurecimento do container:** a imagem roda com usuário sem privilégios (sem `curl` nem ferramentas de shell: o `HEALTHCHECK` é `urutau healthcheck`), sistema de arquivos raiz somente leitura e sem capabilities. Os logs são montados somente leitura, e do proxy só o diretório de logs do Traefik é montado, nunca o `acme.json` nem a configuração. Os logs vêm de um diretório dedicado do host, `/var/log/urutau`, não do `/var/log` inteiro. `--trusted-proxy` tem como padrão só o loopback; o compose cria a rede `urutau-edge` (`10.250.0.0/24`) e confia só nela, então deixe nela apenas o proxy reverso, pois outro container ali poderia forjar o `X-Forwarded-For`. O único destino de escrita é o volume de dados (snapshot, diretório com modo `0700`).
- **Somente leitura por desenho:** o Urutau lê logs e nunca envia tráfego aos IPs que lista. As únicas conexões de saída são as consultas de DNS reverso, o download periódico das bases DB-IP Lite em `download.db-ip.com` (verificado abrindo o arquivo antes de substituir o antigo; uma falha nunca interrompe o serviço) e, em um hub, as consultas aos peers configurados. As consultas de geolocalização são locais.
- **Endurecimento do container:** as duas imagens rodam com usuário sem privilégios e sem `curl` (o `HEALTHCHECK` do hub é `urutau healthcheck`, o da sonda é `urutau probe --check`), sistema de arquivos raiz somente leitura e sem capabilities. O hub não monta log algum; a sonda monta os logs somente leitura, e do proxy só o diretório de logs do Traefik é montado, nunca o `acme.json` nem a configuração. Os logs vêm de um diretório dedicado do host, `/var/log/urutau`, não do `/var/log` inteiro. `--trusted-proxy` tem como padrão só o loopback; o compose cria a rede `urutau-edge` (`10.250.0.0/24`) e confia só nela, então deixe nela apenas o proxy reverso, pois outro container ali poderia forjar o `X-Forwarded-For`. O único destino de escrita do hub é o volume de dados (snapshots, diretório com modo `0700`); a sonda escreve o volume `/state` e, só para o segundo firewall, os arquivos de decisão.
- **Somente leitura por desenho:** o Urutau lê logs e nunca envia tráfego aos IPs que lista. As únicas conexões de saída são as consultas de DNS reverso, o download periódico das bases DB-IP Lite em `download.db-ip.com` (verificado abrindo o arquivo antes de substituir o antigo; uma falha nunca interrompe o serviço), as listas de saídas e relays do Tor em `check.torproject.org` e `onionoo.torproject.org` a cada 6 horas (`--tor-auto=off` desliga) As consultas de geolocalização são locais. A única conexão de saída de uma sonda é para o hub dela.
- **Segundo firewall:** vem desligado (`--enforce=off`). O Urutau não ganha privilégios: o hub enfileira uma linha para a sonda, a sonda a valida e a acrescenta a um arquivo de decisões, e uma jail do fail2ban do host a aplica. Uma linha não carrega nada que o atacante controla (o endereço é reformatado, o motivo é um de uma lista fixa de slugs, nomes de host e origem são reduzidos a `[A-Za-z0-9._-]`), o arquivo rotaciona em 20 MB e no máximo `--enforce-max-per-min` decisões são gravadas por minuto. Nunca bane faixas privadas, `--trusted`, faixas da Cloudflare, resolvedores públicos, sondas, o próprio servidor, crawlers verificados nem endereços com visita legítima nas últimas 24 horas. Com `--enforce-share`, a decisão de um nó só é aceita por outro com motivo fixo, TTL limitado a 6 horas e um endereço que esse nó também viu atacar. O arquivo de desban só é escrito por meio de um usuário autenticado (`POST /api/v1/enforce/unban`), como comando para a sonda do host escolhido.
- **Egress e incidentes:** a análise de egress só lê um log do kernel escrito pelo kit do host, que registra e nunca descarta. Os chamados em cada `incidents.json` de nó são gravados com modo 0600, limitados (5.000 chamados, 200 comentários, 500 entradas de histórico), recusam escritas cross-site e ficam fechados ao token de sonda.
- **Privacidade e local-first:** não há telemetria. IPs e detalhes de requisições ficam nos seus servidores (e no hub que você configurar).
- **Privacidade dos visitantes (LGPD e GDPR):** a página Tráfego conta visitantes únicos com um hash calculado com sal diário, então um visitante não pode ser seguido entre dias, e o endereço IP de um visitante legítimo nunca é persistido. Não há cookies para visitantes, fingerprinting nem requisição a terceiros. IPs são retidos apenas para atividade hostil, por no máximo o período de retenção (7 dias). Se isso basta para a sua base legal e seus avisos é responsabilidade sua, como controlador.
- **Visitas anônimas:** visitantes legítimos nunca são armazenados. O stream opcional `?visits=1` não carrega endereço, User-Agent nem referrer (só posição no nível da cidade, no máximo 20 por segundo) e nunca é gravado em disco. Caminhos e valores de `Referer` são normalizados para `:id` quando carregam e-mail, token ou identificador longo, para que dado pessoal numa URL não chegue às listas. As rotas de análise mais novas (`/api/v1/techniques`, `/evolution`, `/concentration`, `/survival`, `/sessions/funnel`, `/campaigns`, `/defense`, `/errors`, `/integrity`, `/report`, `/services`, `/protocols`) são só de usuário: o token de peer recebe 403 nelas.
- **Visitas anônimas:** visitantes legítimos nunca são armazenados. O stream opcional `?visits=1` não carrega endereço, User-Agent nem referrer (só posição no nível da cidade, no máximo 20 por segundo) e nunca é gravado em disco. Caminhos e valores de `Referer` são normalizados para `:id` quando carregam e-mail, token ou identificador longo, para que dado pessoal numa URL não chegue às listas. As rotas de análise mais novas (`/api/v1/techniques`, `/evolution`, `/concentration`, `/survival`, `/sessions/funnel`, `/campaigns`, `/defense`, `/errors`, `/integrity`, `/report`, `/services`, `/protocols`) são só de usuário: o token de sonda é recusado nelas.
- **Registro de eventos (privacidade):** `<data-dir>/events/` guarda uma linha por evento para replay e investigação, mas só de atacantes: eventos maliciosos, bans, logins SSH bem-sucedidos, um 404 para uma ferramenta de ataque, e respostas a endereços já suspeitos ou hostis. O endereço de um visitante legítimo nunca é gravado. Os arquivos são removidos após a retenção (30 dias no máximo) e o total é limitado por `--events-max` (512 MB por padrão, `0` desliga o registro). Trate o diretório como dado pessoal perante a LGPD e o GDPR: mesma retenção e mesmo controle de acesso do resto do volume de dados. Disco cheio ou o teto de tamanho descartam eventos em vez de parar o serviço, e uma linha corrompida é ignorada.
- **Consultas para os vereditos:** o tipo de rede é inferido localmente a partir do ASN, da organização e do DNS reverso (sem API externa). O DNS reverso confirmado serve apenas para confirmar um Googlebot ou Bingbot declarado. A lista opcional de saídas do Tor é um arquivo local (`--tor-exits`).
- **Consultas para os vereditos:** o tipo de rede é inferido localmente a partir do ASN, da organização e do DNS reverso (sem API externa). O DNS reverso confirmado serve apenas para confirmar um Googlebot, Bingbot ou Applebot declarado (um crawler confirmado nunca é banido pelo segundo firewall). As listas do Tor ficam em cache local, e `--tor-exits` aceita um arquivo local.
- **Dados de terceiros:** as bases de geolocalização são DB-IP Lite, CC BY 4.0, e a atribuição deve ser mantida onde os dados são exibidos. Os limites de estados e cidades da página Geografia são do Natural Earth, domínio público.
## Limitação conhecida
@@ -40,4 +44,4 @@ Um usuário local do host pode forjar linhas do sshd com `logger -t sshd`, que o
## Versões suportadas
Só a última versão `1.x` é suportada. Não há branch de suporte de longo prazo.
Só a última versão `2.x` é suportada. A federação por peers da 1.x (`/api/v1/peer/*`, `URUTAU_PEER_*`) foi removida na 2.0.0 e não recebe correções; veja [docs/pt-BR/migracao-2.0.md](docs/pt-BR/migracao-2.0.md). Não há branch de suporte de longo prazo.
+17
View File
@@ -0,0 +1,17 @@
// Command urutau-probe is the ultralight Urutau probe on its own: only the
// probe agent, the tailer and the wire protocol are linked in (no geo, store,
// analysis or UI), which keeps the probe image and its memory small.
// `urutau-probe --hub ...` and `urutau-probe probe --hub ...` are equivalent
// to `urutau probe --hub ...`.
package main
import (
"os"
"git.lucasrguerra.dev.br/ciberfauna/urutau/internal/probeagent"
)
// version is set at build time (-ldflags "-X main.version=...").
var version = "dev"
func main() { os.Exit(probeagent.Main(os.Args[1:], version)) }
+12 -2
View File
@@ -13,7 +13,11 @@ import (
const usage = `urutau: lightweight threat intelligence for self-hosted servers
Usage:
urutau serve [flags] run the daemon and the dashboard
urutau serve|hub [flags] run the hub (dashboard, API and probe ingest)
urutau probe [flags] run a probe on a monitored host
urutau probe --check exit 0 when the local probe is alive
urutau probes create|list|revoke NAME [--data-dir D | --url U]
urutau import --from DIR --host NAME [--dry-run --force --verify --count]
urutau doctor [--json] [flags] check sources and the data directory
urutau healthcheck exit 0 when the local daemon answers /api/health
urutau version print the version
@@ -29,7 +33,7 @@ func main() {
switch os.Args[1] {
case "version", "--version", "-v":
fmt.Println("urutau", app.Version)
case "serve":
case "serve", "hub":
c, err := app.ParseFlags("serve", os.Args[2:])
if errors.Is(err, flag.ErrHelp) {
return
@@ -69,6 +73,12 @@ func main() {
fmt.Fprintln(os.Stderr, "urutau:", err)
os.Exit(1)
}
case "probe":
os.Exit(runProbe(os.Args[2:]))
case "probes":
os.Exit(runProbes(os.Args[2:]))
case "import":
os.Exit(app.ImportCLI(os.Args[2:], os.Stdout, os.Stderr))
case "help", "--help", "-h":
fmt.Print(usage)
default:
+133
View File
@@ -0,0 +1,133 @@
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"git.lucasrguerra.dev.br/ciberfauna/urutau/internal/app"
"git.lucasrguerra.dev.br/ciberfauna/urutau/internal/hub"
"git.lucasrguerra.dev.br/ciberfauna/urutau/internal/probeagent"
)
func envOr(k, def string) string {
if v, ok := os.LookupEnv(k); ok {
return v
}
return def
}
func runProbe(args []string) int { return probeagent.Main(args, app.Version) }
// runProbes manages probes: directly on <data-dir>/probes.json (hub stopped or
// not, the file is replaced atomically) or through the API with --url.
func runProbes(args []string) int {
if len(args) < 1 {
fmt.Fprintln(os.Stderr, "usage: urutau probes create|list|revoke [NAME] [--data-dir D | --url U]")
return 2
}
verb, rest := args[0], args[1:]
fs := flag.NewFlagSet("probes "+verb, flag.ContinueOnError)
dir := fs.String("data-dir", envOr("URUTAU_DATA_DIR", "/data"), "hub data directory (URUTAU_DATA_DIR)")
url := fs.String("url", "", "hub URL: use the API instead of the file (token from URUTAU_TOKEN)")
var name string
if len(rest) > 0 && !strings.HasPrefix(rest[0], "-") {
name, rest = rest[0], rest[1:]
}
if err := fs.Parse(rest); err != nil {
return 2
}
if name == "" && fs.NArg() > 0 {
name = fs.Arg(0)
}
if verb != "list" && name == "" {
fmt.Fprintln(os.Stderr, "urutau probes: NAME is required")
return 2
}
if *url != "" {
return probesAPI(verb, name, *url)
}
reg, err := hub.OpenRegistry(filepath.Join(*dir, "probes.json"))
if err != nil {
fmt.Fprintln(os.Stderr, "urutau probes:", err)
return 1
}
switch verb {
case "create":
tok, err := reg.Create(name)
if err != nil {
fmt.Fprintln(os.Stderr, "urutau probes:", err)
return 1
}
fmt.Println(tok)
fmt.Fprintln(os.Stderr, "token shown once: keep it as URUTAU_PROBE_TOKEN of the probe", name)
case "revoke":
if err := reg.Revoke(name); err != nil {
fmt.Fprintln(os.Stderr, "urutau probes:", err)
return 1
}
fmt.Println("revoked", name)
case "list":
for _, p := range reg.List() {
st := "active"
if p.Revoked {
st = "revoked"
}
fmt.Printf("%-32s %-8s created %s\n", p.Name, st, time.Unix(p.Created, 0).UTC().Format(time.RFC3339))
}
default:
fmt.Fprintln(os.Stderr, "urutau probes: unknown command", verb)
return 2
}
return 0
}
func probesAPI(verb, name, base string) int {
tok, _ := app.Secret("URUTAU_TOKEN")
var req *http.Request
u := strings.TrimRight(base, "/") + "/api/v1/probes"
switch verb {
case "create":
b, _ := json.Marshal(map[string]string{"name": name})
req, _ = http.NewRequest(http.MethodPost, u, bytes.NewReader(b))
req.Header.Set("Content-Type", "application/json")
case "revoke":
req, _ = http.NewRequest(http.MethodDelete, u+"/"+name, nil)
case "list":
req, _ = http.NewRequest(http.MethodGet, u, nil)
default:
return 2
}
req.Header.Set("Authorization", "Bearer "+tok)
req.Header.Set("Origin", strings.TrimRight(base, "/"))
resp, err := (&http.Client{Timeout: 15 * time.Second}).Do(req)
if err != nil {
fmt.Fprintln(os.Stderr, "urutau probes:", err)
return 1
}
defer resp.Body.Close()
b, _ := io.ReadAll(io.LimitReader(resp.Body, 1<<20))
if resp.StatusCode/100 != 2 {
fmt.Fprintf(os.Stderr, "urutau probes: HTTP %d %s\n", resp.StatusCode, strings.TrimSpace(string(b)))
return 1
}
if verb == "create" {
var o struct{ Token string }
var m map[string]string
_ = json.Unmarshal(b, &m)
o.Token = m["token"]
fmt.Println(o.Token)
_ = strconv.Itoa
return 0
}
fmt.Println(strings.TrimSpace(string(b)))
return 0
}
+14
View File
@@ -0,0 +1,14 @@
# Urutau: kernel log lines of the egress table go to their own file and stay
# out of the general syslog (an authorised scan would flood it).
if ($syslogfacility-text == "kern" and $msg contains "URUTAU-EGRESS: ") then {
action(type="omfile" file="/var/log/urutau/egress.log" template="RSYSLOG_FileFormat"
fileOwner="syslog" fileGroup="adm" fileCreateMode="0640")
stop
}
# inbound probes to closed ports (port scans)
if ($syslogfacility-text == "kern" and $msg contains "URUTAU-PROBE: ") then {
action(type="omfile" file="/var/log/urutau/probe.log" template="RSYSLOG_FileFormat"
fileOwner="syslog" fileGroup="adm" fileCreateMode="0640")
stop
}
+8
View File
@@ -0,0 +1,8 @@
# Urutau: kernel log lines of the inbound observation table (a sample of the new
# connection attempts that reach the host) go to their own file and stay out of
# the general syslog. URUTAU-INO: is a port the host serves, URUTAU-IN: is not.
if ($syslogfacility-text == "kern" and ($msg contains "URUTAU-IN: " or $msg contains "URUTAU-INO: ")) then {
action(type="omfile" file="/var/log/urutau/ingress.log" template="RSYSLOG_FileFormat"
fileOwner="syslog" fileGroup="adm" fileCreateMode="0640")
stop
}
+10
View File
@@ -0,0 +1,10 @@
# Urutau "second firewall" action: like iptables-allports, but it only drops
# connections the banned address STARTS (conntrack original direction). The
# replies to connections this host opened (DNS, ACME, image pulls, apt) keep
# flowing even if a decision ever names an address the host depends on.
[INCLUDES]
before = iptables-allports.conf
[Definition]
actionban = <iptables> -I f2b-<name> 1 -s <ip> -m conntrack --ctdir ORIGINAL -j <blocktype>
actionunban = <iptables> -D f2b-<name> -s <ip> -m conntrack --ctdir ORIGINAL -j <blocktype>
+7
View File
@@ -0,0 +1,7 @@
# Urutau "second firewall": one line per decision written by Urutau in
# enforce=on mode, e.g.
# 2026-11-14T22:00:00Z urutau decision=ban ip=203.0.113.7 reason=wp-bruteforce score=95 ttl=3600 host=oracle src=local
[Definition]
datepattern = ^%%Y-%%m-%%dT%%H:%%M:%%SZ
failregex = ^\s*urutau decision=ban ip=<HOST> reason=[a-z0-9-]+
ignoreregex =
+14
View File
@@ -0,0 +1,14 @@
# Urutau "second firewall". Urutau never gets privileges: it only writes its
# decisions to this file and fail2ban applies them, with its own ignoreip
# (the [DEFAULT] of the host still protects trusted addresses).
[urutau]
enabled = true
backend = polling
filter = urutau
logpath = /var/log/urutau-enforce/decisions.log
maxretry = 1
findtime = 1h
bantime = 1h
# ignoreip and ignoreself come from the host [DEFAULT] (never override them here)
action = urutau-allports[name=urutau-in, chain=INPUT, protocol=all]
urutau-allports[name=urutau-docker, chain=DOCKER-USER, protocol=all]
+132
View File
@@ -0,0 +1,132 @@
#!/bin/sh
# Urutau host kit: egress logging (nftables + rsyslog), the container map and,
# optionally, the fail2ban jail of the "second firewall".
#
# sudo sh install.sh # egress logging + container map
# sudo sh install.sh --enforce # also the fail2ban jail for URUTAU_ENFORCE=on
# sudo sh install.sh --ingress # also the inbound observation (firewall telemetry)
# sudo sh install.sh --probe # a probe host: the kit above, no hub on this machine
# sudo sh install.sh --probe --enforce # probe host that also applies the hub's bans
# sudo sh install.sh --remove # undo everything
#
# --probe is for servers that run only the Urutau probe (deploy/probe): the
# probe dials out to the hub, so nothing here opens or needs a port. It also
# prepares /var/log/urutau-enforce (owned by the probe's uid) so the probe can
# append the hub's decisions; the fail2ban jail still needs --enforce.
#
# --ingress adds an nftables table that only counts, and logs a sample of, the new
# inbound connection attempts reaching the host (it never drops or changes a
# packet), a timer that writes the exact counters to /var/log/urutau/ingress.counters
# and an rsyslog rule for /var/log/urutau/ingress.log. It is separate from
# --enforce on purpose (observing is not blocking); combine them freely, and
# re-run without it to leave it as is, or use --remove to undo.
#
# Idempotent. Urutau itself never gets privileges: it only reads these logs and
# writes its ban decisions to /var/log/urutau-enforce/decisions.log.
set -eu
here=$(cd "$(dirname "$0")" && pwd)
uid=${URUTAU_UID:-10001}
probe=0
enforce=0
ingress=0
remove=0
for arg in "$@"; do
case "$arg" in
--probe) probe=1 ;;
--enforce) enforce=1 ;;
--ingress) ingress=1 ;;
--remove) remove=1 ;;
-h | --help) awk 'NR > 1 { if (!/^#/) exit; sub(/^# ?/, ""); print }' "$0"; exit 0 ;;
*) echo "unknown option: $arg (see --help)" >&2; exit 2 ;;
esac
done
[ "$(id -u)" = 0 ] || { echo "run as root" >&2; exit 1; }
if [ "$remove" = 1 ]; then
systemctl disable --now urutau-ingress.service urutau-ingress-tick.timer urutau-egress.service urutau-containers-watch.service urutau-containers-map.timer urutau-logrotate.timer urutau-unban.path 2>/dev/null || true
rm -f /etc/systemd/system/urutau-ingress.service /etc/systemd/system/urutau-ingress-tick.service \
/etc/systemd/system/urutau-ingress-tick.timer /usr/local/sbin/urutau-ingress-tick /etc/rsyslog.d/42-urutau-ingress.conf
rm -f /etc/systemd/system/urutau-egress.service /etc/systemd/system/urutau-containers-map.service \
/etc/systemd/system/urutau-containers-map.timer /usr/local/sbin/urutau-containers-map \
/etc/systemd/system/urutau-containers-watch.service /usr/local/sbin/urutau-containers-watch \
/etc/rsyslog.d/41-urutau-egress.conf /etc/logrotate.d/urutau-egress \
/etc/fail2ban/jail.d/urutau.local /etc/fail2ban/filter.d/urutau.conf /etc/fail2ban/action.d/urutau-allports.conf \
/etc/systemd/system/urutau-logrotate.service /etc/systemd/system/urutau-logrotate.timer \
/etc/systemd/system/urutau-unban.path /etc/systemd/system/urutau-unban.service /usr/local/sbin/urutau-unban
rm -rf /etc/urutau
systemctl daemon-reload
systemctl restart rsyslog
fail2ban-client reload >/dev/null 2>&1 || true
echo "removed (logs under /var/log/urutau kept)"
exit 0
fi
wan=${URUTAU_WAN:-$(ip -o route get 1.1.1.1 | sed -n 's/.* dev \([^ ]*\).*/\1/p')}
[ -n "$wan" ] || { echo "cannot detect the uplink interface; set URUTAU_WAN" >&2; exit 1; }
case "$wan" in *[!A-Za-z0-9_.-]*) echo "bad interface name: $wan" >&2; exit 1 ;; esac
install -d -m 0750 -o syslog -g adm /var/log/urutau 2>/dev/null || install -d -m 0750 -g adm /var/log/urutau
install -d -m 0755 /etc/urutau
sed "s/@WAN@/$wan/g" "$here/urutau-egress.nft" > /etc/urutau/egress.nft
nft -c -f /etc/urutau/egress.nft
install -m 0644 "$here/41-urutau-egress.conf" /etc/rsyslog.d/41-urutau-egress.conf
install -m 0644 "$here/urutau.logrotate" /etc/logrotate.d/urutau-egress
install -m 0755 "$here/urutau-containers-map" /usr/local/sbin/urutau-containers-map
install -m 0755 "$here/urutau-containers-watch" /usr/local/sbin/urutau-containers-watch
install -m 0644 "$here/urutau-egress.service" "$here/urutau-containers-map.service" \
"$here/urutau-containers-map.timer" "$here/urutau-containers-watch.service" "$here/urutau-logrotate.service" "$here/urutau-logrotate.timer" /etc/systemd/system/
systemctl daemon-reload
systemctl restart rsyslog
systemctl enable urutau-egress.service urutau-containers-map.timer urutau-containers-watch.service urutau-logrotate.timer >/dev/null
systemctl start urutau-logrotate.timer
systemctl restart urutau-egress.service
systemctl start urutau-containers-map.service urutau-containers-map.timer
systemctl restart urutau-containers-watch.service
echo "egress logging on $wan: /var/log/urutau/egress.log, map: /var/log/urutau/containers.map"
if [ "$ingress" = 1 ]; then
sed "s/@WAN@/$wan/g" "$here/urutau-ingress.nft" > /etc/urutau/ingress.nft
nft -c -f /etc/urutau/ingress.nft
install -m 0644 "$here/42-urutau-ingress.conf" /etc/rsyslog.d/42-urutau-ingress.conf
install -m 0755 "$here/urutau-ingress-tick" /usr/local/sbin/urutau-ingress-tick
install -m 0644 "$here/urutau-ingress.service" "$here/urutau-ingress-tick.service" "$here/urutau-ingress-tick.timer" /etc/systemd/system/
[ -e /var/log/urutau/ingress.counters ] || install -m 0640 -o syslog -g adm /dev/null /var/log/urutau/ingress.counters 2>/dev/null || install -m 0640 -g adm /dev/null /var/log/urutau/ingress.counters
systemctl daemon-reload
systemctl restart rsyslog
systemctl enable urutau-ingress.service urutau-ingress-tick.timer >/dev/null
systemctl restart urutau-ingress.service
systemctl start urutau-ingress-tick.timer
echo "inbound observation on $wan: /var/log/urutau/ingress.log (sample), /var/log/urutau/ingress.counters (exact)"
fi
if [ "$probe" = 1 ] && [ "$enforce" = 0 ]; then
# The probe appends the hub's decisions here even when the jail is not
# installed yet, so the files must exist and belong to the probe's uid.
install -d -m 0750 -o "$uid" -g adm /var/log/urutau-enforce
for f in decisions.log unban.log; do
[ -e "/var/log/urutau-enforce/$f" ] || install -m 0640 -o "$uid" -g adm /dev/null "/var/log/urutau-enforce/$f"
done
fi
if [ "$enforce" = 1 ]; then
install -d -m 0750 -o "$uid" -g adm /var/log/urutau-enforce
[ -e /var/log/urutau-enforce/decisions.log ] || install -m 0640 -o "$uid" -g adm /dev/null /var/log/urutau-enforce/decisions.log
install -m 0644 "$here/fail2ban-filter-urutau.conf" /etc/fail2ban/filter.d/urutau.conf
install -m 0644 "$here/fail2ban-action-urutau.conf" /etc/fail2ban/action.d/urutau-allports.conf
install -m 0644 "$here/fail2ban-jail-urutau.local" /etc/fail2ban/jail.d/urutau.local
[ -e /var/log/urutau-enforce/unban.log ] || install -m 0640 -o "$uid" -g adm /dev/null /var/log/urutau-enforce/unban.log
install -m 0755 "$here/urutau-unban" /usr/local/sbin/urutau-unban
install -m 0644 "$here/urutau-unban.path" "$here/urutau-unban.service" /etc/systemd/system/
systemctl daemon-reload
systemctl enable --now urutau-unban.path >/dev/null
fail2ban-client -t >/dev/null
fail2ban-client reload
echo "fail2ban jail 'urutau' on; the probe container mounts /var/log/urutau-enforce:/logs/enforce (rw)"
fi
if [ "$probe" = 1 ]; then
echo "probe host ready: create the probe on the hub (urutau probes create <name>) and start deploy/probe/docker-compose.yml"
fi
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
# Urutau: writes "<ip> <container name>" for every running container, so the
# egress analysis can name workloads whose address changes on each redeploy.
set -eu
out=/var/log/urutau/containers.map
tmp=$(mktemp /var/log/urutau/.containers.map.XXXXXX)
trap 'rm -f "$tmp"' EXIT
docker ps -q | xargs -r docker inspect -f '{{$n := .Name}}{{range .NetworkSettings.Networks}}{{if .IPAddress}}{{.IPAddress}} {{$n}}
{{end}}{{if .GlobalIPv6Address}}{{.GlobalIPv6Address}} {{$n}}
{{end}}{{end}}' | sed 's# /# #' | grep -E '^[0-9a-fA-F.:]+ [A-Za-z0-9_.-]{1,128}$' > "$tmp" || true
chgrp adm "$tmp"; chmod 0640 "$tmp"
mv -f "$tmp" "$out"
trap - EXIT
# The real upstream resolvers (systemd-resolved hides them behind 127.0.0.53),
# so DNS to the provider resolver is not reported as a bypass.
r=/var/log/urutau/resolv.conf
{
resolvectl dns 2>/dev/null | tr ' ' '\n' | grep -E '^([0-9]{1,3}\.){3}[0-9]{1,3}$|^[0-9a-fA-F]*:[0-9a-fA-F:]+$' || true
awk '/^nameserver/ {print $2}' /run/systemd/resolve/resolv.conf 2>/dev/null || true
} | grep -vE '^127\.' | sort -u | sed 's/^/nameserver /' > "$r.tmp"
chgrp adm "$r.tmp"; chmod 0640 "$r.tmp"; mv -f "$r.tmp" "$r"
# Ports this host serves (listening sockets, including the ones Docker
# publishes): connections to any other port are logged as probes.
if nft list set inet urutau_egress open >/dev/null 2>&1; then
{
echo "flush set inet urutau_egress open"
ss -Hlnt | awk '{print $4}' | sed -n 's/.*:\([0-9][0-9]*\)$/tcp . \1/p'
ss -Hlnu | awk '{print $4}' | sed -n 's/.*:\([0-9][0-9]*\)$/udp . \1/p'
} | sort -u | awk 'NR==1 {print; next} {e = e (e ? ", " : "") $0} END {if (e) print "add element inet urutau_egress open { " e " }"}' | nft -f -
fi
@@ -0,0 +1,7 @@
[Unit]
Description=Urutau: map container addresses to names
After=docker.service
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/urutau-containers-map
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=Urutau: refresh the container map every minute
[Timer]
OnBootSec=30s
OnUnitActiveSec=60s
AccuracySec=5s
[Install]
WantedBy=timers.target
+13
View File
@@ -0,0 +1,13 @@
#!/bin/bash
# Urutau: rewrites containers.map as soon as Docker attaches a container to a
# network, so a redeploy that swaps addresses between containers is not judged
# with the old names until the next minute of the timer.
set -u
docker events --filter type=network --filter event=connect --filter type=container --filter event=start --format '{{.Type}}' |
while read -r _; do
/usr/local/sbin/urutau-containers-map || true
# a stack redeploy fires dozens of events: drain the burst, then refresh once more
n=0
while read -r -t 1 _; do n=$((n + 1)); done
[ "$n" -gt 0 ] && { /usr/local/sbin/urutau-containers-map || true; }
done
@@ -0,0 +1,12 @@
[Unit]
Description=Urutau: refresh the container map when containers start
After=docker.service
Requires=docker.service
[Service]
ExecStart=/usr/local/sbin/urutau-containers-watch
Restart=always
RestartSec=5s
[Install]
WantedBy=multi-user.target
+67
View File
@@ -0,0 +1,67 @@
#!/usr/sbin/nft -f
# Urutau: logs NEW outbound connections (host and containers), and inbound
# probes to closed ports, so the egress
# analysis can spot beaconing, mining, spam and unauthorised scans.
# Lives in its own table: it never touches the iptables-nft tables of Docker
# or fail2ban, and it only logs (policy accept, no drop).
# @WAN@ is replaced by the uplink interface by install.sh.
#
# Volume control without blinding the beacon detector:
# - a (source, destination, protocol, port) seen in the last 2 h is ALWAYS
# logged (a beacon repeats the same pair, so a ceiling never hides it);
# - a NEW pair is logged under a per-source ceiling of 20/s (burst 100): an
# authorised scan (thousands of new pairs) is capped, and one noisy
# workload never eats the budget of the others.
table inet urutau_egress
delete table inet urutau_egress
table inet urutau_egress {
set rl4 { type ipv4_addr; flags dynamic; timeout 2m; size 65535; }
set rl6 { type ipv6_addr; flags dynamic; timeout 2m; size 65535; }
set seen4 { type ipv4_addr . ipv4_addr . inet_proto . inet_service; flags dynamic, timeout; timeout 2h; size 131072; }
set seen6 { type ipv6_addr . ipv6_addr . inet_proto . inet_service; flags dynamic, timeout; timeout 2h; size 131072; }
chain egress {
# only real connection attempts (SYN without ACK): replies of flows whose
# conntrack entry was recreated mid-flow (nf_conntrack_tcp_loose=1, e.g.
# after fail2ban drops only the original direction) are not egress
meta l4proto tcp tcp flags & (syn | ack) != syn return
# known pair: always log, refresh its timer
meta nfproto ipv4 meta l4proto { tcp, udp } ip saddr . ip daddr . meta l4proto . th dport @seen4 update @seen4 { ip saddr . ip daddr . meta l4proto . th dport } log prefix "URUTAU-EGRESS: " level info return
meta nfproto ipv6 meta l4proto { tcp, udp } ip6 saddr . ip6 daddr . meta l4proto . th dport @seen6 update @seen6 { ip6 saddr . ip6 daddr . meta l4proto . th dport } log prefix "URUTAU-EGRESS: " level info return
# new pair: per-source ceiling, then remember it
meta nfproto ipv4 meta l4proto { tcp, udp } add @rl4 { ip saddr limit rate 20/second burst 100 packets } add @seen4 { ip saddr . ip daddr . meta l4proto . th dport } log prefix "URUTAU-EGRESS: " level info return
meta nfproto ipv6 meta l4proto { tcp, udp } add @rl6 { ip6 saddr limit rate 20/second burst 100 packets } add @seen6 { ip6 saddr . ip6 daddr . meta l4proto . th dport } log prefix "URUTAU-EGRESS: " level info return
# other protocols (ICMP...) under the same ceiling, not remembered
meta nfproto ipv4 meta l4proto != { tcp, udp } add @rl4 { ip saddr limit rate 20/second burst 100 packets } log prefix "URUTAU-EGRESS: " level info
meta nfproto ipv6 meta l4proto != { tcp, udp } add @rl6 { ip6 saddr limit rate 20/second burst 100 packets } log prefix "URUTAU-EGRESS: " level info
}
# inbound probes: NEW connections to ports nobody listens on (port scans,
# RDP/SMB/database probing). @open is refreshed every minute by
# urutau-containers-map from `ss` (it also sees ports Docker publishes).
set open { type inet_proto . inet_service; }
set prl4 { type ipv4_addr; flags dynamic; timeout 2m; size 65535; }
set prl6 { type ipv6_addr; flags dynamic; timeout 2m; size 65535; }
chain probe_log {
type filter hook prerouting priority -150; policy accept;
iifname != "@WAN@" return
ct state != new return
meta l4proto != { tcp, udp } return
fib daddr type != local return
meta l4proto . th dport @open return
meta nfproto ipv4 add @prl4 { ip saddr limit rate 10/second burst 50 packets } log prefix "URUTAU-PROBE: " level info
meta nfproto ipv6 add @prl6 { ip6 saddr limit rate 10/second burst 50 packets } log prefix "URUTAU-PROBE: " level info
}
chain forward_log {
type filter hook forward priority filter - 10; policy accept;
ct state new oifname "@WAN@" iifname != "@WAN@" jump egress
}
chain output_log {
type filter hook output priority filter - 10; policy accept;
ct state new oifname "@WAN@" jump egress
}
}
+14
View File
@@ -0,0 +1,14 @@
[Unit]
Description=Urutau: egress connection log (nftables)
After=network-online.target docker.service
Wants=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/nft -f /etc/urutau/egress.nft
ExecStartPost=-/usr/local/sbin/urutau-containers-map
ExecStop=/usr/sbin/nft delete table inet urutau_egress
[Install]
WantedBy=multi-user.target
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
# Urutau: once a minute, (1) refresh the set of ports this host serves, (2) append
# the exact counters of the inbound observation table to ingress.counters.
#
# One line per run, cumulative since the table was loaded (the hub takes the
# difference between two lines; a drop means the table was reloaded):
# ts=1767225600 total=120 tcp=100 udp=15 icmp=5 open=30
# Read-only with respect to the network: it only reads counters and fills a set.
set -eu
t=inet
tab=urutau_ingress
out=${URUTAU_INGRESS_COUNTERS:-/var/log/urutau/ingress.counters}
nft list table "$t" "$tab" >/dev/null 2>&1 || exit 0
# Ports this host serves, so the chain can tell open from closed.
{
echo "flush set $t $tab open"
ss -Hlnt | awk '{print $4}' | sed -n 's/.*:\([0-9][0-9]*\)$/tcp . \1/p'
ss -Hlnu | awk '{print $4}' | sed -n 's/.*:\([0-9][0-9]*\)$/udp . \1/p'
} | sort -u | awk 'NR==1 {print; next} {e = e (e ? ", " : "") $0} END {if (e) print "add element inet urutau_ingress open { " e " }"}' | nft -f - || true
nft list counters table "$t" "$tab" | awk -v ts="$(date +%s)" '
/^[ \t]*counter / { name = $2 }
/^[ \t]*packets / && name != "" { v[name] = $2; name = "" }
END {
printf "ts=%s total=%d tcp=%d udp=%d icmp=%d open=%d\n", ts, v["in_total"], v["in_tcp"], v["in_udp"], v["in_icmp"], v["in_open"]
}' >> "$out"
+7
View File
@@ -0,0 +1,7 @@
[Unit]
Description=Urutau: inbound counters and served ports
After=urutau-ingress.service
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/urutau-ingress-tick
+10
View File
@@ -0,0 +1,10 @@
[Unit]
Description=Urutau: inbound counters every minute
[Timer]
OnBootSec=60s
OnUnitActiveSec=60s
AccuracySec=1s
[Install]
WantedBy=timers.target
+85
View File
@@ -0,0 +1,85 @@
#!/usr/sbin/nft -f
# Urutau: OBSERVES new inbound connection attempts that reach this host from
# outside (the "firewall" telemetry): TCP SYN without ACK, UDP and ICMP echo
# requests. Nothing else.
#
# It never drops, accepts, marks or rewrites a packet: every statement here is a
# counter, a rate limit that only gates the log statement, or a jump. Policy is
# accept and the chain does not touch established traffic.
#
# The chain hooks at prerouting priority -150: after the conntrack lookup, before
# Docker's DNAT (-100). Packets to DNAT'ed container ports and packets from
# sources that fail2ban or Urutau ban a moment later (and drop in INPUT or
# FORWARD, far past this hook) are all seen here.
#
# EXACT totals come from the named counters (read once a minute by
# urutau-ingress-tick, appended to /var/log/urutau/ingress.counters). The log
# lines are only a SAMPLE for details (ports, origins); the rate limits below
# decide how big the sample is. @WAN@ is replaced by the uplink interface.
#
# Not counted: anything that does not arrive on the uplink (loopback, Docker
# bridges, VPN), anything not addressed to this host, and sources that are
# loopback, private, link-local, CGNAT, multicast or one of this host's own
# addresses.
table inet urutau_ingress
delete table inet urutau_ingress
table inet urutau_ingress {
# Ports this host serves (listening sockets, including the ones Docker
# publishes), refreshed every minute by urutau-ingress-tick.
set open { type inet_proto . inet_service; }
counter in_total { }
counter in_tcp { }
counter in_udp { }
counter in_icmp { }
counter in_open { }
chain observe {
type filter hook prerouting priority -150; policy accept;
iifname != "@WAN@" return
fib daddr type != local return
fib saddr . iif type local return
ip saddr { 0.0.0.0/8, 10.0.0.0/8, 100.64.0.0/10, 127.0.0.0/8, 169.254.0.0/16, 172.16.0.0/12, 192.168.0.0/16, 224.0.0.0/3 } return
ip6 saddr { ::/128, ::1/128, fc00::/7, fe80::/10, ff00::/8 } return
meta l4proto tcp tcp flags & (syn | ack) == syn jump new_tcp
meta l4proto udp ct state new jump new_udp
meta l4proto icmp icmp type echo-request jump new_icmp
meta l4proto icmpv6 icmpv6 type echo-request jump new_icmp
}
chain new_tcp {
counter name in_total
counter name in_tcp
jump classify
}
chain new_udp {
counter name in_total
counter name in_udp
jump classify
}
chain new_icmp {
counter name in_total
counter name in_icmp
limit rate 2/second burst 10 packets log prefix "URUTAU-IN: " level info
}
# open vs closed: the open ones are counted, closed = (tcp + udp) - open,
# computed by urutau-ingress-tick, so the chain needs no negated lookup.
chain classify {
meta l4proto . th dport @open counter name in_open jump sample_open
meta l4proto . th dport @open return
jump sample_closed
}
# the sample: a ceiling that only gates the log statement
chain sample_open {
limit rate 5/second burst 25 packets log prefix "URUTAU-INO: " level info
}
chain sample_closed {
limit rate 10/second burst 50 packets log prefix "URUTAU-IN: " level info
}
}
+14
View File
@@ -0,0 +1,14 @@
[Unit]
Description=Urutau: inbound attempts observation (nftables, counters and log only)
After=network-online.target docker.service
Wants=network-online.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/nft -f /etc/urutau/ingress.nft
ExecStartPost=-/usr/local/sbin/urutau-ingress-tick
ExecStop=/usr/sbin/nft delete table inet urutau_ingress
[Install]
WantedBy=multi-user.target
+6
View File
@@ -0,0 +1,6 @@
[Unit]
Description=Urutau: rotate the egress log by size
[Service]
Type=oneshot
ExecStart=/usr/sbin/logrotate -s /var/lib/logrotate/urutau-egress.status /etc/logrotate.d/urutau-egress
+9
View File
@@ -0,0 +1,9 @@
[Unit]
Description=Urutau: check the egress log size every 10 minutes
[Timer]
OnBootSec=5m
OnUnitActiveSec=10m
[Install]
WantedBy=timers.target
+31
View File
@@ -0,0 +1,31 @@
#!/bin/sh
# Urutau: applies the operator's unban requests written by Urutau (UI button)
# to /var/log/urutau-enforce/unban.log. One line per request:
# 2026-11-15T05:00:00Z urutau unban ip=203.0.113.7 allow=86400
# The address is validated strictly; fail2ban unbans it from every jail and,
# with allow>0, ignores it in every jail for that many seconds (pentests).
set -eu
log=/var/log/urutau-enforce/unban.log
state=/var/lib/urutau/unban.offset
[ -f "$log" ] || exit 0
mkdir -p /var/lib/urutau
off=$(cat "$state" 2>/dev/null || echo 0)
size=$(stat -c %s "$log")
[ "$size" -lt "$off" ] && off=0 # rotated or truncated
tail -c +"$((off + 1))" "$log" | head -n 1000 | while IFS= read -r line; do
ip=$(printf '%s\n' "$line" | sed -n 's/^[0-9TZ:-]* urutau unban ip=\([0-9a-fA-F.:]\{2,45\}\) allow=\([0-9]\{1,7\}\)$/\1/p')
allow=$(printf '%s\n' "$line" | sed -n 's/^.* allow=\([0-9]\{1,7\}\)$/\1/p')
[ -n "$ip" ] || continue
# only literal IPv4 / IPv6 addresses (no CIDR, no names)
python3 -c 'import ipaddress,sys; ipaddress.ip_address(sys.argv[1])' "$ip" 2>/dev/null || continue
fail2ban-client unban "$ip" >/dev/null 2>&1 || true
logger -t urutau-unban "unban $ip allow=${allow:-0}"
if [ "${allow:-0}" -gt 0 ]; then
for j in $(fail2ban-client status | sed -n 's/.*Jail list:[[:space:]]*//p' | tr ',' ' '); do
fail2ban-client set "$j" addignoreip "$ip" >/dev/null 2>&1 || true
done
systemd-run --quiet --on-active="${allow}s" --unit="urutau-allow-end-$(printf '%s' "$ip" | tr ':.' '--')" \
/bin/sh -c "for j in \$(fail2ban-client status | sed -n 's/.*Jail list:[[:space:]]*//p' | tr ',' ' '); do fail2ban-client set \$j delignoreip $ip; done" 2>/dev/null || true
fi
done
echo "$size" > "$state"
+8
View File
@@ -0,0 +1,8 @@
[Unit]
Description=Urutau: watch the operator's unban requests
[Path]
PathModified=/var/log/urutau-enforce/unban.log
[Install]
WantedBy=multi-user.target
+6
View File
@@ -0,0 +1,6 @@
[Unit]
Description=Urutau: apply the operator's unban requests
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/urutau-unban
+14
View File
@@ -0,0 +1,14 @@
/var/log/urutau/egress.log /var/log/urutau/probe.log /var/log/urutau/ingress.log /var/log/urutau/ingress.counters {
daily
rotate 7
maxsize 200M
maxage 7
compress
delaycompress
missingok
notifempty
create 0640 syslog adm
postrotate
/usr/lib/rsyslog/rsyslog-rotate
endscript
}
+12
View File
@@ -0,0 +1,12 @@
# Variables read by deploy/probe/docker-compose.yml.
# Image tag: latest (last release), X.Y.Z (pinned) or edge (main).
URUTAU_VERSION=latest
URUTAU_PROBE_IMAGE=git.lucasrguerra.dev.br/ciberfauna/urutau-probe
# Hub address: https://... (http only for loopback or private addresses).
URUTAU_HUB=
# Name registered on the hub: urutau probes create <name>
URUTAU_PROBE_NAME=
# Token printed once by that command (urp_...). Never commit this file.
URUTAU_PROBE_TOKEN=
# Time zone of this host (fail2ban.log is local time; must match the hub's TZ).
TZ=UTC
+73
View File
@@ -0,0 +1,73 @@
# Urutau probe: one per server. It reads the host logs (read-only), sends the
# lines to the hub over HTTPS and appends the hub's ban decisions to a file. It
# opens no port: the connection goes out to the hub.
#
# urutau probes create <name> # on the hub: prints the token once
# cp .env.example .env # set URUTAU_HUB, URUTAU_PROBE_NAME, URUTAU_PROBE_TOKEN
# docker compose up -d
#
# Host kit (egress log, container map, optional fail2ban jail):
# sudo sh ../host/install.sh --probe [--enforce]
name: urutau-probe
services:
probe:
image: ${URUTAU_PROBE_IMAGE:-git.lucasrguerra.dev.br/ciberfauna/urutau-probe}:${URUTAU_VERSION:-latest}
environment:
# https://hub.example.org (plain http only to loopback or private hosts,
# e.g. http://urutau:8790 on the urutau-edge network).
URUTAU_HUB: ${URUTAU_HUB:?set URUTAU_HUB}
# The name registered on the hub with `urutau probes create`.
URUTAU_PROBE_NAME: ${URUTAU_PROBE_NAME:?set URUTAU_PROBE_NAME}
# urp_... token, shown once at creation. The hub keeps only its hash.
# Alternatively mount a file and set URUTAU_PROBE_TOKEN_FILE.
URUTAU_PROBE_TOKEN: ${URUTAU_PROBE_TOKEN:-}
URUTAU_STATE_DIR: /state
# Sources: a path turns it on, empty turns it off. Missing files wait.
URUTAU_TRAEFIK_LOG: ${URUTAU_TRAEFIK_LOG-/logs/traefik/access.log}
URUTAU_AUTH_LOG: ${URUTAU_AUTH_LOG-/logs/host/auth.log}
URUTAU_FAIL2BAN_LOG: ${URUTAU_FAIL2BAN_LOG-/logs/host/fail2ban.log}
URUTAU_PROBE_LOG: ${URUTAU_PROBE_LOG-/logs/host/probe.log}
URUTAU_EGRESS_LOG: ${URUTAU_EGRESS_LOG-/logs/host/egress.log}
# Firewall telemetry (host kit --ingress): sampled attempts and exact counters.
URUTAU_INGRESS_LOG: ${URUTAU_INGRESS_LOG-/logs/host/ingress.log}
URUTAU_INGRESS_COUNTERS: ${URUTAU_INGRESS_COUNTERS-/logs/host/ingress.counters}
URUTAU_EGRESS_CONTAINERS: ${URUTAU_EGRESS_CONTAINERS-/logs/host/containers.map}
URUTAU_RESOLV: ${URUTAU_RESOLV-/logs/resolv.conf}
# Where the hub's ban decisions land; applied by the host fail2ban jail.
# Empty ignores that kind of command.
URUTAU_ENFORCE_LOG: ${URUTAU_ENFORCE_LOG-/logs/enforce/decisions.log}
URUTAU_ENFORCE_UNBAN_LOG: ${URUTAU_ENFORCE_UNBAN_LOG-/logs/enforce/unban.log}
# Disk spool while the hub is unreachable; the oldest batches go first
# when it fills, and the loss is counted and shown on the hub.
URUTAU_PROBE_SPOOL_MAX: ${URUTAU_PROBE_SPOOL_MAX:-64MiB}
# Match the host: fail2ban.log timestamps are local time.
TZ: ${TZ:-UTC}
volumes:
# Directories, not single files: logrotate recreates files by rename and a
# file bind mount would keep following the old inode.
- /data/coolify/proxy/logs:/logs/traefik:ro
- /var/log/urutau:/logs/host:ro
- /etc/resolv.conf:/logs/resolv.conf:ro
# Decisions of the second firewall (read-write), only for ENFORCE=observe|on
# on the hub; needs deploy/host/install.sh --probe --enforce.
- /var/log/urutau-enforce:/logs/enforce
- urutau-probe-state:/state
group_add: ["4"] # adm: can read the logs in /var/log/urutau
read_only: true
cap_drop: [ALL]
security_opt:
- no-new-privileges:true
mem_limit: 64m # the probe stays under 20 MB of RSS
cpus: 0.25
restart: unless-stopped
# Only if the hub is the urutau service on the same host (internal address
# http://urutau:8790): join its network (create it with the hub's compose).
# networks: [urutau-edge]
volumes:
urutau-probe-state:
# networks:
# urutau-edge:
# external: true
+19 -23
View File
@@ -1,9 +1,11 @@
# Urutau: reads the Traefik access log, sshd auth log and fail2ban log of the
# host (read-only), classifies what it sees and serves the dashboard.
# Urutau hub: serves the dashboard and the API and receives the lines that the
# probes (one per server, see deploy/probe/docker-compose.yml) send over HTTPS.
# The hub reads no log file and mounts none.
#
# cp .env.example .env # set URUTAU_TOKEN (openssl rand -base64 48)
# docker compose pull && docker compose up -d # operators: published image
# docker compose up -d --build # developers: local build
# docker compose exec urutau urutau probes create <name> # token for a new probe
name: urutau
services:
@@ -14,18 +16,9 @@ services:
# Required: the service refuses to start without it (32+ characters and
# 128+ bits of entropy). Alternatively mount a file and set URUTAU_TOKEN_FILE.
URUTAU_TOKEN: ${URUTAU_TOKEN:-}
URUTAU_AUTH_LOG: /logs/host/auth.log
URUTAU_FAIL2BAN_LOG: /logs/host/fail2ban.log
URUTAU_NAME: ${URUTAU_NAME:-urutau}
# Your own servers: their events are dropped entirely (comma separated CIDRs/IPs).
URUTAU_TRUSTED: ${URUTAU_TRUSTED:-}
# Federation: other instances this one aggregates, e.g. hostinger=https://urutau.example.org
URUTAU_PEERS: ${URUTAU_PEERS:-}
# Shared secret for federation (32+ characters, different from URUTAU_TOKEN);
# it only opens /api/v1/peer/export. Empty disables the export.
URUTAU_PEER_TOKEN: ${URUTAU_PEER_TOKEN:-}
# Only these source networks may call the export (empty: any with the token).
URUTAU_PEER_ALLOW: ${URUTAU_PEER_ALLOW:-}
# Reverse proxies whose X-Forwarded-For is trusted. Only the dedicated
# urutau-edge network below, which holds nothing but this service and the
# reverse proxy: any other container there could forge client IPs.
@@ -38,23 +31,26 @@ services:
URUTAU_ADMIN_USERS: ${URUTAU_ADMIN_USERS:-}
# Geo database refresh interval (0 disables the download).
URUTAU_GEO_UPDATE: ${URUTAU_GEO_UPDATE:-24h}
# Match the host time zone: fail2ban.log timestamps are local time.
# Download the official Tor exit/relay lists (on|off).
URUTAU_TOR_AUTO: ${URUTAU_TOR_AUTO:-on}
# Second firewall: off | observe | on. "on" queues ban decisions for the
# probe of each server, which appends them to its decisions.log, applied by
# the host fail2ban jail "urutau" (install the kit with
# deploy/host/install.sh --probe --enforce on every probe host).
URUTAU_ENFORCE: ${URUTAU_ENFORCE:-off}
URUTAU_ENFORCE_SHARE: ${URUTAU_ENFORCE_SHARE:-off}
URUTAU_ENFORCE_THRESHOLD: ${URUTAU_ENFORCE_THRESHOLD:-5}
# Outbound traffic analysis (auto | on | off) from the egress log each probe sends.
URUTAU_EGRESS: ${URUTAU_EGRESS:-auto}
# name=container-prefix:role, comma separated (see docs/configuration.md).
URUTAU_EGRESS_WORKLOADS: ${URUTAU_EGRESS_WORKLOADS:-}
URUTAU_EGRESS_RESOLVERS: ${URUTAU_EGRESS_RESOLVERS:-}
# Match the probes' time zone: fail2ban.log timestamps are local time and the hub parses them.
TZ: ${TZ:-UTC}
ports:
- "${URUTAU_PUBLISH:-127.0.0.1:8790}:8790"
volumes:
# Only a dedicated Traefik log directory, never the whole proxy directory
# (it holds acme.json and the dynamic configuration). Point Traefik's
# accesslog.filepath at /traefik/logs/access.log, which Coolify keeps in
# /data/coolify/proxy/logs on the host.
- /data/coolify/proxy/logs:/logs/traefik:ro
# A dedicated host directory holding only the sshd and fail2ban logs
# (rsyslog copies sshd there; fail2ban's logtarget points there). A
# directory, not single files: logrotate recreates them by rename, and a
# file bind mount would keep following the old inode. See docs/docker.md.
- /var/log/urutau:/logs/host:ro
- urutau-data:/data
group_add: ["4"] # adm: can read the logs in /var/log/urutau
networks: [urutau-edge]
read_only: true
cap_drop: [ALL]
+199 -32
View File
@@ -2,48 +2,85 @@
# Architecture
Urutau is one Go binary with no third-party dependency. Everything runs in one process.
Urutau is one Go binary with no third-party dependency. It runs in two roles: the **hub**, which holds the data and serves the dashboard and the API, and the **probe**, a tiny process on each monitored server that only reads log files and sends them to the hub. The same binary does both (`urutau serve` and `urutau probe`); a separate scratch image carries the probe.
```
cmd/urutau entry point: serve, doctor, version
internal/app flags, wiring, the log runner, doctor
cmd/urutau entry point: serve (hub), probe, probes, import, doctor, healthcheck, version
internal/app flags, wiring, the log runner (fed by the probes), probe-log parser, Tor lists, enforce and egress wiring, import, doctor
internal/tail rotation-aware file follower and rotated-file reader
internal/core event model, parsers (Traefik, sshd, fail2ban), classifier
internal/store in-memory state, summaries, merge, snapshot
internal/core event model, parsers (Traefik JSON and text, sshd, fail2ban), classifier, error classes
internal/store in-memory state, summaries, merge, snapshot, analytics, services, defense, roster
internal/rdns reverse DNS cache and forward-confirmed reverse DNS
internal/evlog on-disk event registry
internal/intel families, MITRE, network type, cadence, sessions, campaigns, verdicts, STIX, metrics
internal/fed hub that polls peers
internal/server HTTP handler, auth, embedded dashboard (web/)
internal/geo dependency-free MMDB reader and database updater (DB-IP Lite)
internal/ua User-Agent parser (browser, system, device, bot, attack tool)
internal/enforce second firewall: ban decisions, decision file, unban requests, operator allowances
internal/egress outbound connection analysis: workloads, findings (beacon, C2, mining, scan...)
internal/incidents tickets opened from egress findings or by hand, stored in incidents.json
internal/hub one node per probe: ingestion, commands queue, probe registry (probes.json)
internal/wire probe-hub protocol: messages, limits, command-line validation
internal/probeagent the probe: tailers, spool, client, command application
internal/fed in-process aggregation of the nodes (summaries, IP tables, live, study, geography)
internal/server HTTP handler, auth, API routes, HTML report, embedded dashboard (web/)
deploy/host host kit: nftables table, rsyslog, logrotate, container map, fail2ban jail, installer
```
The only dependency is the Go standard library.
## Data flow
```
Traefik access.log auth.log fail2ban.log
│ │ │
└──── tail.Follower (one goroutine per source) ────┐
▼
parse (core.ParseTraefik / ParseAuth / ParseFail2ban) → Event
▼
── on each monitored server: the probe (urutau probe) ──────────────────────
Traefik access.log auth.log fail2ban.log probe.log egress.log
│ │ │ │ │
└──── tail.Follower (one goroutine per source, rotation-aware) ┘
containers.map and resolv.conf: whole file when it changes (sha256)
▼
batch (up to 5000 lines / 1 MiB / 1 s) ──► disk spool ──► HTTPS push
│
── on the hub (urutau serve) ───────────────────────────────────────▼─────
one node per probe (own store, evlog, incidents, enforce, egress)
offset check (inode or end > saved offset) ──► duplicate lines dropped
▼
parse (core.ParseTraefik / ParseAuth / ParseFail2ban / probe parser) → Event
▼
trusted CIDRs? drop. monitoring UA and benign? count aside.
▼
store.Ingest: counters, per-IP record, live feed
▼
snapshot every 60 s ◄── state ──► summaries / IP table / SSE
▼
classify (core): category, error class, forge browsing exempt
▼
store.Ingest: counters, per-IP record, live feed ──► evlog (events/)
▼
intel (computed on demand): family, MITRE, network type, cadence, sessions,
campaigns, verdict ──► dashboard, API, STIX, blocklist, HTML report
▼
enforce (optional): decision per attacking IP ──► command queue of the node
▼
probe long-poll receives it, validates the line, appends to decisions.log
▼
host fail2ban jail "urutau" reads decisions.log and bans in the firewall
▼
fail2ban.log "Ban urutau" returns as an event (not counted as evidence)
egress lines ──► egress.Source ──► findings
findings ──► incidents (tickets INC-n, suppression) ──► API and report
```
Snapshot every 60 s: `state` ◄──► summaries, IP table, SSE. Neither the hub nor the probe gains privileges: the probe only appends lines to a file that a jail on the host reads, and only after validating that each line has exactly the shape the hub's ban code produces.
## Sources
Each source is followed by its own goroutine and reports a state: `following`, `waiting` (the file does not exist yet), `backfill` (first start, reading rotated copies) or `error`. A line larger than 64 KiB is dropped and counted as malformed. On the first start without a snapshot, the rotated copies (`path.1`, `path.N.gz` up to 9) are read oldest first so the window is not empty.
Each source is followed by its own goroutine **in the probe** and the hub reports its state: `following`, `waiting` (the file does not exist yet), `backfill` (first start, reading rotated copies), `degraded` (more than 20% of the last 1000 lines are unreadable, with at least 50 samples) or `error`. A line larger than 64 KiB is dropped and counted as malformed. On the first start without a snapshot, the rotated copies (`path.1`, `path.N.gz` up to 9) are read oldest first so the window is not empty.
Lines are decoded as follows:
- **Traefik:** one JSON object per line. Client address, host, method, path, status and User-Agent are read; paths and User-Agents are clipped.
- **Traefik:** one JSON object per line; the default text format is read too, with fewer fields (no host or service). Client address, host, method, path, status and User-Agent are read; paths and User-Agents are clipped.
- **sshd:** the lines of `auth.log` with ISO timestamps. Failed passwords and keys, invalid users, closed-before-auth connections and `Accepted` logins; negotiation errors, banner exchange failures and protocol mismatches count as probes.
- **probe:** the `URUTAU-PROBE:` lines that the host kit logs for inbound connections to ports nobody listens on (`--probe-log`). Each becomes a `scanner` event with source `probe` (MITRE T1046), at most one per address, port and protocol per minute.
- **ingress, ingresscnt:** the firewall telemetry of the host kit (`--ingress`), described under "Firewall telemetry". They are not event sources: nothing is parsed into an event.
- **fail2ban:** `Ban`, `Unban` and `Restore Ban` lines. A restored ban (replayed after a fail2ban restart) updates the ban state and is not scored.
Log file paths are never exposed: neither the dashboard nor a peer export shows where a source reads from, only its name and state.
The egress log (`--egress-log`) has its own source, described in the egress section. Log file paths never leave the probe, and the hub never shows them: the dashboard shows only the name and state of a source. The hub reads no log file at all.
Lines that are valid but carry nothing to record are ignored silently; lines that cannot be parsed are counted as malformed and shown per source in the dashboard.
@@ -71,6 +108,8 @@ The level combines the score with evidence:
- **Never hostile:** an IP with a successful SSH login (`ssh-ok`), which is most likely you.
- Otherwise **low**.
Pages of a code forge that show repository content (Gitea or Forgejo `/owner/repo/src/commit/<sha>/<file>`, GitHub and GitLab `blob`, `tree`, `raw`, `blame`, `commits`) are not probes even when the file is called `.env` or `.gitignore`; `/.env`, `/.git/config` and traversal are unchanged. A fail2ban ban made by the `urutau` jail (our own decision) or by `recidive` (which only repeats bans) is not evidence: it adds no score, no strong signal and no blocklist listing. Bans of independent jails (sshd, traefik) count.
IPv6 clients are tracked by their /64 prefix, since one subscriber holds a whole /64 and per-address keys would let one attacker flood the table. IPs are tracked up to 20,000 entries.
The malicious categories (`scanner`, `exploit`, `bruteforce`, `ssh-fail`, `ssh-probe`) feed the "malicious" totals.
@@ -123,27 +162,37 @@ This is why the number differs from Coolify's analytics, which counts every dist
`GET /api/v1/events/stream?visits=1` adds anonymous visit events to the live stream. A visit carries no address, User-Agent or referrer; its place is the city, with coordinates rounded to one decimal (about 11 km). At most 20 visit events per second per instance are sent (the excess is summarised once a second as a batch), and visits are only broadcast to subscribers: never written to the event log, a snapshot or `live/recent`.
## Firewall telemetry
`internal/ingress` aggregates what the application logs cannot see: new inbound attempts to the host, including ports where nothing listens and packets from banned addresses that the firewall drops without a log line. The host kit table `urutau_ingress` observes at prerouting priority -150 (before Docker's DNAT) and only counts and logs. The probe tails two files as the wire sources `ingresscnt` (`ingress.counters`: `ts=... total=... tcp=... udp=... icmp=... open=...`, cumulative, one line a minute) and `ingress` (`ingress.log`, the sampled `URUTAU-IN:` and `URUTAU-INO:` kernel lines); it imports nothing of the hub and stays tiny. In the hub each node keeps an `ingress.Agg`: the delta of two counter lines is added to the hourly bucket of its timestamp (a decrease is a table reload and restarts from zero; a delta above 2^40, a timestamp more than an hour ahead or older than 30 days is dropped as malformed), and each sampled line adds to the bucket's logged count, top destination ports, top origin ASNs and countries (hub geo) and to the banned count when the store reports a jail ban on the source at that moment. Every field is length-limited when parsed (log lines over 2 KB and counter lines over 256 bytes are refused, sources must be public unicast, TCP needs SYN without ACK). Buckets are hourly for 30 days, each with top lists capped at 48 ports, 48 networks and 64 countries, saved to `ingress.json` once a minute when changed.
The aggregate is deliberately isolated: it receives the store's ban state and geo as two functions and has no way to emit an event, a score or a decision, so attempts from a banned address are never new evidence (no ban feedback loop with the second firewall, the `port-scan` family included). `GET /api/v1/ingress?range=24h&host=all|<name>[,<name>]` returns `{hosts, enabled, from, to, source{state,last_counters,last_line,lines,counter_lines,malformed}, totals{attempts,tcp,udp,icmp,open,closed,closed_pct,per_hour}, sample{logged,logged_banned,ratio,banned_pct,banned_est}, hourly[{t,total,open,closed,logged}], ports[{proto,port,n,served,pct}], asns[{asn,org,n,pct}], countries[{cc,n,pct}]}`. `totals` is exact; `sample`, `ports`, `asns` and `countries` come from the sample, and `ratio` is `logged / attempts`. `urutau doctor` checks that the last counters line of each host is under 5 minutes old.
## Event registry
`<data-dir>/events/` holds one JSON line per event, in the same format as the live stream, one file per UTC day. The current day is appended to and synced every 2 seconds; older days are gzip compressed. Files older than the retention are deleted, and the total is capped by `--events-max` (512 MB by default, `0` disables the registry). A day holds at most 200,000 lines; beyond that, events are only counted.
What enters: malicious events (scanner, exploit, bruteforce, ssh-fail, ssh-probe), ban and unban, successful SSH logins, a 404 answered to an attack tool, and `ok` or `notfound` answers only for addresses that are already suspicious or hostile (to show what they got). Never a legitimate visitor. Events relayed from peers are registered with the peer name as host.
What enters: malicious events (scanner, exploit, bruteforce, ssh-fail, ssh-probe), ban and unban, successful SSH logins, a 404 answered to an attack tool, and `ok` or `notfound` answers only for addresses that are already suspicious or hostile (to show what they got). Never a legitimate visitor. Each event is registered with the name of the probe that sent it as host.
Failure behavior: a full disk, the size cap or the day cap drop events (counted, logged at most once in a while, never fatal); a corrupted line is skipped when reading; a partial line left by an earlier failure is terminated before the next write.
### How studies read the registry
Period, funnel, metrics, campaigns and the other studies read the registry through `evlog.ScanRecs` and `ScanRefs`. A closed day (any day before the current UTC day) never changes, so it is decoded once into a compact form (strings interned per day, 112 bytes per event) and kept in memory under a cap of 96 MB (`evlog.Options.CacheMem`, negative disables it), least recently used first. A day is read again when the size or modification time of its files changes (a late line, a compression pass). The current day is always read live from the file, so the result matches a full scan exactly; sessions and campaigns that cross midnight are built over the events of the whole window, never per day. A study holds only 16-byte references to the decoded events and rebuilds those of one address when it builds that address' sessions (in parallel). Period, funnel and metrics of the same window share one scan and one set of sessions for the 30 s result lifetime. The byte budget (256 MB) counts only what is read from disk; the event count (1,500,000) and the 10 s deadline remain, and `truncated` is true only when one of them is hit (the dashboard then shows a note). First request after a restart decodes the days (3 in parallel); later ones are served from memory.
## Intelligence
The investigation layer is computed from the IP table and the registry, with no external API:
- **Attack families** (`traversal`, `log4shell`, `sqli`, `xss`, `rce-injection`, `webshell`, `env-credentials`, `vcs`, `backup`, `wordpress`, `phpmyadmin-db`, `actuator-debug`, `iot-cgi`, `admin-panel`, `generic-404`) and the **MITRE ATT&CK** techniques they map to.
- **Network type** from the ASN, the AS organisation and reverse DNS: `vpn`, `research-scanner`, `isp-cn`, `hosting`, `mobile`, `isp/mobile`, `residential`, `unknown`, and `tor` when the address is in the `--tor-exits` file (reloaded every 24 hours when it changes).
- **Network type** from the ASN, the AS organisation and reverse DNS: `vpn`, `research-scanner`, `isp-cn`, `hosting`, `mobile`, `isp/mobile`, `residential`, `unknown`, and `tor` when the address is in the `--tor-exits` file (reloaded every 24 hours when it changes) or in the official lists that `--tor-auto` (on by default) downloads every 6 hours into `<data-dir>/tor`.
- **Cadence** of the requests of one IP: `automated`, `human-like`, `mixed` or `insufficient` (fewer than 3 requests).
- **Sessions:** bursts of one IP separated by a gap (30 minutes by default), each with a stage in increasing severity: `recon`, `probe`, `exploit`, `access`, `banned`.
- **Campaigns:** at least 3 IPs whose sessions have the same signature (similar normalized paths, Jaccard 0.6 or more, same tool) within a window; the signature id is `c-` plus 8 hex characters.
- **Exposure:** a 2xx answer to a request on a sensitive path.
- **Verdict with reasons**, each reason a stable code with a weight (`exploits_refused`, `tool_ua`, `banned_jail`, `multi_category`, `exposure`, `ssh_login_after_bruteforce`, `admin`, `immune`), and **recommended actions** (`block`, `report`, `investigate`, `incident`); administrators and immune sources get none.
- **STIX 2.1** export of an IP (`/api/v1/ip/{ip}/stix`), with deterministic UUIDv5 ids.
- **Crawlers:** a User-Agent claiming Googlebot or Bingbot is confirmed by forward-confirmed reverse DNS; a fake one stays an attacker.
- **Crawlers:** a User-Agent claiming Googlebot (and its variants such as GoogleOther), Bingbot or Applebot is confirmed by forward-confirmed reverse DNS (`googlebot.com`, `google.com`, `search.msn.com`, `applebot.apple.com`); a fake one stays an attacker, and a confirmed crawler is excluded from bans whatever its User-Agent says.
- SSH users listed in `--admin-users` are marked as administrators.
## Metrics
@@ -163,33 +212,151 @@ The investigation layer is computed from the IP table and the registry, with no
| `exploits_refused_pct` | exploit requests answered 4xx or 5xx / exploit requests with a status, in percent |
| `mttb` | median and 90th percentile of the time from first sighting to ban |
| `ban_coverage` | hostile IPs banned / hostile IPs, in percent |
| `blocklist_coverage` | hostile IPs that are listable (global addresses) / hostile IPs, in percent |
| `blocklist_coverage` | hostile IPs that are protected (on the published blocklist or banned by any jail) / hostile IPs, in percent; `GET /api/v1/defense` also gives `blocklist.attackers`, `covered`, `one_shot` (single-event attackers, impossible to block reactively), `repeat_ips`, `repeat_covered` and `repeat_coverage_pct` |
| `blocklist_leak` | hostile IPs neither banned nor listable (a count) |
| `ssh.fails_24h`, `ssh.users_distinct`, `ssh.ok_after_fail` | SSH failures in 24 h, distinct users tried in 24 h, sessions with a failure and then a successful login |
| `concentration.top10_ips`, `top5_asns` | share of malicious events from the 10 busiest IPs and the 5 busiest ASNs, in percent |
Sessions, exposure, refused exploits and `ok_after_fail` need the event registry and read at most a bounded number of events (`truncated` says when the window was cut).
## Second firewall
`internal/enforce` is optional (`--enforce=off|observe|on`). Urutau decides which attacking addresses deserve a ban and appends one line per decision to `--enforce-log`; the host fail2ban jail `urutau` reads the file and applies the ban. The process gets no privileges. In `observe` mode decisions stay in memory and the interface shows what would be banned.
Rules (the first that matches, per address):
- 2 critical events (traversal, log4shell, sqli, rce, webshell, env, vcs) in 10 minutes.
- SSH: `--enforce-threshold` failures in 10 minutes (default 5); an `ssh-probe` counts half a failure.
- Port scan: 10 distinct ports probed in 10 minutes (reason `port-scan`).
- Web: `--enforce-threshold` attack events in 10 minutes (dominant reason, otherwise `scanner-flood`).
- Neighbor: 3 or more distinct addresses of the same /24 (IPv4) or /64 (IPv6) were banned in the last 24 hours and another address of the prefix attacks (`neighbor-campaign`).
- Known attacker: the verdict is hostile, or suspicious with a score of 100 or more (`known-attacker`).
- Slow attackers: 10 SSH failures or 20 web scan/exploit events in 24 hours; 10 SSH failures or 10 web scan/exploit events in 7 days (the web one only without a legitimate visit).
A sweep every 10 minutes, and after the start-up backfill, applies the same rules to the addresses active in the last 24 hours that nothing blocks yet. At most `--enforce-max-per-min` decisions are written per minute (default 60); the excess is dropped and counted. The advisory TTL grows with the number of earlier bans: 1 h, 6 h, 24 h, 7 d.
Never banned: private and reserved ranges, `--trusted`, the Cloudflare ranges, well known public resolvers, the addresses of the probes and the servers' own addresses, a verified crawler, an address with a legitimate visit in the last 24 hours, and an operator allowance (below). Each skip is counted by reason.
Decision file, one line per ban (`MaxLogBytes` 20 MB, then rotated to `.1`):
```
2026-11-15T10:00:00Z urutau decision=ban ip=203.0.113.9 reason=ssh-bruteforce score=75 ttl=3600 host=web1 src=local
```
Nothing the attacker controls enters the line: the address is re-formatted, the reason must be one of a fixed list of slugs and the host and source names are reduced to `[A-Za-z0-9._-]`. State (bans, allowances, counters) goes to `<data-dir>/enforce.json`.
Unban: `POST /api/v1/enforce/unban` appends `<time> urutau unban ip=<ip> allow=<seconds>` to the unban file (`--enforce-unban-log`, by default `unban.log` next to the decision file); a systemd path unit of the host kit lifts the fail2ban block. With `allow` above zero the engine does not ban the address again for that long (at most 30 days); `DELETE /api/v1/enforce/allow` ends the allowance.
Sharing (`--enforce-share=on`): a decision taken by the node of one probe is also queued for the nodes of the others. Each node applies its own exclusions, accepts only the fixed reason slugs, caps the TTL at 6 hours, and bans on another node's word only an address it also saw attacking in the last 7 days (otherwise the skip is `peer_unconfirmed`).
## Egress analysis
`internal/egress` reads the nftables log of new outbound connections (`--egress=auto|on|off`, `--egress-log`; `auto` turns it on when the file exists). The host kit logs only TCP connection attempts (SYN without ACK) under the prefix `URUTAU-EGRESS:`. The state is in memory: on start the rotated copies and the live file are replayed, which rebuilds the beacon history.
A **workload** is a group of sources (a CIDR, an address, `host` for the host's own traffic, or a container name or prefix from the `containers.map` file the host kit writes) with a role: `default`, `scanner`, `mail` or `resolver` (`--egress-workloads`). The principle: traffic shaped like a scan is suppressed only for `scanner` workloads; everything else is judged the same for all of them.
Findings (`kind`, severity):
| Kind | Meaning |
|---|---|
| `beacon` | regular conversation with one destination: at least 8 connections within 30 minutes with an interval between 10 s and 6 h and a low jitter |
| `infra` | the same pattern toward cloud metadata services, the provider or the servers themselves (informational) |
| `bad_dst` | contact with an address that attacked this server |
| `tor` | connection to a Tor relay |
| `port` | SMTP from a non-mail workload, IRC, mining pool (stratum) or Tor ORPort ports |
| `dns_bypass` | DNS (53) or DoT (853) to a public address that is not an allowed resolver |
| `scan` | fan-out of more than 50 destinations or 100 ports in 10 minutes, outside `scanner` workloads |
| `new_geo` | first contact with a country after the workload's learning time (24 h) |
Destinations of the probes, trusted addresses and the server's own public addresses never raise findings, and regular connections to large CDNs and clouds are low severity unless the destination attacked the server. Limits: 50,000 pairs and destinations, 2,000 findings, 720 hourly buckets. `GET /api/v1/egress` returns the findings, workloads, countries and an hourly timeline; the hub merges the egress report of every node. The egress settings (workloads, resolvers, allowed destinations) are kept per probe on the hub, in `probes.json`.
## Incidents
`internal/incidents` keeps tickets `INC-<n>` in `<data-dir>/incidents.json` (atomic write, 0600; a corrupt file is moved to `.corrupt`). Every egress finding with severity above `info` becomes a ticket keyed by `host|kind|workload|dst|dport|proto`, created by a sync on each merged egress report and every 60 seconds; a resolved ticket reopens when the finding reappears. A ticket has status (`open`, `investigating`, `true_positive`, `false_positive`, `benign`, `resolved`), severity, assignee, up to 10 tags, verdict, comments and a change history. Limits: 5,000 tickets, 200 comments and 500 history entries each. A ticket in `false_positive` or `benign` can suppress exactly its key for 30 days (90 at most); suppressed findings leave `/api/v1/egress` unless `?suppressed=1`. A host with more than 300 active tickets has the excess grouped in one flood ticket. Writes refuse cross-site requests, and every write is logged (id, field, author).
## HTML report
`GET /api/v1/report?format=html` renders one self-contained A4 document (cover, executive summary, recommendations by rule, threats, geography, errors and health, visitors, defense, second firewall and outbound traffic) in the language of `lang`. The text goes through `html/template` and the charts are SVG built from escaped values, so no log text reaches the page unescaped. `format=json` returns the same figures.
## State and persistence
The state lives in memory: minute buckets for the latest 48 hours and hourly data up to 30 days, hourly top lists (paths, domains, User-Agents, users), a table of up to 20,000 IPs (when full, the 10% with the lowest score are evicted; banned IPs are kept), a feed of the latest 500 events and the active bans. `--retention` (1h to 168h) bounds how long IPs are kept; old IPs are pruned every 10 minutes.
Each node (one per probe) keeps its own state in memory: minute buckets for the latest 48 hours and hourly data up to 30 days, hourly top lists (paths, domains, User-Agents, users), a table of up to 20,000 IPs (when full, the 10% with the lowest score are evicted; banned IPs are kept), a feed of the latest 500 events and the active bans. `--retention` (1h to 720h) bounds how long IPs are kept; old IPs are pruned every 10 minutes.
Every 60 seconds, and on shutdown, the state is written to `urutau-state.gob` in the data directory together with the inode and offset of every source. On start it is restored and each source resumes exactly where it stopped, so a restart never counts a log twice. A snapshot is skipped while a backfill runs. An unreadable snapshot is moved to `urutau-state.gob.corrupt` and the service starts empty, reading the logs again (including the rotated copies).
Every 60 seconds, and on shutdown, each node writes its state to `urutau-state.gob` together with the inode and offset of every source. The primary node (the probe whose name equals `URUTAU_NAME`) uses the data-dir root, exactly the 1.x layout; the others use `<data-dir>/probes/<name>/`. On start the state is restored and the hub tells each probe, in the `hello`, the offsets it has, so a restart of either side never counts a line twice and never loses one. A snapshot is skipped while a backfill runs. An unreadable snapshot is moved to `urutau-state.gob.corrupt` and the service starts empty, reading the logs again (including the rotated copies).
The process sets a soft memory limit of 256 MiB unless `GOMEMLIMIT` is set. The worst case measured is about 54 MiB of heap and a snapshot of about 27 MB.
## Federation
## Probes and the hub
A hub is an ordinary instance started with `--peer name=https://url`, and it needs `URUTAU_PEER_TOKEN`. Every 15 seconds it calls each peer's `GET /api/v1/peer/export?range=...` (for the background ranges `1h`, `24h`, `7d` and `30d`; any other range or custom period is fetched on demand) with the peer token and keeps the latest answer. The export is `{"v":1,"summary":...,"traffic":{...}}` with the top 500 IPs and their detail, cached for 5 seconds on the peer. The peer token opens three routes: the export, the live stream and `GET /api/v1/peer/period`, the study (sessions, campaigns, metrics) the hub merges for a period or an IP; a peer runs at most two studies at once. The hub never follows redirects, requires `https` outside loopback, uses a 4 second timeout, caps the body at 8 MB and sanitizes and caps whatever a peer sends. A peer that fails is marked offline and the others carry on. The dashboard host selector then offers `all`, the hub itself and each peer; summaries, traffic and IP tables are merged, and every row carries the host it came from.
The probe is a client of the hub: it opens no port. Plain HTTPS, no WebSocket, so any reverse proxy or CDN works (requests are short; the long-poll lasts at most 25 s). Authentication is `Authorization: Bearer urp_...` plus `X-Urutau-Probe: <name>`. The hub keeps only the SHA-256 of each token (`probes.json`) and compares in constant time; a wrong token is a bare 401 under the same attempt limiter as the login. Plain `http://` is accepted only for loopback or private addresses (for example `http://urutau:8790` on the `urutau-edge` network).
### Live relay
| Route | Purpose |
|---|---|
| `POST /api/v1/probe/hello` | start of every session: protocol version in, the offsets the hub holds out (a probe without local state starts from them). 409 on an incompatible version |
| `POST /api/v1/probe/push` | one batch (`seq`, up to 5000 lines, optional gzip, 2 MiB on the wire and 8 MiB inflated, a line of 64 KiB at most) and the probe status. The hub applies the whole batch to the node, then answers `ack = seq`; a repeated `seq` is answered without being applied again. 503 with `Retry-After` while the node loads or its queue is full, 429 for a second concurrent push |
| `GET /api/v1/probe/commands?after=<seq>&wait=<s>` | long-poll (at most 25 s) for ban and unban lines; answers at once when the queue has a command newer than `after` |
Besides the export, a hub keeps one `GET /api/v1/peer/stream` connection open per peer (a subscription per peer, with the peer's own token) and relays the live malicious events to its dashboard. What comes from a peer is bounded and sanitized: at most about 50 events per second per peer, lines of at most 16 KB, a buffer of the latest 500 relayed events (served by `/api/v1/live/recent`), and reconnection with backoff from 1 s up to 60 s. A peer serves at most 10 stream connections.
**Spool.** Before sending, the probe writes each batch to `<state-dir>/spool/NNNNNNNNNNNN.json` and sends them in order, so a hub outage loses nothing. The spool is capped by `URUTAU_PROBE_SPOOL_MAX` (64 MiB by default); beyond it the oldest batch is deleted and its lines are added to the `dropped` counter of the probe status, which the Sources page shows. `state.json` records the batch sequence, the last command applied and the read position of every source, written atomically after each ack. After an error the probe reconnects with exponential backoff from 1 s to 60 s with a 20% jitter.
**Offsets.** The hub is the authority: it keeps the offset of each source in the snapshot of the node and accepts a line only if its inode differs from the saved one or its end offset is past it. Replaying a spool, or importing a 1.x data directory (`urutau import`), therefore neither duplicates nor skips lines.
**Liveness.** With nothing to send, the probe pushes an empty batch with its status every 15 s; the hub marks it offline after 45 s without a push.
**Commands.** The hub queues up to 10,000 commands per node (`commands.json`); the oldest are dropped and counted. The probe accepts a command only if `wire.ValidCmdLine` passes (the exact format of a ban or unban line, with a valid address, reason slug and TTL), appends it with `O_APPEND` and `fsync`, and records the sequence so that a repeated command is not written twice. An invalid line is counted in `cmd_errors` and never written. A probe whose `URUTAU_ENFORCE_LOG` is empty ignores ban commands and counts the error.
**Footprint.** The probe never calls geolocation, intelligence or the store; its memory target is under 20 MB of RSS, checked by a test, and its image is under 15 MB.
### Aggregation across probes
`internal/fed` joins the nodes in the process (no HTTP any more): the dashboard host selector offers `all` and each probe; summaries, traffic, IP tables, studies and the live feed merge the nodes and every row carries the host it came from. An incident is identified as `host/INC-n` (each node numbers its own); a bare `INC-n` means the primary node.
### Geography aggregation
`GET /api/v1/geo` is computed from the IP table (local and the peers' exports) joined with the geolocation databases: countries first, then, for one country, its regions, cities and top IPs. Results are cached for 5 seconds, in a cache of at most 256 keys.
`GET /api/v1/geo` is computed from the IP table (of every node) joined with the geolocation databases: countries first, then, for one country, its regions, cities and top IPs. Results are cached for 5 seconds, in a cache of at most 256 keys.
## HTTP layer
The server sets read, write and idle timeouts, `MaxHeaderBytes` of 16 KB, caps `POST /login` at 4 KB and accepts at most 20 simultaneous live-stream (SSE) clients (the 21st gets 503 with `Retry-After`; each stream sends a heartbeat every 20 s). The handler uses the standard `net/http` mux. Every response carries a strict Content-Security-Policy (`default-src 'self'`), `X-Content-Type-Options`, `X-Frame-Options: DENY`, `Referrer-Policy: no-referrer`, cross-origin isolation headers and, over HTTPS, HSTS. API answers are `Cache-Control: no-store`. The dashboard files are embedded in the binary. See [interface.md](interface.md) for the routes and [configuration.md](configuration.md) for the settings.
The server sets read, write and idle timeouts, `MaxHeaderBytes` of 16 KB, caps `POST /login` at 4 KB and accepts at most 20 simultaneous live-stream (SSE) clients (the 21st gets 503 with `Retry-After`; each stream sends a heartbeat every 20 s). The handler uses the standard `net/http` mux. Every response carries a strict Content-Security-Policy (`default-src 'self'`), `X-Content-Type-Options`, `X-Frame-Options: DENY`, `Referrer-Policy: same-origin`, `Permissions-Policy`, cross-origin isolation headers and, over HTTPS, HSTS. API answers are `Cache-Control: no-store`. The dashboard files are embedded in the binary. See [interface.md](interface.md) for the pages and [configuration.md](configuration.md) for the settings.
## API routes
The user routes under `/api/v1/*` need `URUTAU_TOKEN` (bearer) or a session cookie; the `/api/v1/probe/*` routes need a probe token and nothing else opens them. The 1.x `/api/v1/peer/*` routes no longer exist (404). Analysis routes live in `internal/server/api_<name>.go` files and register themselves with `registerUserRoute`. Routes that take a range accept `range`, or `from` and `to`.
| Route | Purpose |
|---|---|
| `GET /api/health` | `{"status":"ok"}`, no authentication |
| `GET /login`, `POST /login`, `POST /logout` | session cookie |
| `GET /api/v1/summary` (also `own`: web requests of `--trusted` and `--ignore` origins, counted apart; `totals.trusted`, `totals.internal` and `totals.requests_all` = `requests` + both; `totals.counts.trusted` and `.internal`), `/traffic`, `/ips`, `/ip/{ip}`, `/ip/{ip}/stix` | totals, web analytics, IP table, one address, STIX 2.1 bundle |
| `GET /api/v1/period`, `/period/events`, `/events`, `/events/sessions` | study of a period, event registry search (cursor), sessions. `cat` takes a list of categories; a leading `!` negates it (`cat=!ok`, at most 100 characters) |
| `GET /api/v1/events/stream` | live stream over SSE (`?visits=1` adds anonymous visits) |
| `GET /api/v1/live/recent`, `/geo` | latest live events, geography |
| `GET /api/v1/metrics`, `/evolution`, `/concentration`, `/survival`, `/techniques`, `/sessions/funnel` | stable metrics and analytics |
| `GET /api/v1/campaigns`, `/campaigns/{id}` | campaigns |
| `GET /api/v1/services`, `/services/{svc}`, `/errors`, `/protocols` | SLO, error classes, protocols and TLS |
| `GET /api/v1/defense`, `/integrity` | blocklist coverage, bans, sources and data integrity |
| `GET /api/v1/blocklist.txt`, `/blocklist.json` | exportable blocklist (`?family=4\|6`) |
| `GET /api/v1/enforce`, `POST /enforce/unban`, `DELETE /enforce/allow` | second firewall |
| `GET /api/v1/egress` | outbound findings |
| `GET /api/v1/ingress` | firewall telemetry: inbound attempts per host (`range` and `host` as in the other endpoints; the probes of this hub only) |
| `GET /api/v1/incidents`, `/incidents/export.csv`, `/incidents/{id}`, `POST /incidents`, `PATCH /incidents/{id}`, `POST /incidents/{id}/comments` | tickets |
| `GET /api/v1/report` | report as JSON or HTML (`?format=`) |
| `GET /api/v1/probes`, `POST /probes`, `PUT /probes/{name}`, `DELETE /probes/{name}` | probe registry behind the Sources page: list with status, create (the token is shown once), edit location and egress settings, revoke (the data is kept) |
| `POST /api/v1/probe/hello`, `/probe/push`, `GET /probe/commands` | probe protocol, probe token only |
List endpoints (IPs, sessions, campaigns, events of an address) are paginated by the backend; event search pages by cursor.
## Files
| Where | What |
|---|---|
| `<data-dir>/urutau-state.gob` | snapshot of the primary node with the offset of every source (`.corrupt` when unreadable) |
| `<data-dir>/probes/<name>/` | the same layout (snapshot, `events/`, `incidents.json`, `enforce.json`, `commands.json`) for every other probe |
| `<data-dir>/probes.json` | registry of probes: name, SHA-256 of the token, location, egress settings (never the token) |
| `<data-dir>/events/YYYY-MM-DD.jsonl[.gz]` | event registry, one JSON line per event |
| `<data-dir>/geo/` | DB-IP Lite city and ASN databases |
| `<data-dir>/tor/` | cache of the Tor exit and relay lists |
| `<data-dir>/enforce.json` | state of the second firewall |
| `<data-dir>/incidents.json` | tickets |
| `<state-dir>/spool/`, `<state-dir>/state.json` | **on the probe:** pending batches, sequence, read positions, last command |
| `URUTAU_ENFORCE_LOG`, `URUTAU_ENFORCE_UNBAN_LOG` | **on the probe:** decision file read by the host jail and unban requests read by the host |
| `URUTAU_PROBE_LOG`, `URUTAU_EGRESS_LOG`, `URUTAU_INGRESS_LOG`, `URUTAU_INGRESS_COUNTERS`, `URUTAU_EGRESS_CONTAINERS` | **on the probe:** kernel logs and container map written by the host kit in `deploy/host` |
+87 -19
View File
@@ -3,25 +3,27 @@
# Terminal
```
urutau serve [flags] run the daemon and the dashboard
urutau serve [flags] run the hub: dashboard, API and probe ingestion (alias: urutau hub)
urutau probe [flags] run a probe: read local logs and send them to the hub
urutau probes create|list|revoke manage the probes registered on a hub
urutau import --from DIR --host NAME bring a 1.x data directory into a hub
urutau doctor [--json] [flags] check the sources and the data directory
urutau healthcheck [flags] exit 0 when the local daemon answers /api/health
urutau version print the version
urutau help print the usage
```
The access token is never a flag: `urutau serve` reads it from the `URUTAU_TOKEN` environment variable, or from the file named by `URUTAU_TOKEN_FILE`, so it does not show up in the process list. Tokens need at least 32 characters and about 128 bits of estimated entropy (length times Shannon entropy; periodic or sequential tokens are refused) (`openssl rand -base64 48` is recommended (`-hex 32` also works)). Every flag below has a `URUTAU_*` environment default; a flag wins over the variable. See [configuration.md](configuration.md).
The access token is never a flag: `urutau serve` and `urutau probe` read theirs (`URUTAU_TOKEN` and `URUTAU_PROBE_TOKEN`) from the environment variable, or from the file named by the same name with `_FILE`, so it does not show up in the process list. Tokens need at least 32 characters and about 128 bits of estimated entropy (length times Shannon entropy; periodic or sequential tokens are refused) (`openssl rand -base64 48` is recommended (`-hex 32` also works)). Every flag below has a `URUTAU_*` environment default; a flag wins over the variable. See [configuration.md](configuration.md).
## `urutau serve`
The hub reads no log file: the lines come from the probes ([architecture.md](architecture.md#probes-and-the-hub)). The 1.x log path flags (`--traefik-log`, `--auth-log`, `--fail2ban-log`, `--probe-log`, `--egress-log`, `--egress-containers`, `--enforce-log`, `--enforce-unban-log`) and the federation flags (`--peer*`) were removed; the hub refuses to start when their `URUTAU_*` variables are set, and the message points to [migration-2.0.md](migration-2.0.md).
| Flag | Variable | Default | Meaning |
|---|---|---|---|
| `--bind` | `URUTAU_BIND` | `0.0.0.0:8790` | listen address |
| `--name` | `URUTAU_NAME` | hostname | name of this instance |
| `--data-dir` | `URUTAU_DATA_DIR` | `/data` | directory of the snapshot (`urutau-state.gob`) |
| `--traefik-log` | `URUTAU_TRAEFIK_LOG` | `/data/coolify/proxy/access.log` | Traefik JSON access log; empty disables |
| `--auth-log` | `URUTAU_AUTH_LOG` | `/var/log/auth.log` | sshd log; empty disables |
| `--fail2ban-log` | `URUTAU_FAIL2BAN_LOG` | `/var/log/fail2ban.log` | fail2ban log; empty disables |
| `--name` | `URUTAU_NAME` | hostname | name of this instance, and of the primary probe: the one whose data lives in the data-dir root |
| `--data-dir` | `URUTAU_DATA_DIR` | `/data` | state directory: snapshot `urutau-state.gob`, `geo/`, `tor/`, `events/`, `incidents.json`, `enforce.json` of the primary probe, `probes/<name>/` of the others, `probes.json` |
| `--trusted` | `URUTAU_TRUSTED` | empty | CIDRs of trusted origins; their events are dropped entirely. `--ignore` / `URUTAU_IGNORE` is an alias |
| `--ignore` | `URUTAU_IGNORE` | `127.0.0.0/8,::1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7,fe80::/10,100.64.0.0/10,169.254.0.0/16` | same effect as `--trusted`, with the private ranges as default |
| `--monitor-ua` | `URUTAU_MONITOR_UA` | `(?i)^(Uptime-Kuma/\|Beszel\|Coolify\|kube-probe/\|Go-http-client/.*healthcheck)` | regular expression of monitoring User-Agents |
@@ -29,28 +31,84 @@ The access token is never a flag: `urutau serve` reads it from the `URUTAU_TOKEN
| `--domains` | `URUTAU_DOMAINS` | empty | allowlist of analytics domains (exact or `*.example.com`); empty tracks every domain that answers 2xx; recommended when a backend answers 2xx for any Host |
| `--geo-dir` | `URUTAU_GEO_DIR` | `<data-dir>/geo` | directory of the DB-IP Lite databases (city and ASN) |
| `--geo-update` | `URUTAU_GEO_UPDATE` | `24h` | how often to check for a newer database; `0` turns the download off |
| `--peer` | `URUTAU_PEERS` | none | peer `name=https://url`; repeat the flag, or comma separate the variable |
| `--peer-token` | `URUTAU_PEER_TOKEN` | empty | token shared with the peers; prefer the variable or `URUTAU_PEER_TOKEN_FILE` (a flag shows up in the process list). Per-peer: `URUTAU_PEER_TOKEN_<NAME>` |
| `--admin-users` | `URUTAU_ADMIN_USERS` | empty | SSH users whose successful login keeps their IP out of the blocklist for 24 h; the immunity is off unless set |
| `--peer-allow` | `URUTAU_PEER_ALLOW` | empty | source CIDRs allowed to call the federation routes; empty accepts any source with the token |
| `--peer-blocklist` | `URUTAU_PEER_BLOCKLIST` | `on` | `on` lists in the hub's blocklist the hostile IPs seen only by peers (score 50+ and a strong signal); `off` keeps the blocklist to this instance's own IPs |
| `--location` | `URUTAU_LOCATION` | empty | map position of this instance, `"lat,lon"` or `"lat,lon,Label"` |
| `--trusted-proxy` | `URUTAU_TRUSTED_PROXY` | `127.0.0.0/8,::1` (the compose file sets `10.250.0.0/24`) | proxies whose `X-Forwarded-For` is trusted, read right to left (login rate limit, `--peer-allow`) |
| `--location` | `URUTAU_LOCATION` | empty | default map position of the primary probe (each probe has its own, set on the hub), `"lat,lon"` or `"lat,lon,Label"` |
| `--trusted-proxy` | `URUTAU_TRUSTED_PROXY` | `127.0.0.0/8,::1` (the compose file sets `10.250.0.0/24`) | proxies whose `X-Forwarded-For` is trusted, read right to left (login rate limit, probe auth limiter) |
| `--retention` | `URUTAU_RETENTION` | `720h` | how long data is kept (1h to 720h, that is 30 days) |
| `--events-max` | `URUTAU_EVENTS_MAX` | `512MB` | size cap of the event registry in `<data-dir>/events`; `0` turns it off |
| `--tor-auto` | `URUTAU_TOR_AUTO` | `on` | `on` downloads the official Tor exit and relay lists every 6 h into `<data-dir>/tor`; `off` does not |
| `--tor-exits` | `URUTAU_TOR_EXITS` | empty | file with Tor exit addresses, one per line, reloaded every 24 h when it changes; empty disables |
| `--enforce` | `URUTAU_ENFORCE` | `off` | second firewall: `off`, `observe` (decide in memory only) or `on` (also write decisions for the host fail2ban) |
| `--enforce-share` | `URUTAU_ENFORCE_SHARE` | `off` | `on` also queues a decision taken for one probe on the others; each node applies its own exclusions |
| `--enforce-threshold` | `URUTAU_ENFORCE_THRESHOLD` | `5` | attack events in 10 minutes that justify a ban (1 to 1000) |
| `--enforce-max-per-min` | `URUTAU_ENFORCE_MAX_PER_MIN` | `60` | most decisions per minute, the excess is dropped and counted (1 to 10000) |
| `--egress` | `URUTAU_EGRESS` | `auto` | egress analysis: `auto` (on for a probe that sends an egress log), `on` or `off` |
| `--egress-workloads` | `URUTAU_EGRESS_WORKLOADS` | empty | default for the primary probe (per probe, edit them on the hub): `"name=ITEM,ITEM:role;..."`, roles `default`, `scanner`, `mail`, `resolver` ([configuration.md](configuration.md#egress-analysis)) |
| `--egress-resolvers` | `URUTAU_EGRESS_RESOLVERS` | empty | allowed DNS resolvers, comma separated; empty: the usual public ones plus the `resolv.conf` the probe sends |
| `--insecure-no-auth` | none | off | disable authentication; only on a loopback bind |
Validation at start: peers must be `name=https://host` (plain `http` only on loopback), `URUTAU_PEER_TOKEN` must be set and different from `URUTAU_TOKEN`, names must be unique and cannot be `all` or the instance's own name, `--retention` must be at least 1h (and at most 720h), and `URUTAU_TOKEN` and every peer token must have at least 32 characters and about 128 bits of estimated entropy; each peer needs a client token (`URUTAU_PEER_TOKEN_<NAME>` or the general `URUTAU_PEER_TOKEN` as fallback), and peer names must not collide in that variable name (unless `--insecure-no-auth` on a loopback address).
`URUTAU_EGRESS_ALLOW` and `URUTAU_EGRESS_PROVIDER_ASN` exist only as environment variables ([configuration.md](configuration.md)). `GOMEMLIMIT` and `TZ` are the standard ones.
Validation at start (any failure exits with code 1 before listening): `URUTAU_TOKEN` needs at least 32 characters and about 128 bits of estimated entropy (periodic or sequential tokens are refused), unless `--insecure-no-auth` on a loopback bind; none of the removed 1.x variables may be set; `--retention` from 1h to 720h; `--events-max` a valid size; `--location` valid; `--enforce-share` `on`/`off`; `--enforce` `off`/`observe`/`on`; `--enforce-threshold` 1 to 1000 and `--enforce-max-per-min` 1 to 10000; `--egress` `auto`/`on`/`off`; `--monitor-ua` a valid regular expression; `--ignore`, `--trusted`, `--trusted-proxy` and `--monitor-from` valid CIDRs or IPs.
```bash
export URUTAU_TOKEN=$(openssl rand -base64 48)
urutau serve --bind 127.0.0.1:8790 --data-dir ./data \
--traefik-log "" --auth-log /var/log/auth.log
urutau serve --bind 127.0.0.1:8790 --data-dir ./data
```
The daemon logs to stderr, saves a snapshot on `SIGTERM` or `SIGINT` and exits 0 on a clean stop.
## `urutau probe`
The probe runs on each monitored server. It opens no port: it follows the log files, spools them to disk and pushes them to the hub over HTTPS, and applies the ban and unban commands the hub sends ([architecture.md](architecture.md#probes-and-the-hub)). Flags and variables, all with the same rules as `serve`:
| Flag | Variable | Default | Meaning |
|---|---|---|---|
| `--hub` | `URUTAU_HUB` | required | hub URL; `https://`, or `http://` only for loopback and private addresses |
| `--name` | `URUTAU_PROBE_NAME` | required | name registered on the hub |
| none | `URUTAU_PROBE_TOKEN` or `URUTAU_PROBE_TOKEN_FILE` | required | token printed once by `urutau probes create` (`urp_...`); never a flag |
| `--state-dir` | `URUTAU_STATE_DIR` | `/state` | spool, positions and liveness mark |
| `--traefik-log` | `URUTAU_TRAEFIK_LOG` | `/logs/traefik/access.log` | Traefik access log; empty disables |
| `--auth-log` | `URUTAU_AUTH_LOG` | `/logs/host/auth.log` | sshd log; empty disables |
| `--fail2ban-log` | `URUTAU_FAIL2BAN_LOG` | `/logs/host/fail2ban.log` | fail2ban log; empty disables |
| `--probe-log` | `URUTAU_PROBE_LOG` | `/logs/host/probe.log` | kernel log of connections to unserved ports |
| `--egress-log` | `URUTAU_EGRESS_LOG` | `/logs/host/egress.log` | kernel log of new outbound connections |
| `--ingress-log` | `URUTAU_INGRESS_LOG` | `/logs/host/ingress.log` | sampled kernel log of new inbound attempts (host kit `--ingress`) |
| `--ingresscnt-log` | `URUTAU_INGRESS_COUNTERS` | `/logs/host/ingress.counters` | exact inbound counters, one line a minute |
| `--egress-containers` | `URUTAU_EGRESS_CONTAINERS` | `/logs/host/containers.map` | `"<ip> <container>"` map, sent whole when it changes |
| `--resolv` | `URUTAU_RESOLV` | `/etc/resolv.conf` (the host's, mounted) | resolver list, sent whole when it changes |
| `--enforce-log` | `URUTAU_ENFORCE_LOG` | `/logs/enforce/decisions.log` | where ban decisions are appended; empty ignores ban commands |
| `--enforce-unban-log` | `URUTAU_ENFORCE_UNBAN_LOG` | `/logs/enforce/unban.log` | where unban requests are appended; empty ignores them |
| `--spool-max` | `URUTAU_PROBE_SPOOL_MAX` | `64MiB` | spool cap; the oldest batches are dropped and counted |
| `--location` | `URUTAU_LOCATION` | empty | `"lat,lon,Label"`; the hub's setting prevails |
`urutau probe --check` reads the liveness mark in the state directory and exits 0 when the probe is alive; it is the `HEALTHCHECK` of the probe image, which has no shell. A missing hub, name or token stops the probe at start with a clear message.
## `urutau probes`
Manages the registry (`<data-dir>/probes.json`) of a hub. Without `--url` it works directly on the data directory (stop the hub first or expect the hub to reload on the next change); with `--url` and the user token it uses the API.
```bash
urutau probes create oracle # prints the token ONCE; the hub stores only its SHA-256
urutau probes list # name, state, last line, lag, version, dropped
urutau probes revoke hostinger # the probe is refused from now on; its data is kept
```
Names are 1 to 32 characters: lowercase letters, digits and `-`, starting with a letter or digit (the name is also the data subdirectory). The page Sources of the dashboard does the same and also edits the location and the egress settings of each probe.
## `urutau import`
Brings the data directory of a 1.x instance into a hub as one probe, losing nothing ([migration-2.0.md](migration-2.0.md)).
```bash
urutau import --from /backup/hostinger/data --host hostinger --dry-run # what would be copied
urutau import --from /backup/hostinger/data --host hostinger # with the hub stopped
urutau import --verify --from /backup/hostinger/data --host hostinger # compare hashes and counts
urutau import --count /data # print events, IPs, incidents, bans
```
It copies the whole directory through a temporary directory and an atomic rename, checks every SHA-256 and the counts, and is idempotent (a second run reports `skipped`). A different destination fails unless `--force`, which moves it to `.bak-<timestamp>` and never deletes. It refuses to run while the hub holds the data-dir lock.
## Noise and monitoring
```bash
@@ -60,6 +118,16 @@ urutau serve --trusted "10.0.0.0/8,203.0.113.7" \
`--trusted` drops every event from those origins. `--monitor-ua` matches the User-Agent of benign requests (`ok` or `notfound`) and counts them apart as "monitoring"; a request that is a `scanner`, `exploit` or `bruteforce` still counts as an attack.
## Second firewall and egress
```bash
urutau serve --enforce observe # decide in memory, write nothing
urutau serve --enforce on # decisions travel to the probes; each appends them to its decisions.log
urutau serve --egress on --egress-workloads "mail=10.0.7.0/24:mail" # primary probe; others: Sources page
```
The host side (nftables logging, the `urutau` fail2ban jail) comes from `deploy/host/install.sh --probe`, see [docker.md](docker.md#host-kit).
## Geolocation
```bash
@@ -70,7 +138,7 @@ Urutau downloads the DB-IP Lite city and ASN databases into `--geo-dir` when the
## `urutau doctor`
Checks the configuration (token, peers, bind), each log source (readable, size), that the data directory is writable, the geolocation databases and the snapshot. Statuses are `ok`, `warn` (a source that cannot be opened yet), `fail` and `off` (disabled). The exit code is 1 when any check is `fail`, which makes it usable in a healthcheck or a deploy script.
Checks the configuration (token, bind and every validation above), that the data directory is writable, the registered probes and their state, the second firewall, the geolocation databases and the snapshot. The hub has no log source to check: what a probe reads is reported by the probe itself on the Sources page. Checks are named `config`, `data-dir`, `probes`, `enforce` (and `enforce-cdn`), `geo` and `state`. Statuses are `ok`, `warn` (a probe offline), `fail` and `off` (disabled). The exit code is 1 when any check is `fail` (for example `--enforce=on` with a decision file that is not writable), which makes it usable in a deploy script. It accepts the same flags as `serve`.
```bash
urutau doctor
@@ -81,8 +149,8 @@ docker exec urutau urutau doctor --json
## `urutau healthcheck`
Calls `/api/health` on the local bind address and exits 0 when it answers `{"status":"ok"}`, 1 otherwise. It is the container `HEALTHCHECK`, which is why the image has no `curl`. It accepts the same flags as `serve` (for a non-default `--bind`).
Calls `/api/health` on the local bind address (`0.0.0.0` and `::` become `127.0.0.1`; 3 second timeout, redirects are not followed) and exits 0 when it answers `{"status":"ok"}`, 1 otherwise. It is the container `HEALTHCHECK`, which is why the image has no `curl`. It accepts the same flags as `serve` (for a non-default `--bind`).
## `urutau version`
Prints `urutau <version>`. `--version` and `-v` work too.
Prints `urutau <version>`. `--version` and `-v` work too. `urutau help` (`--help`, `-h`) prints the usage; an unknown command prints it to stderr and exits 2.
+141 -32
View File
@@ -10,47 +10,107 @@ Urutau has no configuration file. Everything is a flag with a `URUTAU_*` environ
|---|---|
| `URUTAU_TOKEN` | **Required.** Access token of the dashboard and the API: at least 32 characters and about 128 bits of estimated entropy (length times Shannon entropy; periodic or sequential tokens are refused). Generate one with `openssl rand -base64 48` (`openssl rand -hex 32` also works; `-hex 16` is refused by the entropy estimate). |
| `URUTAU_TOKEN_FILE` | Path of a file holding the token (whitespace trimmed), instead of the variable. The variable wins when both are set. |
| `URUTAU_PEER_TOKEN` | Optional. The server token of this instance: the only token its federation routes (`GET /api/v1/peer/export` and `GET /api/v1/peer/stream`) accept, and it opens nothing else. Same strength rules as `URUTAU_TOKEN` (32+ characters, about 128 bits of estimated entropy, not periodic or sequential), and it must differ from it. When this instance is a hub, it is also the fallback client token sent to peers that have no token of their own. |
| `URUTAU_PEER_TOKEN_FILE` | Path of a file holding the general peer token. |
| `URUTAU_PEER_TOKEN_<NAME>` and `..._<NAME>_FILE` | The client credential a hub sends to that one peer; it must equal the peer's own `URUTAU_PEER_TOKEN`. `<NAME>` is the peer name uppercased with every character other than a letter or digit turned into `_` (`my-peer` becomes `MY_PEER`). It does **not** open the local export. Two peer names that collapse to the same variable (`my-peer` and `my_peer`) are refused. A hub with a peer and no token for it refuses to start. |
| `URUTAU_PROBE_TOKEN` | **Probe only, required.** The token of one probe (`urp_` plus 43 base64url characters), printed once by `urutau probes create` or by the Sources page. The hub keeps only its SHA-256 (`probes.json`), so a lost token is replaced, never recovered: revoke the probe and create it again. |
| `URUTAU_PROBE_TOKEN_FILE` | Probe only. Path of a file holding the probe token, instead of the variable. The variable wins when both are set. |
Keep both in `.env` (never versioned) or in your orchestrator's secret store.
The 1.x federation secrets (`URUTAU_PEER_TOKEN`, `URUTAU_PEER_TOKEN_FILE`, `URUTAU_PEER_TOKEN_<NAME>`) do not exist any more; the hub refuses to start when one is set ([migration-2.0.md](migration-2.0.md)).
Keep them in `.env` (never versioned) or in your orchestrator's secret store.
## Settings
Settings are split by role. The **hub** (`urutau serve`) takes the variables in the sections up to [Egress](#egress); the **probe** (`urutau probe`) takes the ones in [Probe](#probe). Every variable below has a flag of the same meaning ([cli.md](cli.md)); the flag wins over the variable.
### Core
| Variable | Default | Meaning |
|---|---|---|
| `URUTAU_BIND` | `0.0.0.0:8790` | listen address |
| `URUTAU_NAME` | container hostname | name shown in the dashboard and used by the hub |
| `URUTAU_DATA_DIR` | `/data` | where the snapshot `urutau-state.gob` is written |
| `URUTAU_TRAEFIK_LOG` | `/data/coolify/proxy/access.log` | Traefik JSON access log, empty disables |
| `URUTAU_AUTH_LOG` | `/var/log/auth.log` | sshd log, empty disables |
| `URUTAU_FAIL2BAN_LOG` | `/var/log/fail2ban.log` | fail2ban log, empty disables |
| `URUTAU_TRUSTED` | empty | trusted CIDRs or IPs, comma separated; their events are dropped entirely |
| `URUTAU_IGNORE` | `127.0.0.0/8,::1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7,fe80::/10,100.64.0.0/10,169.254.0.0/16` | same effect, kept as the alias that carries the private ranges as default |
| `URUTAU_MONITOR_UA` | `(?i)^(Uptime-Kuma/\|Beszel\|Coolify\|kube-probe/\|Go-http-client/.*healthcheck)` | regular expression of monitoring User-Agents |
| `URUTAU_GEO_DIR` | `<data-dir>/geo` | where the DB-IP Lite databases live |
| `URUTAU_GEO_UPDATE` | `24h` | interval between checks for a newer database; `0` disables the download |
| `URUTAU_PEER_ALLOW` | empty | CIDRs allowed to call the federation routes; empty accepts any source that has the token |
| `URUTAU_PEER_BLOCKLIST` | `on` | `on`: the hub's blocklist includes hostile IPs seen only by peers (score 50+ and a strong signal); `off`: only this instance's own IPs |
| `URUTAU_LOCATION` | empty | where this instance is on the map, `"lat,lon"` or `"lat,lon,Label"` (validated at start). It is the destination of the arcs on the Live page and is shared with the hub; empty lets the page fall back to an estimated destination |
| `URUTAU_TRUSTED_PROXY` | `127.0.0.0/8,::1` (the compose file sets `10.250.0.0/24`) | reverse proxies whose `X-Forwarded-For` is trusted (read right to left); used by the login rate limit and by `URUTAU_PEER_ALLOW` |
| `URUTAU_DOMAINS` | empty | allowlist of analytics domains, exact names or `*.example.com`; empty tracks every domain that answers 2xx; recommended, in practice required, when any backend answers 2xx for every Host (catch-all or wildcard), otherwise random Hosts can fill the 24 domain slots |
| `URUTAU_MONITOR_FROM` | empty | CIDRs the monitors really come from; when set, the monitoring User-Agent only counts from them |
| `URUTAU_ADMIN_USERS` | empty | SSH users whose successful login keeps their IP out of the blocklist for 24 h after the last login (a later strong signal cancels it); the immunity is off unless this is set |
| `URUTAU_PEERS` | empty | peers to aggregate, comma separated `name=https://url` |
| `URUTAU_RETENTION` | `720h` | retention as a Go duration, from `1h` to `720h` (30 days) |
| `URUTAU_EVENTS_MAX` | `512MB` | size cap of the event registry (`<data-dir>/events`); `0` turns it off |
| `URUTAU_TOR_EXITS` | empty | file of Tor exit addresses, one per line, reloaded every 24 h when it changes |
| `URUTAU_NAME` | container hostname | name of this instance **and of the primary probe**: the probe whose name equals it keeps its data in the data-dir root (exactly the 1.x layout); every other probe uses `<data-dir>/probes/<name>/` |
| `URUTAU_DATA_DIR` | `/data` | where the state lives: snapshot `urutau-state.gob`, `geo/`, `tor/`, `events/`, `incidents.json` and `enforce.json` of the primary probe, `probes/<name>/` for the others, and `probes.json` |
| `URUTAU_RETENTION` | `720h` | retention as a Go duration, from `1h` to `720h` (30 days); other values refuse to start |
| `URUTAU_EVENTS_MAX` | `512MB` | size cap of the event registry (`<data-dir>/events`); a number with an optional unit (`k`, `kb`, `kib`, `m`, `mb`, `mib`, `g`, `gb`, `gib`, `b`), `0` turns it off |
| `URUTAU_LOCATION` | empty | default map position of the primary probe (the others get theirs on the hub, per probe), `"lat,lon"` or `"lat,lon,Label"` (validated at start). It is the destination of the arcs on the Live page; empty lets the page fall back to an estimated destination |
| `GOMEMLIMIT` | 256 MiB soft limit | standard Go memory limit; set it to override the default |
| `TZ` | UTC | time zone of `fail2ban.log` timestamps, which carry no zone |
In the container image the three log paths default to `/logs/traefik/access.log`, `/logs/host/auth.log` and `/logs/host/fail2ban.log` (the compose file mounts the host logs there). The compose file adds `URUTAU_VERSION` (image tag), `URUTAU_IMAGE` and `URUTAU_PUBLISH` (host address and port), see `.env.example`.
### Noise, trust and monitoring
| Variable | Default | Meaning |
|---|---|---|
| `URUTAU_TRUSTED` | empty | trusted CIDRs or IPs, comma separated; their web requests are counted as own traffic (class `trusted`) and never analysed: no score, threat, visitor or ban. Also feeds the exclusions of the second firewall and the egress allow list |
| `URUTAU_IGNORE` | `127.0.0.0/8,::1,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,fc00::/7,fe80::/10,100.64.0.0/10,169.254.0.0/16` | same effect (class `internal`), kept as the alias that carries the private ranges as default |
| `URUTAU_MONITOR_UA` | `(?i)^(Uptime-Kuma/\|Beszel\|Coolify\|kube-probe/\|Go-http-client/.*healthcheck)` | regular expression of monitoring User-Agents; empty disables; an invalid expression refuses to start |
| `URUTAU_MONITOR_FROM` | empty | CIDRs the monitors really come from; when set, the monitoring User-Agent only counts from them |
| `URUTAU_ADMIN_USERS` | empty | SSH users whose successful login keeps their IP out of the blocklist for 24 h after the last login (a later strong signal cancels it); the immunity is off unless this is set |
| `URUTAU_DOMAINS` | empty | allowlist of analytics domains, exact names or `*.example.com`; empty tracks every domain that answers 2xx; recommended, in practice required, when any backend answers 2xx for every Host (catch-all or wildcard), otherwise random Hosts can fill the 24 domain slots |
### Geolocation and Tor
| Variable | Default | Meaning |
|---|---|---|
| `URUTAU_GEO_DIR` | `<data-dir>/geo` | where the DB-IP Lite databases live |
| `URUTAU_GEO_UPDATE` | `24h` | interval between checks for a newer database; `0` disables the download |
| `URUTAU_TOR_AUTO` | `on` | `on`: download the official Tor exit and relay lists every 6 hours into `<data-dir>/tor`; `off`: do not download (air-gapped hosts) |
| `URUTAU_TOR_EXITS` | empty | file of Tor exit addresses, one per line (`#` comments allowed, at most 100000 addresses, 8 MiB), reloaded every 24 h when it changes; merged with the downloaded list |
### Reverse proxy
| Variable | Default | Meaning |
|---|---|---|
| `URUTAU_TRUSTED_PROXY` | `127.0.0.0/8,::1` (the compose file sets `10.250.0.0/24`) | reverse proxies whose `X-Forwarded-For` is trusted (read right to left); used by the login rate limit and by the probe authentication limiter |
### Second firewall (enforce)
| Variable | Default | Meaning |
|---|---|---|
| `URUTAU_ENFORCE` | `off` | `off`; `observe` (decides in memory and shows what it would ban, sends nothing); `on` (also queues the decisions for the probe of the host, which appends them to its `URUTAU_ENFORCE_LOG` for the host fail2ban). Anything else refuses to start |
| `URUTAU_ENFORCE_SHARE` | `off` | `on`: a decision taken for one probe is also queued for the others; each node applies its own exclusions. Anything else refuses to start |
| `URUTAU_ENFORCE_THRESHOLD` | `5` | attack events in 10 minutes that justify a ban (1 to 1000) |
| `URUTAU_ENFORCE_MAX_PER_MIN` | `60` | most decisions written per minute; the excess is dropped and counted (1 to 10000) |
An unparseable number falls back to the default; an out-of-range one refuses to start.
### Egress
| Variable | Default | Meaning |
|---|---|---|
| `URUTAU_EGRESS` | `auto` | `auto` (on for a probe that sends an egress log), `on` or `off`; anything else refuses to start |
| `URUTAU_EGRESS_WORKLOADS` | empty | default for the primary probe; every probe can have its own on the Sources page. Named workloads and their role, see [Egress analysis](#egress-analysis) |
| `URUTAU_EGRESS_RESOLVERS` | empty | DNS resolvers that are allowed, comma separated IPs; empty means the usual public ones (Cloudflare, Google, Quad9...) plus the nameservers of the `resolv.conf` each probe sends |
| `URUTAU_EGRESS_ALLOW` | empty | environment only, no flag: CIDRs or IPs of legitimate periodic pollers that must not raise beaconing findings. The probes' addresses, `URUTAU_TRUSTED` and the server's own public addresses are always allowed |
| `URUTAU_EGRESS_PROVIDER_ASN` | empty | environment only, no flag: AS numbers of your hosting provider, comma separated, so traffic to it is not reported as unusual |
### Probe
The probe has only these variables (flags in [cli.md](cli.md#urutau-probe)). A path turns a source on, empty turns it off, and a file that does not exist yet just stays at `waiting`.
| Variable | Default | Meaning |
|---|---|---|
| `URUTAU_HUB` | required | hub URL: `https://...`, or `http://` only for loopback and private addresses (for example `http://urutau:8790` on the `urutau-edge` network) |
| `URUTAU_PROBE_NAME` | required | name registered on the hub (lowercase letters, digits and `-`, up to 32) |
| `URUTAU_PROBE_TOKEN`, `URUTAU_PROBE_TOKEN_FILE` | required | see [Secrets](#secrets) |
| `URUTAU_STATE_DIR` | `/state` | spool, read positions and liveness mark; keep it on a volume |
| `URUTAU_TRAEFIK_LOG` | `/logs/traefik/access.log` | Traefik JSON access log |
| `URUTAU_AUTH_LOG` | `/logs/host/auth.log` | sshd log |
| `URUTAU_FAIL2BAN_LOG` | `/logs/host/fail2ban.log` | fail2ban log |
| `URUTAU_PROBE_LOG` | `/logs/host/probe.log` | kernel log of connections to unserved ports, written by the host kit (see [Probes](#probes-port-scans)) |
| `URUTAU_INGRESS_LOG`, `URUTAU_INGRESS_COUNTERS` | `/logs/host/ingress.log`, `/logs/host/ingress.counters` | **on the probe:** sampled inbound attempts and the exact once-a-minute counters, written by `install.sh --ingress` (see [Firewall telemetry](#firewall-telemetry-inbound-attempts)) |
| `URUTAU_EGRESS_LOG` | `/logs/host/egress.log` | kernel log of new outbound connections, written by the host kit |
| `URUTAU_EGRESS_CONTAINERS` | `/logs/host/containers.map` | `"<ip> <container>"` map written by the host kit when a container starts (and every minute), so workloads keep their name when the address changes on a redeploy; sent whole when it changes |
| `URUTAU_RESOLV` | `/etc/resolv.conf` of the host (mounted) | resolvers of the host, sent whole when it changes |
| `URUTAU_ENFORCE_LOG` | `/logs/enforce/decisions.log` | file where the ban decisions of the hub are appended, read by the host jail; empty ignores ban commands and counts them as errors |
| `URUTAU_ENFORCE_UNBAN_LOG` | `/logs/enforce/unban.log` | file where unban requests are appended, read by the host; empty ignores them |
| `URUTAU_PROBE_SPOOL_MAX` | `64MiB` | spool cap while the hub is unreachable; the oldest batches are dropped, counted, and shown on the Sources page |
| `URUTAU_LOCATION` | empty | `"lat,lon,Label"`; the setting on the hub prevails |
| `TZ` | UTC | time zone of the host: `fail2ban.log` timestamps carry no zone and the hub parses them, so it must be the same on the probe and on the hub |
The probe image defaults to the paths above because the compose file in `deploy/probe` mounts the host logs there.
## Noise and monitoring
- **Traefik headers.** Log `Sec-Fetch-Site`, `Sec-Fetch-Dest` and `Referer` so Urutau can tell a page framing your site from a real visit: `--accesslog.fields.headers.names.Sec-Fetch-Site=keep`, `--accesslog.fields.headers.names.Sec-Fetch-Dest=keep` and `--accesslog.fields.headers.names.Referer=keep`. A request framed by another page (`Sec-Fetch-Site` of `cross-site` or `same-site`, or a sub-resource `Sec-Fetch-Dest` such as `image` or `script`) appears in the timeline and creates an IP record like any other, but weighs 0.25 per event, with at most 30 points per IP coming from such requests (below the hostile threshold), and never counts as a strong signal. With an attack-tool User-Agent the headers are ignored.
- **Trusted origins** (`URUTAU_TRUSTED`): your own network, offices, monitors and other servers. `URUTAU_IGNORE` already drops loopback and the private ranges by default, so internal traffic never scores. Add your public monitor IPs. If your proxy reports the Docker gateway as the client, that address is private and already dropped; fix the proxy to pass the real client address instead.
- **Trusted origins** (`URUTAU_TRUSTED`): your own network, offices, monitors and other servers. `URUTAU_IGNORE` already covers loopback and the private ranges by default, so internal traffic never scores. Nothing is silently dropped: web requests from these origins are counted in aggregates only (not as one event record each) and shown in the Traffic page under "Own infrastructure and trusted origins"; they stay out of `totals.requests`, scores, threats, maps, visitors and the blocklist. SSH, fail2ban and network-probe lines from these origins are still ignored. Add your public monitor IPs. If your proxy reports the Docker gateway as the client, that address is private and counted as `internal` own traffic; fix the proxy to pass the real client address instead.
- **Monitoring User-Agent** (`URUTAU_MONITOR_UA`): a Go regular expression. A request that matches and is benign is counted as "monitoring" instead of traffic. If the request is a `scanner`, `exploit` or `bruteforce` it counts as an attack: a User-Agent is trivial to forge, so it never grants immunity.
- **Where monitors come from** (`URUTAU_MONITOR_FROM`): CIDRs of your monitors. When set, the monitoring User-Agent is honored only from those networks and benign requests (`ok` or `notfound`) are filtered. When empty, only `ok` answers are filtered: a `notfound` carrying a monitor User-Agent still counts, because anyone can send that header.
@@ -62,23 +122,72 @@ The geolocation databases are checked every 24 hours (`--geo-update`), but DB-IP
The Traffic page needs no setting. `URUTAU_DOMAINS` restricts which domains it tracks (exact names or `*.example.com`); a domain only gets a slot after a 2xx answer and inactive domains are pruned, so forged `Host` headers cannot fill the analytics. Top pages normalize token-looking path segments (ids, hashes, long random strings) to `:id`. It uses the Traefik log, counts unique visitors by a daily-salted hash and never persists the IP address of a legitimate visitor. See [SECURITY.md](../SECURITY.md).
## Peers (hub mode)
## Probes (hub mode)
A hub with nothing else to configure accepts no probe until you create one:
```
URUTAU_PEERS=web1=https://urutau.web1.example,db1=https://urutau.db1.example
URUTAU_PEER_TOKEN=<shared secret>
urutau probes create web1 # prints the token once
```
On each peer, set the same `URUTAU_PEER_TOKEN`. The hub calls only `GET /api/v1/peer/export` (once per range, `1h`, `24h` and `7d`, every 15 seconds). Peer URLs must be `https` (plain `http` is accepted only for loopback): the peer token travels in a header. To restrict who may call the export, set `URUTAU_PEER_ALLOW` on the peer to the hub's address. Peer names must be unique and cannot be `all` or the hub's own name.
On the server of that probe, set `URUTAU_HUB`, `URUTAU_PROBE_NAME=web1` and `URUTAU_PROBE_TOKEN` and start `deploy/probe/docker-compose.yml` ([docker.md](docker.md#probe)). The hub stores only the SHA-256 of the token; a wrong token gets a bare 401 under an attempt limiter. Revoking a probe (`urutau probes revoke web1` or the Sources page) refuses it from then on and keeps its data. The location on the map and the egress settings (workloads, resolvers, allowed destinations) of each probe are edited on the Sources page and kept in `probes.json`; `URUTAU_LOCATION`, `URUTAU_EGRESS_WORKLOADS`, `URUTAU_EGRESS_RESOLVERS` and `URUTAU_EGRESS_ALLOW` are the defaults of the primary probe.
If the 1.x variables `URUTAU_PEERS`, `URUTAU_PEER_TOKEN*`, `URUTAU_PEER_ALLOW` or `URUTAU_PEER_BLOCKLIST` are set, or the log path variables on the hub, it stops at start: see [migration-2.0.md](migration-2.0.md).
## Snapshot and retention
The snapshot file holds the aggregated state and the log offsets. Mount `URUTAU_DATA_DIR` on a volume to keep it across restarts. Delete the file to start from zero (the rotated logs will be read again). Retention limits how long an IP is kept, at most 168 hours; the dashboard ranges are `1h`, `24h` and `7d`.
The snapshot file `urutau-state.gob` holds the aggregated state and the log offsets; it is saved every 60 seconds and on `SIGTERM`. Mount `URUTAU_DATA_DIR` on a volume to keep it across restarts. Delete the file to start from zero (the rotated logs will be read again); a snapshot that cannot be read is set aside at start. Retention (`URUTAU_RETENTION`, at most 720 hours) limits how long an IP is kept; the dashboard ranges are `1h`, `24h`, `7d` and `30d`.
## Event registry
`<data-dir>/events/` keeps one line per attacker event, one file per UTC day, older days gzip compressed, deleted after `URUTAU_RETENTION`, and capped in total by `URUTAU_EVENTS_MAX` (a number with an optional unit, `0` turns the registry off). It never holds a legitimate visitor. It lives in the same volume as the snapshot, so plan for the cap on top of the snapshot (about 27 MB in the worst case measured). A full disk or the cap drops events and never stops the service. See [architecture.md](architecture.md).
## Incidents
Tickets opened from egress findings (and their status: open, false positive, benign...) are stored in `<data-dir>/incidents.json`, in the same volume. A ticket marked false positive or benign can suppress the same finding later. A corrupt file is moved aside and the store starts empty; nothing else needs setting.
## Probes (port scans)
Connections to ports nobody serves are not visible in the application logs. The host kit ([docker.md](docker.md#host-kit)) logs them from the kernel to `/var/log/urutau/probe.log`; the probe sends that file (`URUTAU_PROBE_LOG`) and the hub turns each line into a scanner event and keeps at most one event per address, port and protocol per minute. Without the kit the source stays at `waiting` and nothing else changes.
## Firewall telemetry (inbound attempts)
The application logs only show what reaches Traefik, sshd and fail2ban. Two things never appear there: connection attempts to ports where nothing listens, and packets from addresses that are already banned (the firewall drops them without a log line). The host kit with `--ingress` ([docker.md](docker.md#host-kit)) observes both, and the probe sends two sources: `ingress.counters` (exact, one cumulative line a minute) and `ingress.log` (a rate-limited sample of the attempts). Nothing else needs setting; without the kit the sources stay at `waiting`.
- **Exact totals** (attempts per hour, by protocol, closed versus served ports) are the difference between two counter lines. A counter that goes down means the table was reloaded and counts from zero. A malformed, absurd or out-of-window line is dropped and counted as malformed.
- **Details** (top destination ports, top origin ASNs and countries, the banned share) come from the sample, and the panel says so. The exposure ratio is `logged / total`, shown as "Sampled".
- **Banned sources.** The firewall sees a packet before fail2ban drops it, so the hub classifies each sampled line by its own ban state: an address is "banned" when a jail (fail2ban or the `urutau` jail) holds it in the hub's records at that moment, from the `Ban`, `Unban` and `Restore Ban` lines it has read. This is robust because it needs nothing from the host beyond the sampled line, and its limit is that a ban the hub never read is not counted. The share is of the sample; the estimate for the total applies it to the exact count and is labelled as an estimate.
- **No feedback loop.** These attempts are telemetry only: they never become events, never raise a score and never feed the second firewall, `port-scan` included (the closed-port evidence of the second firewall stays with the `probe.log` source above, one event per address, port and protocol per minute). Attempts from an address that is already banned are therefore never new evidence against it, as with `recidive` and the `urutau` jail.
- **Scope.** Retention is the 30 days of the other aggregates, in hourly buckets with capped top lists (48 ports, 48 networks, 64 countries per hour), kept in `<data-dir>/probes/<name>/ingress.json` (the primary probe in the root of the data directory). It is a few MB per host at most, well inside the hub memory limit. A cloud provider firewall (an Oracle Cloud security list, for example) blocks some ports before the host, so the metric is what reaches the host.
- `urutau doctor` reports, per host, whether the source is present and fresh (last counters line under 5 minutes old).
## Tor
Urutau marks addresses that are Tor exits or relays. By default (`URUTAU_TOR_AUTO=on`) it downloads the official exit list and relay list every 6 hours into `<data-dir>/tor` (`exits.txt`, `relays.json`; an invalid download keeps the previous cache); the container then needs outbound HTTPS to `check.torproject.org` and `onionoo.torproject.org`. On an air-gapped host set `URUTAU_TOR_AUTO=off` and maintain your own `URUTAU_TOR_EXITS` file.
## Second firewall (enforce)
Optional and off by default. Neither Urutau process gets privileges: the hub decides which addresses deserve a ban and queues one line per decision for the probe of that host, the probe checks that the line has exactly the expected shape and appends it to a file, and a fail2ban jail on the host applies it.
- `URUTAU_ENFORCE=observe` decides in memory and shows in the dashboard what it would ban; nothing is written. Use it first.
- `URUTAU_ENFORCE=on` appends `<time> urutau decision=ban ip=<ip> reason=<slug> score=<n> ttl=<s> host=<name> src=<local|peer:NAME>` to the `URUTAU_ENFORCE_LOG` of the probe. The host side is the `urutau` jail and the `urutau-allports` action installed by `install.sh --probe --enforce` ([docker.md](docker.md#host-kit)). The jail uses the host's own `ignoreip`, so trusted addresses stay protected there too. Decisions wait until the log backfill finishes at start.
A ban needs one of these inside the window: two critical events (RCE, traversal, `.env`/credentials, VCS, webshell, SQL injection, Log4Shell), `URUTAU_ENFORCE_THRESHOLD` attack events in 10 minutes (doubled for a visitor with a legitimate visit), 5 SSH failures in 10 minutes, 10 distinct ports probed in 10 minutes, a known attacker, 10 SSH failures or 20 web events in 24 hours, 10 SSH failures or 10 web events without a legitimate visit in 7 days (an `ssh-probe` counts half), or one event from an address of a /24 (IPv4) or /64 (IPv6) where 3 or more addresses were banned in the last 24 hours (`neighbor-campaign`). The advisory TTL grows with repeat offences: 1 h, 6 h, 24 h, 7 d. Never banned: trusted and private addresses (`URUTAU_TRUSTED`, `URUTAU_IGNORE`), verified crawlers (forward-confirmed reverse DNS), addresses with an operator allow, infrastructure and peers' own hosts, Cloudflare addresses, and decisions from a peer the local instance cannot confirm. Bans of the `urutau` jail and of `recidive` do not count as evidence of the address's own behaviour. Reasons are a fixed list: `scanner-flood`, `exploit-flood`, `web-bruteforce`, `wp-bruteforce`, `ssh-bruteforce`, `rce`, `path-traversal`, `env-probe`, `vcs-probe`, `webshell`, `sqli`, `log4shell`, `port-scan`, `known-attacker`, `neighbor-campaign`.
The dashboard's Unban button (`POST /api/v1/enforce/unban`) drops the active ban, queues `<time> urutau unban ip=<ip> allow=<seconds>` for the probe (you choose the host, or all), which appends it to the unban file, and with `URUTAU_ENFORCE_SHARE=on` tells the other nodes. On the host `urutau-unban.path` runs `urutau-unban`, which unbans the address in every jail and, with `allow` above 0, ignores it for that many seconds (useful for authorized pentests). `urutau doctor` reports the mode, the file and whether it is writable (`fail` in `on` mode when it is not), and warns when Traefik logs Cloudflare addresses as clients (set `forwardedHeaders.trustedIPs` to the Cloudflare ranges so the real client is seen).
## Egress analysis
Analyses what leaves the server: new outbound connections of the host and of the containers, logged by the host kit to `/var/log/urutau/egress.log` and sent by the probe. It finds beaconing, mining pools, spam, unauthorized scans, DNS that bypasses the allowed resolvers, and destinations known as hostile or Tor exits. With `URUTAU_EGRESS=auto` it turns on by itself for a probe that sends the log. Findings can become tickets (see Incidents).
`URUTAU_EGRESS_WORKLOADS` names the origins and gives each one a role, so expected behaviour is not reported (a scanner scans, a mail server talks on port 25):
```
URUTAU_EGRESS_WORKLOADS="scanner=name:scan-worker*:scanner;mail=10.0.7.0/24:mail;host-out=host"
```
Format: `name=ITEM,ITEM:role;name2=...`. An ITEM is a CIDR or an IP, `host` (the host's own output), `name:<container>` (exact container name, ignoring a trailing `-<digits>` suffix) or `name:<prefix>*` (every container whose name starts with the prefix). The role after the last colon is `default`, `scanner`, `mail` or `resolver` (default when omitted). A bad definition refuses to start.
## Authentication and exposure
The default bind is `0.0.0.0` because the container is behind a proxy. Outside a container, bind to `127.0.0.1` or put a TLS reverse proxy in front. `--insecure-no-auth` exists only for local tests and is refused on non-loopback binds.
+95 -41
View File
@@ -2,20 +2,29 @@
# Docker
Urutau ships as one small container image (`linux/amd64` and `linux/arm64`, about 28 MB, no `curl`), defined in [`docker-compose.yml`](../docker-compose.yml). It only needs to read log files and to write one snapshot.
Urutau 2 ships as **two** small container images (`linux/amd64` and `linux/arm64`, no `curl`, no shell in the probe), built from one Dockerfile:
| Image | Target | What it is | Compose file |
|---|---|---|---|
| `urutau` | `hub` | Alpine, about 28 MB: dashboard, API, data volume, receives the probes. Reads no log file | [`docker-compose.yml`](../docker-compose.yml) |
| `urutau-probe` | `probe` | `FROM scratch`, under 15 MB: only the binary, CA certificates and zoneinfo. Reads the host logs and pushes them to the hub | [`deploy/probe/docker-compose.yml`](../deploy/probe/docker-compose.yml) |
```
host container urutau
/data/coolify/proxy/logs ── :ro ────────────► /logs/traefik (access.log of Traefik)
/var/log/urutau ── :ro ────────────► /logs/host (auth.log, fail2ban.log)
volume urutau-data ── read and write ─► /data (snapshot, geo databases)
server 1 (probe) hub
/data/coolify/proxy/logs ─:ro─► /logs/traefik
/var/log/urutau ─:ro─► /logs/host ── HTTPS push ──► container urutau
/etc/resolv.conf ─:ro─► /logs/resolv.conf ◄─ long-poll ──── volume urutau-data ─► /data
/var/log/urutau-enforce ─rw──► /logs/enforce (only when the hub's URUTAU_ENFORCE=on)
volume urutau-probe-state ────► /state (spool, positions)
server 2 (probe) ── same layout ──► the same hub
```
The compose file follows this layout. The Traefik log directory is mounted outside `/data` so it does not collide with the snapshot volume. Only the dedicated `logs` directory of the proxy is mounted, never the whole `/data/coolify/proxy` (which holds `acme.json` and the dynamic configuration).
The hub and the probes are independent containers: the hub can run on one of the monitored servers (then that server also runs a probe, as any other) or on a machine of its own. The probe opens **no port**: the connection goes out to the hub, so the monitored server needs no inbound rule. Only the dedicated `logs` directory of the proxy is mounted, never the whole `/data/coolify/proxy` (it holds `acme.json`, the TLS private keys).
The image runs as the unprivileged user `urutau` (uid 10001) on Alpine. Its `HEALTHCHECK` is the binary itself (`urutau healthcheck`, which asks the local daemon for `/api/health`), so there is no `curl` in the image. The compose file sets a memory limit (`mem_limit`); the soft Go limit is 256 MiB and the worst case measured is about 54 MiB of heap plus a snapshot of about 27 MB, so `mem_limit: 384m` is recommended. The data volume also holds the event registry (`/data/events`, capped by `URUTAU_EVENTS_MAX`, 512 MB by default). The compose file sets and `cpus: 0.5`, a read-only root filesystem, `cap_drop: [ALL]` and `no-new-privileges`, and passes from `.env` to the container: `URUTAU_TOKEN`, `URUTAU_NAME`, `URUTAU_TRUSTED`, `URUTAU_PEERS`, `URUTAU_PEER_TOKEN`, `URUTAU_PEER_ALLOW`, `URUTAU_TRUSTED_PROXY`, `URUTAU_DOMAINS`, `URUTAU_MONITOR_FROM`, `URUTAU_ADMIN_USERS`, `URUTAU_GEO_UPDATE` and `TZ`. To set any other `URUTAU_*` variable (`URUTAU_MONITOR_UA`, `URUTAU_RETENTION`, `URUTAU_TOKEN_FILE`, per-peer tokens, ...), add it to the `environment` block.
Both images run unprivileged (uid 10001) from a static Go binary. The hub image sets `URUTAU_BIND=0.0.0.0:8790` and `URUTAU_DATA_DIR=/data` (no log path any more; the 1.x variables stop it at start) and its `HEALTHCHECK` is `urutau healthcheck` every 30 s. The probe image sets `URUTAU_STATE_DIR=/state`, exposes no port and its `HEALTHCHECK` is `/urutau probe --check`, which reads the liveness mark of the state volume (there is no shell). To read `/var/log/urutau` (group `adm`), the probe compose file adds the host group with `group_add: ["4"]`.
## Quick start
## Quick start (hub)
```bash
cp .env.example .env
@@ -25,25 +34,44 @@ docker compose pull && docker compose up -d # published image
docker compose up -d --build
```
The token needs at least 32 characters and about 128 bits of estimated entropy (length times Shannon entropy; periodic or sequential tokens are refused). `openssl rand -base64 48` is recommended (`openssl rand -hex 32` also qualifies). To keep the secret out of the environment, mount a file and set `URUTAU_TOKEN_FILE` (same for `URUTAU_PEER_TOKEN_FILE`).
The token needs at least 32 characters and about 128 bits of estimated entropy (length times Shannon entropy; periodic or sequential tokens are refused). `openssl rand -base64 48` is recommended (`openssl rand -hex 32` also qualifies). To keep the secret out of the environment, mount a file and set `URUTAU_TOKEN_FILE` (the probe has `URUTAU_PROBE_TOKEN_FILE`).
The dashboard comes up at `http://127.0.0.1:8790` by default (`URUTAU_PUBLISH` in `.env` changes the address and port). Check the sources:
The dashboard comes up at `http://127.0.0.1:8790` by default (`URUTAU_PUBLISH` in `.env` changes the address and port). Create a probe for each server and read the answer once:
```bash
docker compose exec urutau urutau probes create web1 # prints the token (urp_...) once
docker compose exec urutau urutau doctor
docker compose logs urutau
```
## Reading the logs
## Probe
On each monitored server, after [preparing the host logs](#preparing-the-host-logs):
```bash
cd deploy/probe
cp .env.example .env
$EDITOR .env # URUTAU_HUB=https://urutau.example.com URUTAU_PROBE_NAME=web1 URUTAU_PROBE_TOKEN=urp_...
docker compose up -d
docker compose logs probe
```
Then open the Sources page of the hub: the probe appears connected with its sources (`following`, `waiting` for a file that does not exist yet). `URUTAU_HUB` must be `https://` (a plain `http://` is accepted only for loopback and private addresses, such as `http://urutau:8790` when the hub is the `urutau` service of the same host and the probe joins the `urutau-edge` network, see the comments in the compose file). Set `TZ` to the host's time zone: the hub parses `fail2ban.log`, which has none, so it must match on both sides.
While the hub is unreachable the probe keeps the batches in the `/state` volume (64 MiB by default, `URUTAU_PROBE_SPOOL_MAX`), reconnects with backoff from 1 to 60 seconds and sends them in order when the hub is back; nothing is lost or counted twice. If the spool overflows, the oldest batches are dropped and the loss is counted and shown on the Sources page. To replace a token, revoke the probe on the hub and create it again; a lost token cannot be recovered because the hub keeps only its SHA-256. The probe stays under about 20 MB of memory.
## Reading the logs (probe)
These notes are about the files the **probe** mounts.
- **Traefik:** the access log must be JSON and written to a dedicated directory. In Traefik's static configuration set `--accesslog=true`, `--accesslog.format=json` and `--accesslog.filepath=/traefik/logs/access.log`. On Coolify the host directory `/data/coolify/proxy` is `/traefik` inside the proxy container, so that file appears on the host as `/data/coolify/proxy/logs/access.log`, which is what the compose file mounts. In the Coolify UI open Servers, the server, Proxy, and add those three lines to the `command` list of the proxy configuration, then restart the proxy. In the same place add the headers Urutau uses to tell real visits from framed requests: `--accesslog.fields.headers.names.Sec-Fetch-Site=keep`, `--accesslog.fields.headers.names.Sec-Fetch-Dest=keep` and `--accesslog.fields.headers.names.Referer=keep`.
- **auth.log and fail2ban.log:** the dedicated host directory `/var/log/urutau` is mounted read-only at `/logs/host` as a directory, because logrotate recreates these files by rename and a single-file mount would keep following the old inode. Prepare it as shown in [Preparing the host logs](#preparing-the-host-logs). The files are owned by `syslog:adm`, so the container adds the host's `adm` group (GID 4) with `group_add: ["4"]`, as the compose file does. Nothing else from the host `/var/log` is exposed.
- **Read-only:** all log mounts are `:ro`. Urutau never writes to a log.
- **Read-only:** all log mounts are `:ro`. Urutau never writes to a log. (The only writable mount is `/logs/enforce`, see [Host kit](#host-kit).)
- **Rotation:** the follower reopens the file when logrotate replaces or truncates it.
## Preparing the host logs
Urutau reads a dedicated directory, `/var/log/urutau`, instead of the whole `/var/log`. Prepare it once on each server (the original `/var/log/auth.log` stays untouched):
The probe reads a dedicated directory, `/var/log/urutau`, instead of the whole `/var/log`. Prepare it once on each server (the original `/var/log/auth.log` stays untouched):
```bash
sudo install -d -m 0750 -o syslog -g adm /var/log/urutau
@@ -66,7 +94,7 @@ sudo systemctl restart fail2ban
# logrotate for both files
sudo tee /etc/logrotate.d/urutau >/dev/null <<'EOF'
/var/log/urutau/*.log {
/var/log/urutau/auth.log /var/log/urutau/fail2ban.log {
weekly
rotate 4
compress
@@ -82,11 +110,13 @@ sudo tee /etc/logrotate.d/urutau >/dev/null <<'EOF'
EOF
```
If you also install the host kit, the logrotate rule above names only `auth.log` and `fail2ban.log` on purpose: with the host kit, the kit rotates `egress.log` and `probe.log` itself and logrotate refuses duplicate entries.
`RSYSLOG_FileFormat` writes ISO timestamps, which is the format Urutau parses. Check the `adm` GID with `getent group adm`. Known limitation: a local user of the host can forge sshd lines with `logger -t sshd`. Urutau limits the damage (a hostile level needs a strong signal and the admin immunity lasts 24 hours), but anyone with a shell on the host is already inside your trust boundary.
## Example: Coolify
Create a Docker Compose resource on the Coolify server whose logs you want to watch, with this compose file:
Two resources. On the server that hosts the hub, a Docker Compose resource with the hub and its domain:
```yaml
services:
@@ -95,18 +125,13 @@ services:
restart: unless-stopped
environment:
URUTAU_TOKEN: ${URUTAU_TOKEN}
URUTAU_NAME: server-1
URUTAU_AUTH_LOG: /logs/host/auth.log
URUTAU_FAIL2BAN_LOG: /logs/host/fail2ban.log
URUTAU_NAME: server-1 # the primary probe: its data is the data-dir root
URUTAU_TRUSTED_PROXY: 10.250.0.0/24
TZ: UTC # the host's time zone (fail2ban.log has none)
group_add: ["4"] # adm: read auth.log and fail2ban.log
TZ: UTC
read_only: true
cap_drop: [ALL]
security_opt: ["no-new-privileges:true"]
volumes:
- /data/coolify/proxy/logs:/logs/traefik:ro
- /var/log/urutau:/logs/host:ro
- urutau-data:/data
networks: [urutau-edge]
labels:
@@ -126,36 +151,65 @@ networks:
external: true
```
Then, on every server (including that one), a second Compose resource with `deploy/probe/docker-compose.yml`, with `URUTAU_HUB`, `URUTAU_PROBE_NAME` and `URUTAU_PROBE_TOKEN` in the Coolify environment. On the hub's own server the probe can use `https://urutau.example.com` or join the `urutau-edge` network and use `http://urutau:8790`.
Notes:
- **A network shared only with Traefik.** `--trusted-proxy` defaults to loopback only, so by default `X-Forwarded-For` is ignored. The compose file creates the `urutau-edge` network (`10.250.0.0/24`) and sets `URUTAU_TRUSTED_PROXY=10.250.0.0/24`, so only the proxy on that network is believed (any other container there could forge client IPs, so keep it to the proxy). Connect the proxy once: `docker network connect urutau-edge coolify-proxy`. In a standalone compose like the example below, declare the network the same way and set the variable. The `traefik.docker.network` label tells Traefik to use it. Adapt the entrypoint and certificate resolver names to your proxy.
- The image already points the sources at `/logs/traefik/access.log`, `/logs/host/auth.log` and `/logs/host/fail2ban.log` (its `URUTAU_*_LOG` defaults). The binary's own defaults (`/data/coolify/proxy/access.log`, `/var/log/...`) are for running it directly on the host.
- **A network shared only with Traefik.** `--trusted-proxy` defaults to loopback only, so by default `X-Forwarded-For` is ignored. The compose file creates the `urutau-edge` network (`10.250.0.0/24`) and sets `URUTAU_TRUSTED_PROXY=10.250.0.0/24`, so only the proxy on that network is believed (any other container there could forge client IPs). Attach the proxy with `docker network connect urutau-edge coolify-proxy`, or let the labels do it as above. If the proxy sits elsewhere, set `URUTAU_TRUSTED_PROXY` to its address.
- Set `URUTAU_TOKEN` in the Coolify environment. Behind the proxy the dashboard is served over HTTPS, so the session cookie is `Secure`.
- Do not publish port 8790 on the host when the proxy already routes it.
- If the Traefik access log is missing or not JSON, the source stays at zero lines or `malformed` grows.
- Urutau needs no `tmpfs`: the root filesystem is read-only and its only write target is the `/data` volume.
- Do not publish port 8790 on the host when the proxy already routes it. The domain must pass `/api/v1/probe/*` (it is the same host as the dashboard); a Cloudflare proxy in front is fine: the longest request is a 25 second long-poll.
- If the Traefik access log is missing or not JSON, its source stays at zero lines or `malformed` grows on the Sources page.
- Urutau needs no `tmpfs`: the root filesystem is read-only and the write targets are the `/data` volume of the hub and the `/state` volume (and, in enforce mode, `/logs/enforce`) of the probe.
## Host kit
`deploy/host/` holds an optional kit that needs root on the host and gives the probe three more sources. Urutau itself never gets privileges: the probe only reads the logs the kit writes and, in enforce mode, appends decisions to a file. Run it on every server that has a probe.
```bash
sudo sh deploy/host/install.sh # probe and egress logging + container map
sudo sh deploy/host/install.sh --enforce # also the fail2ban jail of the second firewall
sudo sh deploy/host/install.sh --ingress # also the inbound observation (firewall telemetry)
sudo sh deploy/host/install.sh --probe # probe host: the kit, plus the enforce directory the probe writes
sudo sh deploy/host/install.sh --probe --enforce
sudo sh deploy/host/install.sh --remove # undo everything (logs are kept)
```
It is idempotent. `URUTAU_WAN` overrides the detected uplink interface and `URUTAU_UID` (default `10001`) the uid that owns the enforce directory. It needs `nft`, `rsyslog` and Docker (and `fail2ban` and `python3` for `--enforce`).
| Part | What it installs |
|---|---|
| egress logging | nftables table `inet urutau_egress` (`/etc/urutau/egress.nft`, only logs, never drops, separate from the Docker and fail2ban tables) and the `urutau-egress.service` unit; rsyslog rule `41-urutau-egress.conf` sends the kernel lines to `/var/log/urutau/egress.log` (`URUTAU-EGRESS:`) and `/var/log/urutau/probe.log` (`URUTAU-PROBE:`); logrotate daily, 7 copies, at most 200 MB (`urutau-logrotate.timer`) |
| probes | the `URUTAU-PROBE:` rule logs new inbound connections on the uplink to ports no socket listens on (at most 10 per second per source); the set of open ports is refreshed every minute from `ss`, including ports Docker publishes |
| inbound observation (`--ingress`) | nftables table `inet urutau_ingress` (`/etc/urutau/ingress.nft`) and `urutau-ingress.service`. It only observes: counters and a rate-limited log, never a drop, accept, mark or rewrite, and a policy of accept. Its chain hooks at prerouting priority -150, before Docker's DNAT, so DNAT'ed container ports and sources that are banned (and dropped later, in `INPUT` or `FORWARD`) are all seen. It sees only new attempts that arrive on the uplink and are addressed to the host: a TCP SYN without ACK, a new UDP flow, an ICMP echo request; never loopback, Docker bridges, private, link-local, CGNAT or multicast sources, or the host's own addresses. Exact totals are named nft counters (total, tcp, udp, icmp, and how many went to a served port); `urutau-ingress-tick`, run by `urutau-ingress-tick.timer` every minute, refreshes the set of served ports (listening sockets plus ports Docker publishes) and appends one cumulative line to `/var/log/urutau/ingress.counters`. The details are a sample: a global log ceiling (10 per second for closed ports, 5 for served ones, 2 for ICMP) written by rsyslog rule `42-urutau-ingress.conf` to `/var/log/urutau/ingress.log` (`URUTAU-IN:` closed port, `URUTAU-INO:` served port). Both files rotate with the rest of the kit |
| container map | `urutau-containers-map`, run by its timer (every minute) and by `urutau-containers-watch` (on every container start or network attach, so a redeploy that swaps addresses is named right within seconds), writes `/var/log/urutau/containers.map` (`<ip> <container>`) and `/var/log/urutau/resolv.conf` (the real upstream resolvers) |
| second firewall (`--enforce`) | directory `/var/log/urutau-enforce` (owned by `URUTAU_UID`, group `adm`) with `decisions.log` and `unban.log`; fail2ban filter `urutau`, action `urutau-allports` and jail `urutau` (`polling` backend, `maxretry = 1`, `bantime = 1h`, actions on `INPUT` and `DOCKER-USER`, host `ignoreip` kept); `urutau-unban.path` and `urutau-unban` apply the Unban button |
`--ingress` is separate from `--enforce` on purpose: observing is not blocking. Combine them freely; running the installer again without `--ingress` leaves it as it is, and `--remove` deletes it. The probe compose file already points `URUTAU_INGRESS_LOG` and `URUTAU_INGRESS_COUNTERS` at `/logs/host/ingress.log` and `/logs/host/ingress.counters`, so after `--ingress` the probe starts sending both with no change (before it, the two sources show as `waiting`). Production command, as root on each host: `sudo sh deploy/host/install.sh --ingress` (add `--probe` on a probe-only host, and `--enforce` where the second firewall runs). A cloud provider firewall (an Oracle Cloud security list, for example) drops some ports before they reach the host, so this measures what reaches the host, not what the internet sent.
The `urutau-allports` action behaves like `iptables-allports` but only drops connections the banned address starts (conntrack original direction), so replies to connections the host opened keep flowing. The egress and probe files land in `/var/log/urutau`, which the probe compose file already mounts at `/logs/host`, so the probe finds them at its defaults (`URUTAU_EGRESS=auto` turns on by itself once the file exists). For the second firewall add the mount and the variables to the compose file, start with `observe` and move to `on` when the decisions look right:
```yaml
# hub (docker-compose.yml)
environment:
URUTAU_ENFORCE: observe # off | observe | on
# URUTAU_ENFORCE_SHARE: "on" # a decision for one server is also queued for the others
# probe (deploy/probe/docker-compose.yml): the /logs/enforce volume is already there
```
The decisions travel from the hub to the probe of the host (long-poll) and the probe appends them to `/logs/enforce/decisions.log`; it accepts only lines with exactly the shape of a ban or unban line. `/logs/enforce` must be writable by uid 10001 (the kit does it) and cannot be `:ro`. The probe counts a refused or unwritable command as an error, shown on the Sources page. See [configuration.md](configuration.md) for the policy and the variables.
## Geolocation database
The DB-IP Lite databases are downloaded into the data volume (`/data/geo`) on first start, so the container needs outbound HTTPS to `download.db-ip.com` once, and then once a month. If the host cannot reach the internet, copy the two `.mmdb` files into the volume and set `URUTAU_GEO_UPDATE=0` ([configuration.md](configuration.md)). Data by [DB-IP](https://db-ip.com), CC BY 4.0.
The DB-IP Lite databases are downloaded into the data volume (`/data/geo`) on first start, so the container needs outbound HTTPS to `download.db-ip.com` once, and then once a month. The Tor lists (`URUTAU_TOR_AUTO=on`) also need `check.torproject.org` and `onionoo.torproject.org` every 6 hours; with `URUTAU_TOR_AUTO=off` that is not needed. If the host cannot reach the internet, copy the two `.mmdb` files into the volume and set `URUTAU_GEO_UPDATE=0` ([configuration.md](configuration.md)). Data by [DB-IP](https://db-ip.com), CC BY 4.0.
## Federation across servers
## Several servers
Run one Urutau per server with its own `URUTAU_NAME`. Every instance that is polled sets its own server token, `URUTAU_PEER_TOKEN` (or `_FILE`), and that is the only token its export accepts. The hub holds a client credential for each peer, equal to that peer's server token: one `URUTAU_PEER_TOKEN_<NAME>` per peer (the peer name uppercased, other characters turned into `_`, for example `URUTAU_PEER_TOKEN_SERVER_2`), with the hub's general `URUTAU_PEER_TOKEN` as fallback. A client credential does not open the hub's own export, and peer names that collapse to the same variable (`my-peer` and `my_peer`) are refused. Tokens need 32+ characters and about 128 bits of entropy, different from `URUTAU_TOKEN` (`openssl rand -base64 48`), and can come from `..._FILE`. On the server that hosts the shared dashboard (the hub) add:
```yaml
environment:
URUTAU_PEERS: server-2=https://urutau.server2.example.com,server-3=https://urutau.server3.example.com
URUTAU_PEER_TOKEN_SERVER_2: ${TOKEN_FOR_SERVER_2}
URUTAU_PEER_TOKEN_SERVER_3: ${TOKEN_FOR_SERVER_3}
```
The hub calls only `GET /api/v1/peer/export` on each peer (three ranges every 15 seconds) and keeps one `GET /api/v1/peer/stream` open for the live events, with that peer's token, which opens nothing else on the peer and is refused over plain `http` outside loopback. Set `URUTAU_PEER_ALLOW` on a peer to the hub's address to restrict who may call the export. Each peer keeps its own login token for its own dashboard.
One hub, one probe per server, each with its own name and token. There is no peer token and no shared secret: `urutau probes create <name>` makes a token for one probe, only its SHA-256 stays on the hub, and `urutau probes revoke <name>` cuts one server off without touching the others (its data is kept). The dashboard host selector offers `all` and each probe, summaries, IP tables, the live map and incidents (`host/INC-n`) merge them, and the egress settings and map location of each probe are set on the Sources page. With `URUTAU_ENFORCE_SHARE=on` a ban decided for one server is also queued for the others. Moving from 1.x: [migration-2.0.md](migration-2.0.md).
## Hardening
`read_only: true`, `cap_drop: [ALL]`, `no-new-privileges` and read-only log mounts leave the container able to do one thing: read the logs and write its snapshot. Keep the image on a pinned tag (`X.Y.Z`) in production and `latest` only where you accept updates.
`read_only: true`, `cap_drop: [ALL]`, `no-new-privileges` and read-only log mounts leave the hub able to do one thing, serve and write its data volume, and the probe able to read the logs, write its `/state` volume and dial the hub (plus the decision file, only when you enable `URUTAU_ENFORCE=on`). The probe image has no shell, no package manager and exposes no port. Keep the image on a pinned tag (`X.Y.Z`) in production and `latest` only where you accept updates.
## Health and shutdown
`GET /api/health` answers `{"status":"ok"}` without authentication. `urutau healthcheck` calls it locally and exits 0 when the daemon is healthy; the image uses it as its `HEALTHCHECK`. On `SIGTERM` the daemon stops accepting requests, saves the snapshot and exits.
`GET /api/health` answers `{"status":"ok"}` without authentication. `urutau healthcheck` calls it locally and exits 0 when the daemon is healthy; the hub image uses it as its `HEALTHCHECK`, and the probe image uses `urutau probe --check`. On `SIGTERM` or `SIGINT` the daemon stops accepting requests (5 second grace), saves the snapshot and exits 0.
Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 463 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 437 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 446 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 198 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 698 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 683 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 696 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 267 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 222 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 292 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 173 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

After

Width:  |  Height:  |  Size: 195 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 166 KiB

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

After

Width:  |  Height:  |  Size: 189 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 164 KiB

After

Width:  |  Height:  |  Size: 185 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 122 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 145 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 206 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 238 KiB

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 253 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 241 KiB

After

Width:  |  Height:  |  Size: 258 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 KiB

After

Width:  |  Height:  |  Size: 192 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 187 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 222 KiB

After

Width:  |  Height:  |  Size: 224 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 414 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 372 KiB

After

Width:  |  Height:  |  Size: 402 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 368 KiB

After

Width:  |  Height:  |  Size: 400 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 310 KiB

After

Width:  |  Height:  |  Size: 295 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 596 KiB

After

Width:  |  Height:  |  Size: 622 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 593 KiB

After

Width:  |  Height:  |  Size: 615 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 204 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 173 KiB

After

Width:  |  Height:  |  Size: 212 KiB

Loaded 100 of 337 files, more files were not shown because too many files have changed in this diff. Show more