mirror of
https://github.com/ovh/the-bastion.git
synced 2026-05-09 16:35:33 +02:00
[GH-ISSUE #376] connect to remote host with vscode ssh extension #102
Labels
No labels
answered
bug
documentation
enhancement
enhancement
feature
feature
kept-open-for-info
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/the-bastion#102
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ksourdrille on GitHub (Mar 19, 2023).
Original GitHub issue: https://github.com/ovh/the-bastion/issues/376
Hello,
Do you know if there is a way to connect to the remote host with vscode ssh extension trought the bastion ?
i saw we can't use proxy jump and proxy command, but i don't know if someone already done this without this commands.
Kélian
@speed47 commented on GitHub (Mar 21, 2023):
Hello,
I'll have to look into it more deeply, but there are chances it won't work, unfortunately.
This is because the Remote SSH extension of vscode uses the
-Doption ofssh, which opens a local port that talks the SOCKS4/5 protocol, and tunnels it to the server, enabling unfiltered and unlogged access to any remote party accessible from the server itself. This is a variant of the-Land-Roption, which uses SOCKS instead of forwarding a single port.Obviously this is very handy for dev environments and several other use cases, but this would break the auditability, traceability and authorization check mechanisms of the bastion, as you can tunnel and potentially access other things that the bastion won't have a chance to see, hence not able to allow, deny, or even log. The protocol break done on the bastion side is actually done to prevent this kind of loophole, among other things.
Now, this use case on a bastion reserved to dev environments and flagged as such in a more global security policy, might be legit, as long as it's explicitly allowed, but again I'll have to look into it, as I'm not sure this can be done, given the design of the bastion. There's apparently a mode that can be enabled in the Remote SSH extension that can use
-Linstead of-D, by forwarding a UNIX socket instead of forwarding a port, I'll try to look into that.@speed47 commented on GitHub (Mar 23, 2023):
Actually, had a look yesterday, and I might have a PoC with
-Lthat roughly seems to work, but it would need to be tested by people using vscode daily. Would you be interested to test it?@ksourdrille commented on GitHub (Mar 23, 2023):
Hi @speed47, Thanks for your answer and your time :)
of course I am interested :)
What should I do?
Kélian
@ksourdrille commented on GitHub (Apr 8, 2023):
Hi @speed47,
Do you have any news for me?
Kélian
@speed47 commented on GitHub (Apr 11, 2023):
Yes, I'll be writing the documentation this week. There is one major drawback, unfortunately: due to an OpenSSH bug that is known since at least 2016 but still unfixed (!), one has to enable local port forwarding on the bastion for the vscode plugin to work (even if it doesn't actually require local port forwarding), so that's something to have in mind. It's not really a good practice to enable this on a bastion, but it might be acceptable for dev environments (if you have a separate bastion for production environments, for example).
I'll outline this in the documentation. Stay tuned.
@ksourdrille commented on GitHub (Apr 12, 2023):
Hello,
Ok thank you for all :)
Kélian
@ksourdrille commented on GitHub (May 23, 2023):
Hi @speed47
Do you somes good news about this topic ?
Kélian
@Pierrelefort commented on GitHub (Dec 22, 2023):
I've also attempted to connect to a remote host using the SSH extension without any luck.
If there are any updates or if there's an opportunity for me to lend a hand in debugging, I'd greatly appreciate the information.
@pawcykca commented on GitHub (Nov 18, 2024):
Hi @speed47, did you manage to prepare the mentioned documentation somewhere?
I have tried to setup vscode wit ssh-remote extensiob but I stuck on connecting to installed vscode via bation.