feat: run sandbox transports in disposable workers
The control plane opened ssh connections itself, so a malicious ssh server attacked the process that held the database, the master key, and every room's keys. It now starts one worker per target and workspace. The worker gets one target key on stdin, binds loopback behind a random token, and serves exec, files, the pty, and the preview proxy. It has no database and no master key, and a closed stdin ends it. The preview HTTP client moved into the worker too. The app sees a typed response, and the worker caps bodies, output tails, handshakes, and transport waits. Direct targets now reject loopback, private, link-local, multicast, unspecified, carrier-grade NAT, and documentation addresses when a target is created and again when its worker starts. TOGETHER_ALLOW_PRIVATE_TARGETS=1 lifts the check for a server that runs on one private network.
This commit is contained in:
1 parent
a8f7e74ba0
commit
fc684115b5
16 files changed
+1355
-208
No files matched your search
@@ -366,10 +366,16 @@ pub async fn archive(
|
||||
Path(id): Path<String>,
|
||||
) -> AppResult<Json<Value>> {
|
||||
owner_of(&state, &id, &user.user.id)?;
|
||||
let workspace: String = state.db.conn().query_row(
|
||||
"SELECT workspace FROM rooms WHERE id = ?1",
|
||||
rusqlite::params![id],
|
||||
|row| row.get(0),
|
||||
)?;
|
||||
state.db.conn().execute(
|
||||
"UPDATE rooms SET archived_at = ?1 WHERE id = ?2",
|
||||
rusqlite::params![now_ms(), id],
|
||||
)?;
|
||||
state.workers.remove_workspace(&workspace).await;
|
||||
Ok(Json(json!({ "ok": true })))
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user