Skip to content

docs(network): ports to keep open when running a firewall inside a sandbox - #338

Merged
beran-t merged 3 commits into
mainfrom
docs/network-default-private-range-blocking
Aug 10, 2026
Merged

docs(network): ports to keep open when running a firewall inside a sandbox#338
beran-t merged 3 commits into
mainfrom
docs/network-default-private-range-blocking

Conversation

@beran-t

@beran-t beran-t commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a "Running a firewall inside the sandbox" section to the Restricting public access page. If you run iptables inside a sandbox, it lists what must stay open so the sandbox keeps talking to the SDK:

  • All loopback (lo) traffic.
  • Inbound TCP to port 49983 (the envd control channel).
  • Inbound TCP to port 49999, if you use the Code Interpreter template.
  • Established and related connections, if you filter outbound traffic.

Why

A customer's template build failed repeatedly because a start-command iptables script dropped traffic on link-local / private ranges, which severed the sandbox's own control channel (thread T-7578). The docs never said which ports a guest-side firewall must preserve. This turns that into concrete, followable guidance rather than a blanket "do not do it".

Verified

Ports are source- and live-verified (via the e2b-engineer subagent against e2b-dev/infra, the SDKs, and the code-interpreter template):

  • envd control port 49983 is the single envd port (packages/envd/main.go:38,299, packages/shared/pkg/consts/envd.go:4) - every SDK op and public-URL proxying goes through it.
  • Code Interpreter server listens on 49999 (JUPYTER_PORT, JS consts.ts / Python constants.py; template start-up.sh) and proxies to Jupyter on localhost:8888, so loopback must stay open. Live repro: under a guest INPUT drop policy allowing only 49983, commands.run works but runCode times out until 49999 is allowed.
  • "Allow established/related" is the robust OUTPUT-chain rule for the control-channel return path (avoids naming a specific internal peer IP).

House style respected (no em dashes or semicolons in the added prose). Editing existing pages already wired in nav; no docs.json change. mintlify dev not run (known macOS ENAMETOOLONG crash per the docs-pr skill reference).

@mintlify

mintlify Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
e2b 🟢 Ready View Preview Aug 7, 2026, 3:16 PM

@cla-bot cla-bot Bot added the cla-signed label Aug 7, 2026
@beran-t
beran-t force-pushed the docs/network-default-private-range-blocking branch from 0c257d6 to c0187de Compare August 7, 2026 15:25
@beran-t
beran-t force-pushed the docs/network-default-private-range-blocking branch from c0187de to 8e85369 Compare August 7, 2026 15:33
@beran-t
beran-t marked this pull request as ready for review August 7, 2026 15:37
@beran-t
beran-t marked this pull request as draft August 7, 2026 15:44
@beran-t
beran-t force-pushed the docs/network-default-private-range-blocking branch from 8e85369 to b8b0844 Compare August 7, 2026 15:49
@beran-t beran-t changed the title docs(network): default private-range/metadata blocking + guest-firewall warning docs(network): document default private-range blocking + guest-firewall warning Aug 7, 2026
@beran-t
beran-t marked this pull request as ready for review August 7, 2026 15:49
@beran-t beran-t changed the title docs(network): document default private-range blocking + guest-firewall warning docs(network): warn against locking down the network from inside the sandbox Aug 7, 2026
@beran-t
beran-t force-pushed the docs/network-default-private-range-blocking branch from b8b0844 to 5bc224e Compare August 7, 2026 15:54
@beran-t
beran-t force-pushed the docs/network-default-private-range-blocking branch from 5bc224e to 73be61f Compare August 7, 2026 16:05
@beran-t beran-t changed the title docs(network): warn against locking down the network from inside the sandbox docs(network): ports to keep open when running a firewall inside a sandbox Aug 10, 2026
@beran-t
beran-t force-pushed the docs/network-default-private-range-blocking branch from 73be61f to 37b14f4 Compare August 10, 2026 08:53
@beran-t
beran-t merged commit 51cc3a8 into main Aug 10, 2026
8 checks passed
@beran-t
beran-t deleted the docs/network-default-private-range-blocking branch August 10, 2026 09:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants