Repository navigation
Description
User Story
Our cluster blocks direct internet access. With dedicated supervisors, approved sandbox HTTPS traffic already goes through our corporate egress proxy. We need the same route with shared supervisors so we can add sandboxes without running a supervisor Pod for each one.
Problem Statement
The supervisor already supports chaining sandbox egress through an upstream proxy. Docker, Podman, and MicroVM expose this in gateway TOML through https_proxy and related settings in their driver tables. Kubernetes exposes the same capability as the Helm upstreamProxy setting for dedicated supervisors. Gateway configuration
The gap is configuring that same route for a shared supervisor. On Kubernetes, setting supervisor_topology=gateway together with https_proxy, proxy_auth_secret_name, or proxy_ca_bundle fails validation in v0.1.9 and current main.
Impact / Why This Matters
Kubernetes operators who require this route must keep one supervisor Pod per sandbox. The proxy gives their sandboxes an approved route to external APIs while keeping destination controls and egress logs in one place. Policy-approved API calls in the original Kubernetes report timed out when the cluster blocked direct connections. Original Kubernetes feature request
Proposed Design
Allow shared supervisors to use the existing upstream proxy settings supplied by the compute driver. On Kubernetes, pass the Helm upstreamProxy settings to the shared supervisor through the sandbox's launch registration.
The supervisor already accepts HTTP CONNECT on its sandbox-facing policy proxy. When the operator configures an upstream proxy, the supervisor sends a separate CONNECT to that proxy for eligible egress. The upstream listener can be a standalone forward proxy or an explicit web proxy on a firewall.
OpenShell checks the destination before opening the tunnel and applies any request-level policy before forwarding the HTTP request. The upstream proxy applies its own access controls. The application URL, hostname inside the tunnel, and sandbox credential bindings stay intact. The outer CONNECT uses a validated IP and port by default. For explicit HTTPS proxying, connectByHostname lets operators opt into hostname-based CONNECT when their proxy rules require it.
This Kubernetes example uses placeholder names for the proxy and CA ConfigMap. Use these values with the v0.1.7 render check below.
gatewayConfig:
openshell.drivers.kubernetes:
supervisor_topology: gateway
upstreamProxy:
url: http://proxy.example.test:3128
noProxy: ""
caBundle:
configMapName: upstream-proxy-caThe operator controls the proxy URL, authentication, and trust. The supervisor keeps proxy credentials and bootstrap secrets outside workloads and preserves the route and sandbox attribution across handoff.
The setting applies to eligible sandbox egress. The supervisor uses a separate connection for gateway control traffic. Explicit plain HTTP forwarding dials the destination directly if policy allows it. Where enabled, policy-approved transparent TCP can also use CONNECT. A noProxy match selects direct egress under the same OpenShell policy. If the selected proxy is unavailable, the connection fails without a direct fallback. Supervisor dial paths
Acceptance Criteria
- The Kubernetes shared topology accepts valid upstream proxy settings with one or more supervisor replicas, including a CA bundle and supported Secret-backed authentication. Existing provider identity validation still applies.
- An approved HTTPS request uses the upstream CONNECT proxy and preserves the application URL and HTTP authority inside the tunnel. The outer CONNECT uses a validated IP and port by default. A request-level denial sends no HTTP request bytes upstream, even when CONNECT or TLS setup has already opened a connection.
- Proxy failure refuses requests selected for proxying without a direct fallback. Workload proxy environment variables can't override the operator's route.
- Proxy credentials and supervisor bootstrap secrets stay outside workloads, and requests retain the originating sandbox's policy and credential bindings.
- Pool handoff and recovery preserve the configured route, trust and sandbox attribution.
- Documentation includes a generic HTTP CONNECT proxy example covering routing, authentication and CA trust. The dedicated supervisor path continues to work.
Alternatives Considered
Supervisor middleware and gateway interceptors can process requests or control admission. They don't enable the rejected shared-pool proxy configuration. The inspected middleware request-result contract doesn't expose selection of this network hop.
A CONNECT proxy can enforce destination access and log connection attempts. Inspecting HTTPS requests or MCP content also requires TLS termination and inspection rules at the component that performs that inspection.
Agent Investigation
No response
Checklist
- I've reviewed existing issues and the published docs
- This is a design proposal, not a "please build this" request
Activity