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>
13 KiB
Security policy
English · Português
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
Do not open a public issue with exploit details. Open a minimal issue asking for a private channel, or contact the maintainer through the Gitea profile listed on the repository. Include the affected version, the input shape (a sample log line) and a minimal reproduction when a private channel is available.
Scope and threat model
- 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/healthneedURUTAU_TOKEN(at least 32 characters and about 128 bits of estimated entropy, compared in constant time; it can come fromURUTAU_TOKEN_FILE), either as a bearer token or through a login that sets a session cookie (HttpOnly,SameSite=Strict,Secureover 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-Foris 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 withopenssl rand -base64 48(-hex 32also works). - 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 inprobes.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 onlyPOST /api/v1/probe/hello,POST /api/v1/probe/pushandGET /api/v1/probe/commands(together with theX-Urutau-Probeheader, 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. Plainhttp://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 withRetry-After); the hub never trusts a path, anadminflag 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, withURUTAU_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 andno-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.ValidCmdLinepasses: exactly the shape the hub'sFormatLineandUnbanLineproduce, 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 withO_APPENDandfsync, 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,
MaxHeaderBytesof 16 KB,POST /logincapped at 4 KB, and at most 20 simultaneous live-stream clients (a 21st gets 503 withRetry-After; the stream sends a heartbeat every 20 s). - Information exposure:
/api/healthreturns only{"status":"ok"}(no version), log file paths never leave the probe and are never shown in the dashboard, responses carryReferrer-Policy: same-originand a strict Content-Security-Policy. - Framed requests: with the
Sec-Fetch-Site,Sec-Fetch-DestandRefererheaders 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 forgedHostheaders cannot fill memory. The blocklist only contains hostile, globally routable addresses, never--ignoreor--trustedranges 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-fromit only counts from your monitor networks. - No unauthenticated mode on the network:
--insecure-no-authis refused unless the bind address is loopback. Exposing the port on a public interface still needs a reverse proxy with TLS. - Container hardening: both images run as an unprivileged user without
curl(the hub'sHEALTHCHECKisurutau healthcheck, the probe's isurutau 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, neveracme.jsonor its configuration. Logs come from a dedicated host directory,/var/log/urutau, not the whole/var/log.--trusted-proxydefaults to loopback only; the compose file creates theurutau-edgenetwork (10.250.0.0/24) and trusts just that, so keep only the reverse proxy on it, since another container there could forgeX-Forwarded-For. The only write target of the hub is the data volume (snapshots, mode0700directory); the probe writes its/statevolume 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 fromcheck.torproject.organdonionoo.torproject.orgevery 6 hours (--tor-auto=offturns 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-mindecisions 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.jsonare 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=1stream carries no address, User-Agent or referrer (city-level position only, at most 20 per second) and is never written to disk. Paths andReferervalues are normalized to:idwhen 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,0turns 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, Bingbot or Applebot (a confirmed crawler is never banned by the second firewall). The Tor lists are cached locally, and
--tor-exitsaccepts 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
A local user of the host can forge sshd lines with logger -t sshd, which rsyslog copies into /var/log/urutau/auth.log. This could, for example, fake a successful login to earn admin immunity. It is mitigated by the strong-signal requirement for the hostile level and by the 24 hour window of the immunity, but anyone with a shell on the host is already inside the trust boundary.
Out of scope
- Vulnerabilities in the Go toolchain or third-party packages already fixed upstream (
govulncheckruns in CI and weekly). - Attacks that require the operator to disable documented controls (publishing the port without TLS and sharing the token, mounting logs writable,
--insecure-no-authbehind a proxy that does not authenticate). - Detection completeness: a score is a heuristic. A clean score is not proof that an IP is harmless, and a high score is not proof of intent.
Supported versions
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. There is no long-term support branch.