[PM-41898] SSH Agent v2: add per-key destination filtering - #22384
Open
V1rg1lee wants to merge 3 commits into
Open
[PM-41898] SSH Agent v2: add per-key destination filtering#22384V1rg1lee wants to merge 3 commits into
V1rg1lee wants to merge 3 commits into
Conversation
Collaborator
|
Thank you for your contribution! We've added this to our internal tracking system for review. Details on our contribution process can be found here: https://contributing.bitwarden.com/contributing/pull-requests/community-pr-process. |
1 task
V1rg1lee
force-pushed
the
feature/ssh-agent-destination-filtering
branch
from
August 12, 2026 22:26
854749a to
7b8acfc
Compare
djsmith85
reviewed
Aug 13, 2026
djsmith85
left a comment
Contributor
There was a problem hiding this comment.
Thank you for your contribution @V1rg1lee! The Desktop-Native product team will evaluate your contribution and discuss with the engineering team
Platform-owned changes are limited to the updated napi-file. @bitwarden/team-desktop-native-dev can re-request a review once they are happy with the proposed solution.
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.
🎟️ Tracking
Related to #13401
GitHub Discussion: https://github.com/orgs/bitwarden/discussions/22382
Community feature request:
https://community.bitwarden.com/t/ssh-agent-allow-specifying-limiting-private-key-offers/79954
📔 Objective
The SSH agent can expose enough identities for an SSH server to hit
MaxAuthTriesbefore OpenSSH reaches the correct key.This PR adds optional per-key destination filtering to SSH Agent v2 using the verified host-key fingerprint already provided by OpenSSH through
session-bind@openssh.com.SSH key items on Desktop can now be associated with one or more SHA256 host-key fingerprints. These settings are stored locally on Desktop and are not added to synchronized cipher data.
When a verified destination is available, the agent returns identities in this order:
Keys restricted to other destinations are omitted. Ordering within each group remains stable.
If no verified session binding is available, all identities are returned as before.
This allows a user to configure only the key they expect to use for a server and have it prioritized ahead of unrestricted Bitwarden identities, without requiring every other key to be configured first.
The destination setting is an identity-offering optimization, not an authorization boundary. This PR does not add hostname/IP matching, host-key discovery,
ssh-keyscan, or changes to signing authorization.🧪 Testing
Automated testing includes:
cargo fmt --checkcargo check -p desktop_napinode scripts/lint-rust.mjs --only clippyManual end-to-end testing was performed against a real OpenSSH server on Windows.
Before this change:
Too many authentication failures.After configuring only the correct key for the destination and leaving the other keys unrestricted:
I also tested the stricter case where unrelated keys were restricted to other destinations. In that case, the agent returned only the matching identity.
📸 Screenshots
Configured destination
Validation