Title: Connection log: attribute SSH/IDE sessions to the Coder user · Issue #27006 · coder/coder · GitHub
Open Graph Title: Connection log: attribute SSH/IDE sessions to the Coder user · Issue #27006 · coder/coder
X Title: Connection log: attribute SSH/IDE sessions to the Coder user · Issue #27006 · coder/coder
Description: Problem The connection log records which Coder user opened a workspace app or forwarded a port (user_id is populated for workspace_app / port_forwarding rows), but it cannot attribute SSH / VS Code / JetBrains sessions to a user. Those r...
Open Graph Description: Problem The connection log records which Coder user opened a workspace app or forwarded a port (user_id is populated for workspace_app / port_forwarding rows), but it cannot attribute SSH / VS Code...
X Description: Problem The connection log records which Coder user opened a workspace app or forwarded a port (user_id is populated for workspace_app / port_forwarding rows), but it cannot attribute SSH / VS Code...
Opengraph URL: https://github.com/coder/coder/issues/27006
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Connection log: attribute SSH/IDE sessions to the Coder user","articleBody":"### Problem\n\nThe connection log records which Coder user opened a workspace app or forwarded\na port (`user_id` is populated for `workspace_app` / `port_forwarding` rows),\nbut it cannot attribute SSH / VS Code / JetBrains sessions to a user. Those\nrows are reported by the agent via `ReportConnection`, and the agent does not\nknow which Coder user is on the other end of the tunnel —\n`coderd/agentapi/connectionlog.go` sets `UserID: uuid.NullUUID{Valid: false}`\nwith the comment:\n\n> It's not possible to tell which user connected. Once we have the capability,\n> this may be reported by the agent.\n\nFor enterprise auditors this leaves a gap: the connection log can answer \"who\nopened the web terminal on workspace X\" but not \"who SSH'd into workspace X\".\n\n### Where the identity is available\n\nEvery SSH/IDE session rides a tailnet tunnel that the client opens via\n`GET /api/v2/workspaceagents/{id}/coordinate` (used by `coder ssh`,\n`coder port-forward`, the VS Code extension, etc. — anything that calls\n`workspacesdk.DialAgent`). That request is authenticated with the user's API\nkey, so at tunnel-establishment time coderd has `user_id`, `api_key_id`,\nclient IP (via the `ExtractRealIP` middleware) and `User-Agent`.\n\n### Proposal\n\nWrite a connection-log row from `workspaceAgentClientCoordinate` when the\nWebSocket is accepted, under a new `connection_type` value (working name\n`tailnet`). The row carries `user_id`, `ip`, `user_agent`, `workspace_id`,\n`agent_name` and renders via `WebInfo` so the connecting user appears in the\ndashboard Connection Log. PR: #27005.\n\n### Open questions\n\n- **Naming.** `tailnet` vs `tunnel` — happy to rename.\n- **`api_key_id`.** `connection_logs` has no column for it today. Would it be\n reasonable to add one in the same migration so these rows (and potentially\n `workspace_app` / `port_forwarding` rows) can also record which key was used?\n- **Debounce.** The workspace-app path debounces via\n `workspace_app_audit_sessions`; this proposal currently writes one row per\n handshake. If reconnect volume is a concern the same debounce could be\n applied here.\n- **`/api/v2/tailnet`.** Coder Desktop uses the user-scoped tailnet endpoint\n instead. It has no single target workspace, so it doesn't map cleanly onto\n `connection_logs`; left out of the initial PR.\n","author":{"url":"https://github.com/cdigiamo-ant","@type":"Person","name":"cdigiamo-ant"},"datePublished":"2026-07-06T17:01:01Z","url":"https://github.com/coder/coder/issues/27006"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8dc037b1-4a05-6fbb-7f3c-48124abb30bf |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E244:296654:1EA975D:28DAE41:6B01745B |
| html-safe-nonce | dc87c72fb46ba3d47f3aa6903f23dedaa843dcc0074176b70946a3501955a33c |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMjQ0OjI5NjY1NDoxRUE5NzVEOjI4REFFNDE6NkIwMTc0NUIiLCJ2aXNpdG9yX2lkIjoiNjg2NzY1MTQyODE5OTAwMzIyNyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5a669548043600c85b11acaab82b3b27d196a11a7174141b50b8c55a9310e239 |
| hovercard-subject-tag | issue:4821355903 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/coder/coder/27006/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f4615a29f11cab2c67b604964dd65b6cdd275ac2fec46c5f9ce6a5559fd1a1a5/coder/coder/issues/27006 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f4615a29f11cab2c67b604964dd65b6cdd275ac2fec46c5f9ce6a5559fd1a1a5/coder/coder/issues/27006 |
| og:image:alt | Problem The connection log records which Coder user opened a workspace app or forwarded a port (user_id is populated for workspace_app / port_forwarding rows), but it cannot attribute SSH / VS Code... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | cdigiamo-ant |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| go-import | github.com/coder/coder git https://github.com/coder/coder.git |
| octolytics-dimension-user_id | 95932066 |
| octolytics-dimension-user_login | coder |
| octolytics-dimension-repository_id | 440752086 |
| octolytics-dimension-repository_nwo | coder/coder |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 440752086 |
| octolytics-dimension-repository_network_root_nwo | coder/coder |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width