feat: add reverse ssh sandbox targets
A sandbox behind NAT could not reach the room. A reverse target dials a tunnel-only sshd on the server, forwards localhost:22 to a loopback port, and the worker connects there. The server assigns the port and writes one authorized_keys line per tunnel target. The key carries permitlisten for that port; the sshd allows remote forwarding only, with no shell or local forwarding. The tunnel private key is shown once and never stored; rotating it rewrites the file. The target list and setup dialog carry the command, and the docs include the sshd config and sidecar requirements.
This commit is contained in:
1 parent
fc684115b5
commit
d85f68a176
20 files changed
+893
-38
No files matched your search
+5
-1
@@ -318,7 +318,7 @@ impl WorkerSandbox {
|
||||
private_key: key,
|
||||
host_fingerprint: target.host_fingerprint.clone(),
|
||||
},
|
||||
allow_private: state.config.allow_private_targets,
|
||||
allow_private: state.config.allow_private_targets || target.kind == "tunnel",
|
||||
})
|
||||
};
|
||||
self.state
|
||||
@@ -515,6 +515,9 @@ impl WorkerState {
|
||||
user_name: self.target.user_name.clone(),
|
||||
private_key_ciphertext: String::new(),
|
||||
host_fingerprint: self.target.host_fingerprint.clone(),
|
||||
// The worker does not use the kind; it is already past the
|
||||
// target check. A valid value keeps the row honest.
|
||||
kind: "direct".into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -877,6 +880,7 @@ mod smoke {
|
||||
user_name: "vhaudiquet".into(),
|
||||
private_key_ciphertext: secrets.seal_str(&key).expect("seal"),
|
||||
host_fingerprint: None,
|
||||
kind: "direct".into(),
|
||||
};
|
||||
let state = Arc::new(AppState {
|
||||
config,
|
||||
|
||||
Reference in new issue
Block a user