Files
urutau/SECURITY.md
T
Lucas RayanandClaude Opus 5.5 b7462c14fa
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 27s
CI / Dependency audit (push) Successful in 18s
CI / Tests (Linux, race detector) (push) Successful in 58s
Release / Plan (reuse the published image?) (push) Successful in 4s
Release / ci (push) Skipped
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Successful in 13s
Release / Gitea release (push) Successful in 5s
feat: 1.2.0 attack intelligence, replay, 30-day history and new interface
Intelligence: attack families mapped to MITRE ATT&CK, network type from
ASN/rDNS without external APIs, request cadence, sessions with
recon/probe/exploit/access/banned stages, campaigns across IPs, verdict
with reasons, recommended actions, exposure detection (2xx with a body
on sensitive paths), STIX 2.1 export, FCrDNS for search engine bots,
optional Tor exit list.

Data: 30-day retention, twelve ranges plus custom from/to, an on-disk
event log (daily files, hourly gzip members, size cap, corruption and
disk-full tolerant), /events, /period, /metrics with stable per-hour
metrics, an extended /ip/{ip}, and peer /period merged on the hub.

Interface: layout system with fixed card sizes, range picker in the
URL, IP analysis page, Replay page, Geography down to state and city
(Natural Earth admin-1), Live page redesigned with stable metrics and a
reusable attack map. Demo data and documentation screenshots.

Security: bounded and deadline-limited period computations, linear
campaign clustering, singleflight caches, sanitized peer studies, event
query budgets, gzip bomb guard.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-14 21:45:59 -03:00

10 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.

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/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.
  • 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.
  • 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.
  • 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.
  • 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).
  • 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 (govulncheck runs 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-auth behind 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 1.x release is supported. There is no long-term support branch.