feat(ingress): firewall telemetry of inbound attempts (host kit --ingress)

Observation-only nftables table (prerouting -150, counters and a
rate-limited log, never drops or modifies), a per-minute counters file,
probe sources ingress and ingresscnt, a per-host hourly aggregate in the
hub (exact totals, sampled ports/ASNs/countries, banned share by the
hub's own ban state, no ban feedback loop), GET /api/v1/ingress, a
Defense section, doctor check, docs EN/pt-BR and tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas RayanandClaude Sonnet 5.5 committed 2026-11-23 09:09:16 -03:00
1 parent 4143bf599e
commit aefdcea8d2
40 files changed
+1684 -11

No files matched your search

+17
View File
@@ -48,6 +48,23 @@ if [ "$ui" = 1 ]; then
fi
step "bash script syntax" bash -c 'for f in scripts/*.sh .githooks/*; do bash -n "$f" || exit 1; done'
step "host kit shell syntax" bash -c 'for f in deploy/host/install.sh deploy/host/urutau-ingress-tick deploy/host/urutau-containers-map deploy/host/urutau-containers-watch deploy/host/urutau-unban; do sh -n "$f" || exit 1; done'
# nftables syntax of the host kit tables, validated in a throwaway network
# namespace (no root needed); skipped when nft or unshare cannot do it.
if command -v nft >/dev/null && unshare -rn true 2>/dev/null; then
step "host kit nftables syntax" bash -c 'for f in deploy/host/urutau-egress.nft deploy/host/urutau-ingress.nft; do
t=$(mktemp); sed "s/@WAN@/eth0/g" "$f" > "$t"
unshare -rn nft -c -f "$t" || { rm -f "$t"; exit 1; }
rm -f "$t"
# the observation table must never decide the fate of a packet
if [ "$f" = deploy/host/urutau-ingress.nft ] && grep -Eq "^[^#]*[[:space:]](drop|accept|reject|queue|dnat|snat|masquerade|redirect|ct mark set|meta mark set)([[:space:]]|$)" "$f"; then
echo "$f: the ingress table must only count and log" >&2; exit 1
fi
done'
else
skip "host kit nftables syntax" "nft or unprivileged namespaces not available"
fi
if python3 -c 'import yaml' 2>/dev/null; then
step "workflows and templates (valid YAML)" python3 -c "