feat(snap): vendor ssh in openshell snap and remove ssh-keys interface#2280
Open
olivercalder wants to merge 1 commit into
Open
feat(snap): vendor ssh in openshell snap and remove ssh-keys interface#2280olivercalder wants to merge 1 commit into
olivercalder wants to merge 1 commit into
Conversation
Previously, the openshell snap used the ssh-keys interface to get access to the host's ssh binary, which is used for sandbox connect/exec/forward. However, ssh-keys is a privileged interface which also grants access to the public and private ssh keys on the host. As such, it required manual connection in order to be used. This weakened the security sandbox of the snap, and hurt the UX of installing it. This commit changes this by removing the `ssh-keys` interface and instead vendoring the `ssh` binary within the snap. This is safe because OpenShell always invokes the `ssh` binary with `StrictHostKeyChecking=no`, `UserKnownHostsFile=/dev/null`, and `GlobalKnownHostsFile=/dev/null`, and never uses any host credentials or ssh configuration. Openshell only ever access to `~/.ssh/config` to write OpenShell-managed aliases, and this can safely live within the snap sandbox, rather than leaking into the host environment. Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR removes the
ssh-keysinterface and instead vendors thesshbinary within the snap.This is safe because OpenShell always invokes the
sshbinary withStrictHostKeyChecking=no,UserKnownHostsFile=/dev/null, andGlobalKnownHostsFile=/dev/null, and never uses any host credentials or ssh configuration. Openshell only ever access to~/.ssh/configto write OpenShell-managed aliases, and this can safely live within the snap sandbox, rather than leaking into the host environment.Related Issue
Addresses: #2277
Changes
ssh-keysinterface from the OpenShell snapsshbinary within the OpenShell snapTesting
mise run pre-commitpassesChecklist