Add SSH connector with RFC 8693 token exchange#4527
Open
nikogura wants to merge 9 commits intodexidp:masterfrom
Open
Add SSH connector with RFC 8693 token exchange#4527nikogura wants to merge 9 commits intodexidp:masterfrom
nikogura wants to merge 9 commits intodexidp:masterfrom
Conversation
Signed-off-by: Nik Ogura <nik.ogura@gmail.com>
Signed-off-by: Nik Ogura <nik.ogura@gmail.com>
Signed-off-by: Nik Ogura <nik.ogura@gmail.com>
Signed-off-by: Nik Ogura <nik.ogura@gmail.com>
Signed-off-by: Nik Ogura <nik.ogura@gmail.com>
Signed-off-by: Nik Ogura <nik.ogura@gmail.com>
Signed-off-by: Nik Ogura <nik.ogura@gmail.com>
Signed-off-by: Nik Ogura <nik.ogura@gmail.com>
Author
|
govulncheck shows zero vulnerabilities, the only known CVE (CVE-2025-30204) was fixed in v5.2.2, and we're on v5.3.1. I have no visibility into the snyk report. Happy to fix any problems if you'll tell me what they are. |
Member
Author
|
Oh, that's lovely! I'll happily wait for that. Thank you! |
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
connector/ssh) enabling SSH key-based authentication for DexDesign
Security model: Identity comes from admin-configured mappings, not JWT claims. The connector
uses a secure 2-pass JWT verification process — claims are untrusted until cryptographic signature
verification succeeds against administrator-configured SSH public keys. This prevents key injection
attacks where clients embed their own verification keys.
Dual-audience tokens: JWTs use
audfor the Dex instance ID andtarget_audiencefor thefinal consumer (e.g., kubectl), following RFC 8693 semantics.
Challenge/response mode: Alternative to JWT-based auth for environments where clients can't
create JWTs. Dex issues a cryptographic challenge, the client signs it with their SSH key, and
Dex verifies the signature. Includes user enumeration prevention (identical responses for
valid/invalid users).
Changes
connector/ssh/ssh.goconnector/ssh/ssh_test.goconnector/ssh/README.mdserver/server.goserver/handlers.goaudienceparameter support to token exchange handlerserver/token_exchange_integration_test.gogo.mod/go.sumgolang.org/x/crypto/sshdependencyTest plan
go test ./connector/ssh/...— unit tests (JWT validation, challenge/response, security fixes, timing attack prevention)go test -run TestTokenExchangeSSH_SQLite ./server/— full token exchange flow through SQLitego test -run TestTokenExchangeSSH_InMemory ./server/— full flow through in-memory storagego test -run TestTokenExchangeSSH_LDAPCoexistence ./server/— connector routing with LDAP coexistencego test -run TestTokenExchangeSSH_Postgres ./server/— requiresDEX_POSTGRES_ENT_HOSTgo test -run TestTokenExchangeSSH_MySQL ./server/— requiresDEX_MYSQL_ENT_HOSTmake lintpasses (golangci-lint v2.4.0, 0 issues)go test -race ./server/...— no race conditions