Skip to content

Add mitmproxy system user for UID-based iptables exclusion - #61

Merged
fjswhl merged 1 commit into
mainfrom
feat/mitmproxy-uid-user
Apr 9, 2026
Merged

Add mitmproxy system user for UID-based iptables exclusion#61
fjswhl merged 1 commit into
mainfrom
feat/mitmproxy-uid-user

Conversation

@fjswhl

@fjswhl fjswhl commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Creates a dedicated mitmproxy system user in the E2B template
  • Configures sudoers for CA cert installation (cp + update-ca-certificates)

Context

The transparent proxy currently excludes upstream hosts (sandbox-proxy.moxt.ai, web-api.moxt.ai) by destination IP to prevent routing loops. However, these hosts share the same Cloudflare Anycast IPs as admin.moxt.ai, so excluding one inadvertently bypasses all *.moxt.ai subdomains.

With a dedicated user, transparent-proxy.ts (in paramoxt) can spawn the proxy adapter as mitmproxy and use iptables --uid-owner to bypass only the proxy adapter's own traffic — independent of destination IP.

Depends on

paramoxt PR (to be created) that modifies transparent-proxy.ts to:

  1. Spawn proxy adapter with sudo -u mitmproxy
  2. Add --uid-owner iptables rule
  3. Remove IP-based exclusion for shared Cloudflare hosts

Made with Cursor

The transparent proxy currently excludes upstream hosts by destination IP
to prevent routing loops. However, sandbox-proxy.moxt.ai, web-api.moxt.ai,
and admin.moxt.ai all share the same Cloudflare Anycast IPs, so excluding
one inadvertently bypasses all of them.

This creates a dedicated `mitmproxy` user so the proxy adapter can run
under a separate UID. iptables then uses `--uid-owner` to bypass only
the proxy adapter's own outbound traffic, allowing domain-level routing
control regardless of shared IPs.

Made-with: Cursor
@fjswhl
fjswhl merged commit a092845 into main Apr 9, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant