feat(ssh): add configurable client authentication methods#1637
feat(ssh): add configurable client authentication methods#1637Eugeny merged 7 commits intowarp-tech:mainfrom
Conversation
|
Thank you for the contribution! However this needs a few changes:
|
…ers UI Move SSH authentication method configuration from YAML config to the Parameters database model, as requested by maintainer. Changes: - Add ssh_client_auth_publickey, ssh_client_auth_password, and ssh_client_auth_keyboard_interactive fields to Parameters entity - Add database migration (m00025_ssh_client_auth) - SSH server now reads auth settings from Parameters and builds MethodSet dynamically at startup - Add "SSH Authentication Methods" section to Parameters.svelte with toggle switches for each auth method - AuthPolicyEditor now filters credential options based on enabled SSH auth methods (e.g., hides Password option when password auth is disabled globally) This addresses the reviewer feedback on PR warp-tech#1637 to avoid introducing new config options and instead use the Parameters database model. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
…ers UI Move SSH authentication method configuration from YAML config to the Parameters database model, as requested by maintainer. Changes: - Add ssh_client_auth_publickey, ssh_client_auth_password, and ssh_client_auth_keyboard_interactive fields to Parameters entity - Add database migration (m00025_ssh_client_auth) - SSH server now reads auth settings from Parameters and builds MethodSet dynamically at startup - Add "SSH Authentication Methods" section to Parameters.svelte with toggle switches for each auth method - AuthPolicyEditor now filters credential options based on enabled SSH auth methods (e.g., hides Password option when password auth is disabled globally) This addresses the reviewer feedback on PR warp-tech#1637 to avoid introducing new config options and instead use the Parameters database model. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Hi @Eugeny, I've updated the PR to address your feedback: Changes made:
Files changed (9):
Tested on a live deployment - password auth is properly blocked when disabled. |
…ers UI Move SSH authentication method configuration from YAML config to the Parameters database model, as requested by maintainer. Changes: - Add ssh_client_auth_publickey, ssh_client_auth_password, and ssh_client_auth_keyboard_interactive fields to Parameters entity - Add database migration (m00025_ssh_client_auth) - SSH server now reads auth settings from Parameters and builds MethodSet dynamically at startup - Add "SSH Authentication Methods" section to Parameters.svelte with toggle switches for each auth method - AuthPolicyEditor now filters credential options based on enabled SSH auth methods (e.g., hides Password option when password auth is disabled globally) This addresses the reviewer feedback on PR warp-tech#1637 to avoid introducing new config options and instead use the Parameters database model. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
- Update openapi-schema.json with SSH client auth parameter fields - Add comprehensive E2E tests for SSH authentication method configuration: - API tests for get/update parameters - E2E tests verifying password auth disabled blocks password login - E2E tests verifying pubkey auth disabled blocks pubkey login - E2E tests verifying enabled methods work correctly - E2E tests verifying fallback when all methods disabled 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
Inform admins that if all SSH authentication methods are disabled, all will be enabled by default as a safety fallback. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
249b292 to
7adbd3e
Compare
Ensures errors from updateParameters are properly propagated rather than silently ignored. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
Also added a small fix: |
|
Thanks! I've updated the PR to apply options without a server restart as well as added checks to actually reject auth attempts since Note that I've removed the fallback when all options are disabled since it's a bit counterintuitive to the user |
|
@all-contributors add @liebermantodd for code |
|
I've put up a pull request to add @liebermantodd! 🎉 |
Adds @liebermantodd as a contributor for code. This was requested by Eugeny [in this comment](#1637 (comment)) --------- Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
Hey folks! First off, thanks for Warpgate - it's been great for managing SSH access to my infrastructure.
The Problem
I've been running Warpgate exposed on port 2222 and getting absolutely hammered by SSH brute-force attacks. Even with Fail2Ban, the sheer volume of password auth attempts was filling up my SQLite database (got up to 2 million log entries, 600MB, eventually corrupted).
I wanted to do what I do with regular sshd - just disable password auth entirely so attackers aren't even offered it as an option. But I noticed the auth methods are hardcoded in
run_server:The Fix
Added three config options to
SshConfig:All default to
trueso existing configs work unchanged. When you start up you'll see:Testing
I followed your existing test patterns and added
test_ssh_client_auth_config.pywith:TestSshClientAuthPasswordDisabled- password rejected, pubkey still worksTestSshClientAuthPublickeyDisabled- pubkey rejected, password still worksTestSshClientAuthAllMethodsDisabled- nothing works when all disabledTestSshClientAuthDefaultConfig- default config allows everything (backward compat)Would love if you could run the test suite against this. I tested manually on my own Warpgate instance and it's working well - brute force attackers now get immediately rejected instead of being able to spam password attempts.
Let me know if you'd like any changes to the approach or if I should adjust how the config options are named/structured.
Closes #1561