Commit graph

22 commits

Author SHA1 Message Date
56577b727e Add accept_any_key option to accept any SSH key and pass fingerprint
New YAML config option: accept_any_key: true
- Accepts any public key without verification against authorized_keys
- Still passes the client's key fingerprint in the upstream username
- Format: fp:FINGERPRINT.originaluser
- Useful for proxying to apps that identify users by SSH key fingerprint
2025-12-21 09:05:05 -05:00
Josh Bleecher Snyder
17c0645dc6
fix typos, re-run protoc (#686)
* fix typos in docs

* use keys in named literal

For easier grepping, and better stability.

* libplugin: regenerate with v1.36.10

592ca79999 upgraded
the dependency, but didn't actually regenerate.
2025-12-04 12:58:56 -08:00
Josh Bleecher Snyder
89ab72bee0
all: run gofumpt (#652)
* all: run gofumpt

https://github.com/mvdan/gofumpt

The main appeal for me here is that my (and many other peoples')
editors run this on save, so doing a single diff here
keeps other diffs minimal.

* .github/workflows: add gofumpt checker
2025-08-29 20:04:31 -07:00
Josh Bleecher Snyder
297b8c60e7
extract skel into its own package (#596)
This breaks the dependency of libplugin
on x/crypto, enabling people to use libplugin
without having conflicts over the crypto module.
2025-05-23 12:42:44 -07:00
Boshi Lian
2c2d378f86
Fix linting issues (#595)
* fix lint

* Bump golangci-lint action to v8 and update linting args

* fix lint errors

* fix: correct loop condition in main function to process remaining arguments
2025-05-18 00:59:18 -07:00
Brennan Kinney
4160c956ab
docs: Improve YAML plugin config examples (#564)
* docs: Improve YAML plugin config examples

* docs: Plugin (`workingdir`) - Add FAQ entry regarding key type
2025-04-16 12:20:04 -07:00
eesaanatluri
4fce1dcb45
feat: Decide upstream based on user's unix group membership (#536)
* feat: Decide upstream based on user's unix group membership

If a username is not defined, groupname is parsed. Check if the
user is part of that group and route them to the associated host
defined in the config file for the yaml plugin

* style: fix formatting with gofmt

* feat: Look up user groups only when groupname defined in yaml config

* fix: inefficient assignment because of unused var

* feat: fallback to next rule on group lookup failure

Instead of failing on group lookup errors, the matcher now skips the
groupname rule and proceeds to the next, eventually failing through to
the catchall rule.

* feat: test cases for group based routing in yaml plugin

* Revert "feat: fallback to next rule on group lookup failure"

This reverts commit 622ee9f1eb3157d04f57c068179bb74de8db3a1f.

Handles the error returned by getUserGroups instead of ignoring it,
to prevent potential runtime issues when user lookup fail

* feat: Check if a user is known to the system before group lookup

This will let the rule matching logic skip to the next pipe in the yaml
config when a user is not found on the system.
Note the variable name change from user to username to avoid ambiguity
dur to name collision with os/user package.

* feat: Avoid redundant user lookup

* feat: Improve error handling for user and group lookup failures

* feat: Use appropriate test user name for group routing
2025-04-07 23:53:16 -07:00
Boshi Lian
085ba59c58
support cross auth type mapping (#483)
* add testcase

* add fix

* Refactor skelpipe wrappers to separate password and private key handling
2024-11-10 03:01:52 -08:00
Boshi Lian
4694964c11
Refactor plugin/yaml/main.go and plugin/yaml/yaml.go to support multiple YAML config files (#477) 2024-10-28 01:57:55 -07:00
Boshi Lian
14ceadb8e8
add skel plugin for code sharing (#473)
* introduce plugin skel to reuse code

* Refactor code to use libplugin.NewSkelPlugin for plugin/kubernetes/main.go
Add YAML Plugin skel.go for plugin/yaml

* Fix code scanning alert no. 6: Incorrect conversion between integer types

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* fix gpt

* fjx password handling in SkelPlugin and skelpipeToWrapper

* go fmt

* Refactor Docker plugin to use skelpipe wrapper

* Refactor skel.go to use container username instead of client username

* revert yaml test order

* fix public and password mess up

* Refactor working dir to use skel

* revert deleted file

* Refactor skel.go to remove unused code and simplify MatchConn function

* Refactor skel.go to read userKnownHosts file in KnownHosts function

* remove workingdirbykey from goreleaser

* Refactor workingdir.go to use libplugin.SplitHostPortForSSH for parsing host and port

* Refactor skel.go to remove unused code and simplify MatchConn function

* merge doc into workingdir

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
2024-10-24 23:15:26 -07:00
Boshi Lian
ed19d555b5
add support for ssh ca auth (#467) 2024-10-23 02:41:25 -07:00
Boshi Lian
a3f69952c0
Refactor code to use subtle.ConstantTimeCompare for secure comparison (#466)
* Refactor code to use subtle.ConstantTimeCompare for secure comparison

* Refactor code to use subtle.ConstantTimeCompare for secure comparison
2024-10-21 02:46:19 -07:00
Boshi Lian
4db98899f4
YAML Plugin add regex match group (#464)
* add support for match group replace

* update doc
2024-10-20 02:15:46 -07:00
Boshi Lian
39f5eef98b
Refactor YAML schema to support multiple authorized keys and known hosts (#463)
* add coverage for go proxy

* Refactor CLI flag name for allowed proxy addresses

* Refactor YAML schema to support multiple authorized keys and known hosts

* add testcases

* Refactor YAML schema to support multiple authorized keys and known hosts

* go fmt

* go fmt
2024-10-20 00:20:40 -07:00
Boshi Lian
e7b276d6a5
reuse VerifyHostKeyFromKnownHosts (#143) 2023-02-28 17:11:17 -08:00
Boshi Lian
12aab7a076
add missing password field 2023-02-28 16:45:42 -08:00
Boshi Lian
27b1babbc0 smaller image by keeping k8s and dir plug only 2022-10-25 00:35:45 +00:00
Boshi Lian
4c8baddefc fix cache set 2022-10-23 08:07:30 +00:00
Boshi Lian
319824e564 align log level across plugins
happy lint

happy lint
2022-08-05 23:08:01 +00:00
Boshi Lian
4d2f795701 fix empty password bug 2022-07-18 22:28:51 +00:00
Boshi Lian
1d8dde5d02 add yaml doc 2022-07-09 19:13:00 +00:00
Boshi Lian
5bdf895dfc add yaml plugin 2022-07-09 18:33:32 +00:00