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>
This commit is contained in:
Lucas RayanandClaude Opus 5.5 committed 2026-11-15 22:14:50 -03:00
1 parent 23a7a5963a
commit 8546d14cef
130 files changed
+9396 -3311

No files matched your search

+39 -6
View File
@@ -2,9 +2,16 @@
# 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 --remove # undo everything
# 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 --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.
#
# Idempotent. Urutau itself never gets privileges: it only reads these logs and
# writes its ban decisions to /var/log/urutau-enforce/decisions.log.
@@ -12,9 +19,22 @@ set -eu
here=$(cd "$(dirname "$0")" && pwd)
uid=${URUTAU_UID:-10001}
probe=0
enforce=0
remove=0
for arg in "$@"; do
case "$arg" in
--probe) probe=1 ;;
--enforce) enforce=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 [ "${1:-}" = "--remove" ]; then
if [ "$remove" = 1 ]; then
systemctl disable --now urutau-egress.service urutau-containers-map.timer urutau-logrotate.timer urutau-unban.path 2>/dev/null || true
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 \
@@ -52,7 +72,16 @@ systemctl restart urutau-egress.service
systemctl start urutau-containers-map.service urutau-containers-map.timer
echo "egress logging on $wan: /var/log/urutau/egress.log, map: /var/log/urutau/containers.map"
if [ "${1:-}" = "--enforce" ]; then
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
@@ -65,5 +94,9 @@ if [ "${1:-}" = "--enforce" ]; then
systemctl enable --now urutau-unban.path >/dev/null
fail2ban-client -t >/dev/null
fail2ban-client reload
echo "fail2ban jail 'urutau' on; mount /var/log/urutau-enforce:/logs/enforce (rw) in the container"
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