-
Notifications
You must be signed in to change notification settings - Fork 0
[WRONG BRANCH] Require operator-paired GUI sessions for Remote Workspace mutations #531
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -157,8 +157,11 @@ async function handleRemoteWorkspaceRoutesOnDemand(ctx: ManagementContext): Prom | |
| status: ctx.req.method === "GET" ? 200 : 404, headers: { "cache-control": "no-store" }, | ||
| }); | ||
| } | ||
| if (ctx.req.method !== "GET" && ctx.principal !== "gui-session") { | ||
| return Response.json({ error: "A dashboard session is required for Remote Workspace changes." }, { status: 403 }); | ||
| if (ctx.req.method !== "GET" && ( | ||
| ctx.principal !== "gui-session" | ||
| || ctx.sessionControl?.isPaired(ctx.req, ctx.config) !== true | ||
| )) { | ||
| return Response.json({ error: "A paired dashboard session is required for Remote Workspace changes." }, { status: 403 }); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
For an enabled workspace mutation authorized as Useful? React with 👍 / 👎. |
||
| } | ||
| const { handleRemoteWorkspaceRoutes } = await import("./management/remote-workspace-routes"); | ||
| return handleRemoteWorkspaceRoutes(ctx); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the Hub dashboard is opened directly, the page is automatically given a
loopbackortailscale-identitysession, butgui/src/App.tsxrendersConnectPairingFormonly for a connected-client topology and only while no shared session exists. This new check therefore makes every Remote Workspace mutation return 403 without exposing any UI path to obtain the required pairing-issued session; even a manually paired session is replaced by an automatic one after reloading the Hub page. Add an in-dashboard upgrade path for these read-only sessions before enforcing this gate.Useful? React with 👍 / 👎.