Ingress
Also called Inbound traffic, Preview URLs
Ingress is the inbound traffic that reaches a machine from outside, and the path a platform builds to carry it there. For a sandbox, it is how people and programs reach a service running inside, such as a web app. The service listens on a port inside the sandbox, and something outside has to connect that port to the world. Most platforms do this with a shared proxy and a public URL for each port.
Sandboxes rarely have public addresses of their own. Each one usually sits on a private network behind its host, reached through a virtual network interface with only a private address. A public address for every sandbox would use up scarce IPv4 addresses and expose every listening port that firewall rules leave open. A proxy at the edge instead gives one controlled way in, where the platform decides what each request may reach.
Ingress is the counterpart of egress control, which governs the traffic that leaves a sandbox. The proxy runs outside the sandbox, in front of many hosts, so code inside cannot change its rules. Each request takes an extra hop through it, which adds a little latency and makes the proxy a part that every request depends on. On some platforms a request for a stopped sandbox starts it again, following its lifecycle rules, while on others it gets an error.
Routing
Routing is the step in which the proxy decides which sandbox and port should receive a request. Most platforms encode both in the hostname, for example by putting the port and a sandbox ID into one subdomain. A wildcard DNS record points every such name at the proxy, so a new sandbox needs no DNS change. The proxy reads the name from the HTTP Host header or the TLS server name indication, then looks up where that sandbox runs.
The lookup maps a sandbox to its host and private address, data that the control plane keeps. Proxies cache these answers, since asking for each request would slow every connection. A cached answer goes stale when a sandbox moves to another host or stops, so the cache needs a short lifetime or pushed updates. Routing by path, such as one prefix per port, also works, but it breaks apps that expect to sit at the root of a site.
HTTP is the easy case, since every request names its host. WebSocket connections, used by live reload and browser terminals, start as HTTP and then stay open, so the proxy must not close them early. Plain TCP carries no hostname, so a raw port such as a database needs a dedicated public port or a tunnel. SSH often goes through a separate gateway that checks each user and routes the session to the right sandbox.
TLS termination
TLS termination is the decryption of incoming encrypted connections at the proxy, before they travel on to the sandbox. The proxy holds the certificate for the public names, often one wildcard certificate for every subdomain of the platform domain. A wildcard covers only one level of subdomain, which is one reason sandbox hostnames stay flat. The service inside the sandbox can then serve plain HTTP and still be reached over HTTPS.
Ending TLS at the proxy lets it read each request, which it needs to route by path or to check credentials in headers. The traffic from the proxy to the host then crosses the internal network, either in plain text or encrypted again. The proxy sees everything in the requests, including passwords and tokens sent to the service. TLS passthrough is the alternative, where the proxy routes by server name indication alone and the sandbox holds the key. Passthrough keeps the proxy out of the content, but the proxy can then no longer check what each request carries.
Authentication
Edge authentication is the checking of who sends a request before the proxy forwards it to the sandbox. Development servers and tools started by an agent usually have no login of their own, so anyone with the URL could use them. The proxy closes that gap by asking for a token, sent in a header or set as a cookie after a login. Requests without valid credentials stop at the edge and never reach the sandbox.
Many platforms let the owner mark a port public, for example to share a preview of a web app. A public URL is open to anyone who learns it, and URLs leak through logs and shared links. Random sandbox IDs make URLs hard to guess, but they do not replace a check. Signed URLs that expire after a set time sit between the two, since a leaked link stops working.
Security
Ingress security is the protection of visitors and of the platform from what sandboxes serve. Untrusted code can serve anything on a public URL, including phishing pages under the platform's domain. Platforms therefore serve sandboxes from a domain separate from their main site, so pages from a sandbox cannot read the main site's cookies. Within that domain, one sandbox could still set a cookie on the parent domain that the browser then sends to every other sandbox. Adding the domain to the Public Suffix List makes browsers treat each subdomain as a separate site, which blocks such cookies.
The proxy is also where a platform limits traffic from outside. Rate limits per sandbox stop a flood of requests before it reaches the host. Logs at the proxy record every request, which helps when a sandbox is reported for abuse.
Use cases
Ingress decides how a service inside a sandbox is reached and who may reach it.
-
Previewing web apps. An agent that builds a web app starts a server inside the sandbox. A public URL routed by the proxy lets a person open it in a browser over HTTPS. The server itself can speak plain HTTP, since TLS ends at the proxy.
-
Private development tools. Development servers and tools started by an agent usually have no login of their own. The proxy asks for a token before forwarding requests, so requests without one never reach the sandbox.
-
Live connections. Live reload and browser terminals use WebSocket connections that start as HTTP and then stay open. The proxy has to keep them open rather than close them early.
-
Sharing a preview. Marking a port public shares a preview with anyone who has the URL. Signed URLs that expire after a set time limit how long a leaked link works.
-
Databases and raw ports. A database speaks plain TCP, which carries no hostname for the proxy to route by. It needs a dedicated public port or a tunnel instead.