Release / Plan (reuse the published image?) (push) Successful in 4s
CI / Docker image (build and smoke test) (push) Skipped
CI / Format and vet (push) Successful in 1m29s
CI / Tests (Linux, race detector) (push) Failing after 1m48s
CI / Dependency audit (push) Successful in 21s
Release / ci (push) Failing after 1m50s
Release / Build image (amd64) (push) Skipped
Release / Build image (arm64) (push) Skipped
Release / Publish tags (push) Skipped
Release / Gitea release (push) Skipped
Always-on Go service (stdlib only) that follows the Traefik JSON access log, the sshd log and the fail2ban log of a host, classifies attacks, scores sources, keeps bounded aggregates with snapshots, and serves an embedded dashboard with live updates, offline geolocation (DB-IP Lite), privacy-friendly traffic analytics, an exportable blocklist and token-authenticated federation between instances. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7.8 KiB
7.8 KiB
Changelog
English · Português
Format based on Keep a Changelog; versions follow SemVer.
[Unreleased]
[1.0.0] - 2026-11-14
First release.
Added
- Log collection from the Traefik JSON access log,
/var/log/auth.log(sshd) and/var/log/fail2ban.log, followed through rotation and truncation, with a bounded line size and a backfill of rotated files on the first start. - Classification into
ok,notfound,scanner,exploit,bruteforce,ssh-fail,ssh-probe,ssh-okandban, with percent-decoding (twice) of request paths against evasion. - IP scoring by category weight: 50 or more is hostile, 10 or more is suspicious.
- Rolling state of up to 7 days (minute buckets, top lists, per-IP detail and a live feed), saved to a snapshot file every 60 seconds and on shutdown, restored with the file offsets so a restart never replays a log.
- Embedded dashboard (English and Portuguese, light and dark) with KPIs, a timeline, an IP table with filters and sorting, an IP detail drawer, a live feed over Server-Sent Events, top paths, domains, User-Agents and users, per-host and per-source status.
- Token login with a signed
HttpOnly,SameSite=Strictsession cookie and a per-IP rate limit; bearer token for the API. - JSON API:
/api/health,/api/v1/summary,/api/v1/ips,/api/v1/ip/{ip},/api/v1/events/stream. - Exportable blocklist as
/api/v1/blocklist.txtand/api/v1/blocklist.json. - Federation:
--peer name=https://urlaggregates other instances. A hub only callsGET /api/v1/peer/export?range=1h|24h|7d({"v":1,"summary":...,"traffic":{...}}, top 500 IPs with detail, cached 5 s) every 15 s, with a 4 s timeout, an 8 MB limit, no redirects,httpsrequired outside loopback, and sanitized, capped peer data.--peer-allow/URUTAU_PEER_ALLOWlimits the source CIDRs of the export. - Offline geolocation (country, city, ASN) from the DB-IP Lite databases (CC BY 4.0), downloaded and refreshed by Urutau (
--geo-dir,--geo-update) and read by a built-in, dependency-free MMDB reader. - User-Agent parsing into browser, operating system, device, bots and attack tools.
- Privacy-friendly web analytics for legitimate traffic (Traffic tab): unique visitors by a daily-salted hash, pages, referrers, countries, browsers, devices, latency p50 and p95, bytes and a world map. The IP of a legitimate visitor is never persisted. Threats and Traffic are separate tabs.
- Reverse DNS enrichment of listed IPs.
- Noise filters:
--trusted/URUTAU_TRUSTED(alias--ignore) drops events from trusted CIDRs, and--monitor-ua/URUTAU_MONITOR_UAkeeps benign monitoring requests (such as Uptime-Kuma) out of the traffic numbers. urutau doctor [--json]to check the configuration, the sources, the data directory, the geolocation databases and the snapshot; the JSON output carriesgeoandstate.--monitor-from/URUTAU_MONITOR_FROM(a monitor User-Agent only counts from those networks; without it onlyokanswers are filtered) and--domains/URUTAU_DOMAINS(analytics domain allowlist,*.example.comaccepted).urutau healthcheck, the imageHEALTHCHECK(the image has nocurl, 28.5 MB).- Default
--ignorewidened:192.168.0.0/16,fc00::/7,fe80::/10,100.64.0.0/10,169.254.0.0/16join the previous ranges. --admin-users/URUTAU_ADMIN_USERS: admin immunity lasts 24 hours after the last successful SSH login of those users (off unless the list is set; a login in the same second as a strong attack gives no immunity) and a later strong signal cancels it. The blocklist takes?family=4|6.- Requests framed by another page (
Sec-Fetch-Sitecross-site/same-site or a sub-resourceSec-Fetch-Dest) create an IP record like any other but weigh 0.25 per event (at most 30 points per IP from them, never a strong signal; ignored with an attack-tool User-Agent); Traefik must logSec-Fetch-Site,Sec-Fetch-DestandReferer. - Serialized wrong-login attempts from a blocked client (1 s delay doubling to 30 s, parallel ones get 429 at once); the correct token always gets in.
- Compose mounts only
/data/coolify/proxy/logsand the dedicated host directory/var/log/urutau(read-only); documented how to prepare it (rsyslog copy of sshd, fail2banlogtarget, logrotate), the knownlogger -t sshdlimitation, how to point Traefik's access log at/traefik/logs/access.logon Coolify and to keep Urutau on a network shared only with Traefik. --trusted-proxy/URUTAU_TRUSTED_PROXY(default: loopback only; the compose file creates theurutau-edgenetwork,10.250.0.0/24, and trusts just that):X-Forwarded-Foris accepted only from these proxies, read right to left, for the login rate limit and--peer-allow.- Multi-arch container image (
linux/amd64,linux/arm64),docker-compose.ymland a Coolify deployment guide. - Gitea CI (format, vet, race tests,
govulncheck, UI translation coverage, image smoke test), a release workflow that reuses an already published image, a weekly audit, local hooks andscripts/check.sh. - Bilingual documentation (English and Portuguese).
Security
URUTAU_TOKENmust have at least 32 characters and about 128 bits of estimated entropy (length times Shannon entropy; periodic or sequential tokens are refused) (generate withopenssl rand -base64 48;-hex 32also works). Peer tokens follow the same rule and must differ fromURUTAU_TOKEN; peers without a token are refused. Secrets can come fromURUTAU_TOKEN_FILEandURUTAU_PEER_TOKEN_FILE, and each peer can have its own client credential,URUTAU_PEER_TOKEN_<NAME>(the general one is the fallback). The export accepts only the server tokenURUTAU_PEER_TOKEN; per-peer values never open it, and peer names that collide in the variable (my-peer/my_peer) are refused. Anadminflag from a peer is ignored and a peer'sStrongonly counts with a score of 50 or more.- Revocable sessions (random in-memory id, logout revokes and closes the live stream, restart invalidates), cross-site login and logout rejected, a blocked login answers 429 while the correct token still gets in after a 1 second delay, failed bearer tokens count, IPv6 limited per /64,
Referrer-Policy: same-origin. /api/healthreturns only{"status":"ok"}; log file paths are never shown in the UI or to peers.- Scanner and exploit hits answered with 2xx or 3xx weigh 0.5; a hostile level needs a score of 50 plus a strong signal (attack tool, two or more categories, a ban, or a refused strong exploit); an IP with a successful SSH login is never hostile and never blocklisted; the blocklist only holds globally routable IPs outside
--ignoreand--trusted; IPv6 is aggregated by /64 and exported asx:x:x:x::/64; up to 20,000 tracked IPs and a 160 MiB soft memory limit. - A domain gets an analytics slot only after a 2xx answer;
/.gitignore,/.git-credentialsand similar paths are scanner hits; snapshots from earlier versions migrate without losing traffic history and inactive domains are pruned; top pages normalize token-looking segments to:id. - The peer token only opens
GET /api/v1/peer/export(other routes answer 403 to it,URUTAU_TOKENgets 401 there, and the export is 404 without a peer token). - HTTP server timeouts,
MaxHeaderBytesof 16 KB,POST /logincapped at 4 KB and at most 20 live-stream clients (503 withRetry-After, 20 s heartbeat). - A corrupt snapshot is moved to
urutau-state.gob.corruptand the service starts empty, reading the logs again. - Built with Go 1.26.11, which fixes five standard library vulnerabilities.
- 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-authis refused unless the bind address is loopback.