Skip to content

feat(server): add an opt-in remote-serving mode - #257

Open
mangopep wants to merge 1 commit into
GoDiao:mainfrom
mangopep:feat/remote-serving-auth-hardening-24
Open

mangopep wants to merge 1 commit into
GoDiao:mainfrom
mangopep:feat/remote-serving-auth-hardening-24

Conversation

@mangopep

Copy link
Copy Markdown

An SSH forward ends at the remote host's loopback interface, so the sidecar treats every tunneled request, and every local process on that host, as the desktop app and skips the H5 token. SSH authenticates whoever opens the tunnel; it does not identify the caller.

With --remote-serving (or SERVER_REMOTE_SERVING=1) the server:

  • listens on a loopback address only, and refuses --auth-required together with the mode;
  • requires the H5 access token on every /api and /ws request, whatever the address or Origin, and answers 503 while H5 access is off;
  • only answers requests whose Host is a loopback name, and refuses proxied requests (Forwarded, X-Forwarded-*, X-Real-IP, Via);
  • returns 403 for the H5 control plane, /terminal and the browser-host endpoints;
  • keeps /sdk and /proxy on their existing credentials but refuses any Origin.

SERVER_REMOTE_SERVING must be 1 or 0; any other value stops the server instead of leaving the mode off.

The mode is off by default and nothing changes without it. This is the server half only: it is not a complete remote backend. Known limits are listed in docs/features/remote-backend/tech-design.md: /proxy has no credential, the /sdk session token is in the CLI's argv, and a build that does not know the flag ignores it and trusts the tunnel.

Part of #24

An SSH forward ends at the remote host's loopback interface, so the sidecar
treats every tunneled request, and every local process on that host, as the
desktop app and skips the H5 token. SSH authenticates whoever opens the
tunnel; it does not identify the caller.

With --remote-serving (or SERVER_REMOTE_SERVING=1) the server:

- listens on a loopback address only, and refuses --auth-required together
  with the mode;
- requires the H5 access token on every /api and /ws request, whatever the
  address or Origin, and answers 503 while H5 access is off;
- only answers requests whose Host is a loopback name, and refuses proxied
  requests (Forwarded, X-Forwarded-*, X-Real-IP, Via);
- returns 403 for the H5 control plane, /terminal and the browser-host
  endpoints;
- keeps /sdk and /proxy on their existing credentials but refuses any Origin.

SERVER_REMOTE_SERVING must be 1 or 0; any other value stops the server
instead of leaving the mode off.

The mode is off by default and nothing changes without it. This is the server
half only: it is not a complete remote backend. Known limits are listed in
docs/features/remote-backend/tech-design.md: /proxy has no credential, the
/sdk session token is in the CLI's argv, and a build that does not know the
flag ignores it and trusts the tunnel.

Part of GoDiao#24

This branch has not been deployed

No deployments
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.

2 participants