Skip to content

refactor(env): reach pgweb and db-mcp only through the gateway's /svc routes - #752

Closed
andrewpark-scaleai wants to merge 1 commit into
andrewpark/vuln-3253-sidecars-behind-gatewayfrom
andrewpark/vuln-3253-close-console-tunnels
Closed

andrewpark-scaleai wants to merge 1 commit into
andrewpark/vuln-3253-sidecars-behind-gatewayfrom
andrewpark/vuln-3253-close-console-tunnels

Conversation

@andrewpark-scaleai

@andrewpark-scaleai andrewpark-scaleai commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

DO NOT MERGE until every consumer of db_web_url and db_mcp_url reads the gateway URLs from #751 instead.

Why

After #751, the gateway serves pgweb and db-mcp at /svc/. This PR makes that the only way in, so deploys expose one port (the gateway's) and records carry one set of console URLs.

What changed

  • The VM path asks the sandbox provider to expose only the gateway's port.
  • The compose file publishes no port for pgweb or db-mcp. Containers on env-network still reach them.
  • The container path creates the pgweb and db-mcp sandboxes with expose_externally=False, as it already does for other sidecars.
  • DeployedGateway drops db_web_url and db_mcp_url, so no deploy writes them. DeployedGatewayEnv still reads them from older records for one release.

Blast Radius

  • Any reader of db_web_url or db_mcp_url gets None on a new deploy's record. Every one must move to db_web_gateway_url / db_mcp_gateway_url first.
  • OpenClaw's environment card loses its "database" link on new envs. Its owner confirmed on 2026-11-19 that nobody uses it.
  • A deploy whose gateway image predates feat(gateway): serve pgweb and db-mcp at /svc/ routes #751 can't reach the consoles. Promote the gateway image first.
  • Envs that pin an older framework keep their old ports until they are rebuilt.

Verification

  • The VM deploy test asserts create_vm gets only the gateway and sidecar ports.
  • tst/unit/env/test_env.py loads a record from an older deploy.
  • Unit trees tst/unit/env, tst/unit/providers and tst/unit/cli pass. ruff check src tst passes.
  • Local Docker and a live modal_vm: the consoles answer through the gateway with the token.

RetriggerView in GreptileConfidence Score: 5/5

The code appears safe to merge once the stated rollout requirements are met.

Summary

This PR makes the gateway the only public route to pgweb and db-mcp while keeping older deployment records readable.

  • Database consoles are reached through the gateway instead of separate public ports.

andrewpark-scaleai explicitly defers merging until all consumers use the gateway URLs and the gateway image from #751 is promoted. They also acknowledge losing OpenClaw’s database link because its owner confirmed nobody uses it. These are stated rollout requirements and accepted behavior, not new findings.

Reviews (2) · Last reviewed commit: "refactor(env): reach pgweb and db-mcp on..." · Reviewed by Greptile

@andrewpark-scaleai
andrewpark-scaleai force-pushed the andrewpark/vuln-3253-close-console-tunnels branch from d462b3c to a6e6d1b Compare November 17, 2026 23:56
@andrewpark-scaleai
andrewpark-scaleai force-pushed the andrewpark/vuln-3253-sidecars-behind-gateway branch from 9459d49 to 7985a79 Compare November 18, 2026 23:54
@andrewpark-scaleai
andrewpark-scaleai force-pushed the andrewpark/vuln-3253-close-console-tunnels branch from a6e6d1b to 67eadaa Compare November 18, 2026 23:55
@andrewpark-scaleai andrewpark-scaleai changed the title fix(env): give pgweb and db-mcp no public address, only the gateway's route (VULN-3253) refactor(env): reach pgweb and db-mcp only through the gateway's /svc routes Nov 19, 2026
@andrewpark-scaleai
andrewpark-scaleai marked this pull request as ready for review November 19, 2026 18:21
@andrewpark-scaleai
andrewpark-scaleai requested a review from a team as a code owner November 19, 2026 18:21
… routes

The VM path exposes only the gateway's port, the compose file publishes no
port for pgweb or db-mcp, and the container path creates their sandboxes
with expose_externally=False. DeployedGateway drops db_web_url and db_mcp_url,
so new records name the consoles only at db_web_gateway_url and
db_mcp_gateway_url. DeployedGatewayEnv still reads both from older records
for one release.
@andrewpark-scaleai
andrewpark-scaleai force-pushed the andrewpark/vuln-3253-close-console-tunnels branch from 67eadaa to fc74893 Compare November 19, 2026 18:48
@andrewpark-scaleai
andrewpark-scaleai force-pushed the andrewpark/vuln-3253-sidecars-behind-gateway branch from 7985a79 to 5d14668 Compare November 19, 2026 18:48
@andrewpark-scaleai
andrewpark-scaleai deleted the andrewpark/vuln-3253-close-console-tunnels branch November 19, 2026 18:52
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