Allow callers to select an exact SSH config - #791
Open
sdmcclain wants to merge 2 commits into
Open
Conversation
sdmcclain
force-pushed
the
feature/exact-ssh-config
branch
2 times, most recently
from
August 13, 2026 17:44
1ef964f to
12d880e
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #791 +/- ##
==========================================
+ Coverage 73.83% 74.08% +0.24%
==========================================
Files 97 97
Lines 8900 8970 +70
Branches 5855 5918 +63
==========================================
+ Hits 6571 6645 +74
+ Misses 1720 1718 -2
+ Partials 609 607 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
ET currently reads the user and system SSH configuration before launching its own SSH subprocesses. In managed jumphost clients this can rewrite an authenticated target through HostName, import LocalForward entries, or apply ambient ProxyJump and SetEnv behavior before the caller-owned SSH policy runs. Add --ssh-config <absolute-path|none> and --no-ssh-config. An exact path becomes ET's sole configuration input for destination and jumphost resolution and is passed as -F to both spawned SSH shapes; none disables configuration entirely. Preserve the existing ambient behavior when neither option is present. Fail closed on missing, non-regular, symlinked, relative, or shell-unsafe paths. The conservative path alphabet is required because OpenSSH renders the implicit -J child through a shell without quoting its propagated -F value. Tests record both destination and direct-jump argv, verify exact -F propagation, and cover the disabled-config shape.
IsSshConfigPathSafeForProxyJump treated "starts with /" as absolute and rejected drive letters and backslashes, so native Windows config files could never pass. Use std::filesystem::path::is_absolute() and allow ':' and '\\' only on Windows, where OpenSSH and CreateProcess need them. Co-authored-by: Cursor <cursoragent@cursor.com>
MisterTea
force-pushed
the
feature/exact-ssh-config
branch
from
September 1, 2026 18:34
12d880e to
1d373f7
Compare
Owner
|
Rebased onto current
|
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
Motivation
ET currently parses user and system SSH configuration before starting SSH. A managed client that already owns its SSH policy cannot prevent ambient HostName, ProxyJump, LocalForward, or SetEnv directives from changing the target or session behavior.
An exact configuration root lets such clients supply a private, auditable SSH policy without modifying user dotfiles or inheriting unrelated settings.
Safety and behavior
An explicit file must be absolute, readable, regular, non-symlinked, and use a conservative path alphabet (ASCII letters, digits, slash, dot, underscore, and hyphen). Metadata is checked before opening the file, so non-regular paths such as FIFOs fail without blocking. The alphabet restriction matters because OpenSSH constructs its implicit ProxyJump command through a shell and propagates -F without quoting its value.
The selected file is used by ET for destination and jumphost lookup and is passed to the destination bootstrap and direct jumphost SSH processes. OpenSSH propagates that -F setting to the implicit ProxyJump child. The none form skips ET config parsing and invokes SSH with -F none.
Validation
Compatibility with #790
This change has no semantic dependency on #790 and intentionally does not change the existing --ssh-option behavior. Its tests use no destination SSH options, so their expectations are valid before or after #790. As a textual compatibility check, the #790 patch applies cleanly on top of this branch with every hunk succeeding. Either PR can land first.