apex-twin --proxy 8798 puts the gate in front of clients that do not speak
MCP: curl -x, a browser, an agent's fetch. Bind is loopback only.
- absolute-URI HTTP requests are parsed, checked with apex_scope_check() BEFORE
the origin socket is opened, audited, and forwarded with the request line
rewritten to origin form; headers lose Proxy-Connection/Connection and gain
Connection: close;
- Content-Length bodies are forwarded; chunked request bodies are refused with
501 rather than silently truncated;
- the exchange is stored through the same traffic store as http_capture, so
proxied and explicit captures sit together;
- CONNECT is tunnelled blind and recorded as metadata (host, port, bytes),
because this binary links no TLS stack; a half-close is propagated with
shutdown so the tunnel ends when the client does;
- out of scope -> 403 with the gate's reason in the body and a deny line in
audit.log.
The gate-bypass sabotage was seen red: with proxy_gate() skipped, the
out-of-scope request went out, 403 became 502, and the audit had no deny -
three checks failed.
197 checks, 40 tools. New systemd/apex-twin-proxy.service, loopback port,
no CAP_NET_RAW. Parser stores numbers unquoted; the proxy is serial on purpose.