Files
buryan-infra/docs/architecture/TOOL-GATEWAY-ENFORCEMENT.md
T
architect e6bac6ae2e
lint / hygiene (push) Failing after 25s
lint / hygiene (pull_request) Failing after 20s
standard / check (pull_request) Successful in 10s
[STAGE5] Reference Tool Gateway enforcement (UID agent-gw)
2026-11-29 18:06:03 +03:00

997 B

Tool Gateway enforcement — reference agent

Дата: 2026-11-29.

Что сделано

  • создан системный пользователь agent-gw (UID 999);
  • его единственный разрешённый TCP egress — 127.0.0.1:9137;
  • DNS UDP 53 разрешён;
  • остальное — REJECT;
  • агент запускается как agent-gw и ходит только через Tool Gateway.

Проверка

runuser -u agent-gw -- python3 /opt/agent-gw/agent.py
gateway_agent_ok catalog.read 6884

runuser -u agent-gw -- curl http://127.0.0.1:9120/catalog
connect failed / direct=000

Ограничение

Это enforcement для reference-агента.
Production-агенты (hub-bots, hub-agents) ещё не переведены; Gate G5 не закрыт.

Откат

iptables -D OUTPUT -m owner --uid-owner 999 -j AGENT_GW_OUT
iptables -F AGENT_GW_OUT
iptables -X AGENT_GW_OUT
userdel agent-gw