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>
19 KiB
Configuration
Urutau has no configuration file. Everything is a flag with a URUTAU_* environment default (cli.md), which suits a container. The secrets are environment variables only.
Secrets
| Variable | Meaning |
|---|---|
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 (see Peers) 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. |
Keep both in .env (never versioned) or in your orchestrator's secret store.
Settings
Every variable below has a flag of the same meaning (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 state lives: snapshot urutau-state.gob, geo/, tor/, events/, incidents.json and enforce.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 | 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 |
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 |
Log sources
| Variable | Default | Meaning |
|---|---|---|
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_PROBE_LOG |
/logs/host/probe.log |
kernel log of new connections to ports nobody serves, written by the host kit (see Probes); empty disables, a missing file just stays at waiting |
Noise, trust and monitoring
| Variable | Default | Meaning |
|---|---|---|
URUTAU_TRUSTED |
empty | trusted CIDRs or IPs, comma separated; their events are dropped entirely. 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, 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 |
Federation
| Variable | Default | Meaning |
|---|---|---|
URUTAU_PEERS |
empty | peers to aggregate, comma separated name=https://url (the flag --peer repeats instead) |
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. Anything else refuses to start |
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 |
Second firewall (enforce)
| Variable | Default | Meaning |
|---|---|---|
URUTAU_ENFORCE |
off |
off; observe (decides in memory and shows what it would ban, writes nothing); on (also appends the decisions to URUTAU_ENFORCE_LOG for the host fail2ban). Anything else refuses to start |
URUTAU_ENFORCE_LOG |
/logs/enforce/decisions.log |
decision file appended in on mode; on without it refuses to start |
URUTAU_ENFORCE_UNBAN_LOG |
unban.log next to URUTAU_ENFORCE_LOG |
file where the dashboard's Unban button writes its requests, read by the host |
URUTAU_ENFORCE_SHARE |
off |
on: exchange decisions and unbans with the peers every 30 s; each side 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 when URUTAU_EGRESS_LOG exists at start), on or off; anything else refuses to start |
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 every minute, so workloads keep their name when the address changes on a redeploy |
URUTAU_EGRESS_WORKLOADS |
empty | named workloads and their role, see 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 /etc/resolv.conf and /logs/host/resolv.conf |
URUTAU_EGRESS_ALLOW |
empty | environment only, no flag: CIDRs or IPs of legitimate periodic pollers that must not raise beaconing findings. The peers' 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 |
In the container image the 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 probe, egress and container map files are in the same /logs/host directory. The compose file adds URUTAU_VERSION (image tag), URUTAU_IMAGE and URUTAU_PUBLISH (host address and port), see .env.example. It passes only some variables to the container (docker.md); add any other URUTAU_* variable, such as the URUTAU_ENFORCE_* and URUTAU_EGRESS_* ones, to its environment block.
Noise and monitoring
- Traefik headers. Log
Sec-Fetch-Site,Sec-Fetch-DestandRefererso 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=keepand--accesslog.fields.headers.names.Referer=keep. A request framed by another page (Sec-Fetch-Siteofcross-siteorsame-site, or a sub-resourceSec-Fetch-Destsuch asimageorscript) 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_IGNOREalready 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. - 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 ascanner,exploitorbruteforceit 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 (okornotfound) are filtered. When empty, onlyokanswers are filtered: anotfoundcarrying a monitor User-Agent still counts, because anyone can send that header.
Geolocation and analytics
Country, city and ASN come from the DB-IP Lite databases (city and ASN), which Urutau downloads and refreshes by itself into URUTAU_GEO_DIR. Without them (for example on an air-gapped host) the dashboard works and the geographic fields stay empty; to run offline, place the dbip-city-lite-YYYY-MM.mmdb and dbip-asn-lite-YYYY-MM.mmdb files in that directory and set URUTAU_GEO_UPDATE=0. The databases are licensed CC BY 4.0: keep the attribution (the dashboard footer and the README already carry it).
The geolocation databases are checked every 24 hours (--geo-update), but DB-IP publishes a new one only once a month, so most checks find nothing new; the file is replaced after it is verified.
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.
Peers (hub mode)
URUTAU_PEERS=web1=https://urutau.web1.example,db1=https://urutau.db1.example
URUTAU_PEER_TOKEN=<shared secret>
On each peer, set the same URUTAU_PEER_TOKEN (or one URUTAU_PEER_TOKEN_<NAME> per peer on the hub). The peer token opens only the federation routes: GET /api/v1/peer/export (the hub asks every 15 seconds for 1h, 24h, 7d and 30d), GET /api/v1/peer/stream (live events), GET /api/v1/peer/period (the study of a period or an IP), GET /api/v1/peer/egress and, when URUTAU_ENFORCE_SHARE=on, GET/POST /api/v1/peer/decisions and POST /api/v1/peer/unban. Peer URLs must be https (plain http is accepted only for loopback): the peer token travels in a header. To restrict who may call these routes, set URUTAU_PEER_ALLOW on the peer to the hub's address; when the peer sits behind a proxy, also set URUTAU_TRUSTED_PROXY so the real client address is the one compared. Peer names must be unique and cannot be all or the hub's own name. With URUTAU_PEER_BLOCKLIST=off the hub's blocklist lists only its own IPs.
Snapshot and retention
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.
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) logs them from the kernel to /var/log/urutau/probe.log; Urutau reads that file as URUTAU_PROBE_LOG, 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.
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. Urutau never gets privileges: it only decides which addresses deserve a ban and appends one line per decision to a file, and a fail2ban jail on the host applies it.
URUTAU_ENFORCE=observedecides in memory and shows in the dashboard what it would ban; nothing is written. Use it first.URUTAU_ENFORCE=onappends<time> urutau decision=ban ip=<ip> reason=<slug> score=<n> ttl=<s> host=<name> src=<local|peer>toURUTAU_ENFORCE_LOG. The host side is theurutaujail and theurutau-allportsaction installed byinstall.sh --enforce(docker.md). The jail uses the host's ownignoreip, 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, writes <time> urutau unban ip=<ip> allow=<seconds> to the unban file and, with URUTAU_ENFORCE_SHARE=on, tells the peers. 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. 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 when the log exists. 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.