Commit graph

77 commits

Author SHA1 Message Date
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
ElevenNotes
aa4c1292e3
feat(docker): set port default to 22 if not set (#672)
* feat(docker): set port default to 22 if not set

* fix(go): fmt space issue
2025-11-06 05:37:02 -08:00
Copilot
aebadec97b
Remove deprecated // +build directive from tools.go (#674) 2025-11-05 20:25:34 -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
Ben Perry
3dbb1a1b69
Metrics server plugin (#622)
* Metrics server plugin

* Link to metrics from root README
2025-07-17 15:43:48 -07:00
Boshi Lian
afd80aa590
fix(docker): enable API version negotiation for Docker client (#607) 2025-06-02 10:24:29 -07:00
Boshi Lian
f56c4b67e5
feat: Add username-router plugin for SSHPiper to route connections based on username (#599)
* feat: Add username-router plugin for SSHPiper to route connections based on username

* feat: Add username-router plugin to GoReleaser configuration
2025-05-25 04:20:21 -07:00
Boshi Lian
706a36b40e
feat: Enhance PipeSpec and FromSpec with AuthorizedKeysSecret (#581)
* feat: Enhance PipeSpec and FromSpec with AuthorizedKeysSecret

- Added AuthorizedKeysSecret field to FromSpec for referencing Kubernetes secrets.
- Updated deepcopy functions to handle new AuthorizedKeysSecret field.
- Modified CRD definition to include the new private_key_secret field.
- Refactored fake client and lister implementations to support new fields.
- Introduced shared informers and listers for Pipe resources.
- Updated code generation scripts to reflect changes in API structure.

* refactor: Rename private_key_secret to authorized_keys_secret in CRD schema

* feat: Add support for authorized_keys from secret in skel and update k8sworkload.yaml

* feat: Enhance authorized keys handling to include secret name check

* Update plugin/kubernetes/skel.go

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-05-25 03:48:17 -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
Boshi Lian
c93e3c2f4a
fix: skel.go - Add check for no CA public key before retrieving public key certs (#579) 2025-05-07 00:26:38 -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
diedpigs
9ff3550786
Feat: fail2ban whitelist (#546)
* feat: support whitelist in failtoban plugin

* test: add e2e test for failtoban ignore ip

* refactor: use netipx for easy contains check
2025-03-15 04:23:09 -07:00
Boshi Lian
e95d30fdc8
Enhance failtoban plugin with log-only mode and SIGHUP cache reset (#519) 2025-02-05 22:26:32 -08: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
23e18f4f7c
merge totp to workingdir (#476)
* merge totp to workingdir

* Refactor .goreleaser.yaml to remove plugin_totp build configuration
2024-10-28 01:09:28 -07:00
Boshi Lian
0e6168a6b8
Refactor plugin.proto and pluginbase.go to add support for metadata in connection context (#475)
* Refactor plugin.proto and pluginbase.go to add support for metadata in connection context

* go fmt

* move test plugin out

* Refactor Dockerfile to build test plugin in e2e/testplugin directory

* mv testplugin -> testgrpcplugin

* add test for connection metadata

* enable logging to stdout

* Refactor Dockerfile to build test plugin in e2e/testplugin directory
2024-10-27 23:57:21 -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
304dd72a53
update docker sdk to v25 (#455)
* update docker sdk to latest

* Refactor Docker plugin to use latest Docker SDK
2024-10-18 02:34:27 -07:00
Boshi Lian
57d0e21787
move Azure Device Code plugin for sshpiperd out of tree (#453) 2024-10-17 23:36:06 -07:00
Boshi Lian
450ed385b9
Update remotesigner version (#338)
* Update remotesigner version to v0.0.2

* Update remotesigner version to v0.0.3
2024-03-03 05:43:52 -08:00
Boshi Lian
82ac6a5fff
add remote signer api and e2e test of it (#320) 2024-02-11 01:54:55 -08:00
Haiker Sun
22af927e77
Add kubeconfig flag for k8s plugin (#296) 2024-01-04 06:51:44 -08:00
Boshi Lian
9fee039d93
Add PipeCreateErrorCallback to handle pipe creation errors (#290)
* Add PipeCreateErrorCallback to handle pipe creation errors

* Add test for FailtobanPipeCreateFail

* Fix missing newline at end of file in pluginbase.go
2023-12-24 03:54:49 -08:00
Boshi Lian
5a724c6dd3
fix docker plugin encoding (#278) 2023-12-12 11:54:33 -08:00
Boshi Lian
b97171bd7b
use ssh-publickey-cert for better naming (#223) 2023-09-10 01:14:18 -07:00
Boshi Lian
65b6b5868d
fix priority (#217)
* fix priority

* fix build
2023-09-03 04:36:40 -07:00
Boshi Lian
694d09affd
support password match/ca publickey for kubernetes (#211)
* add testcase

* refine testcases

* fix tab

* happy ql

* inline timeout

* add ca support for k8s
2023-08-26 18:07:36 -07:00
Matthew Atkinson
13fcc8c0a8
Add support for using CA certs for upstream ssh connection (#210) 2023-08-25 17:32:49 -07:00
Boshi Lian
2067fcb003
non return plugin callback now will be triggered together (#162)
* add failtoban plugin

* fmt

* bump ver

* add failtoban e2e

* add readme

* update readme
2023-07-11 01:32:05 -07:00
Boshi Lian
5b9091c42a
update dep (#146)
* update dep

* update crypto

* revert docker lib version
2023-03-12 05:15:22 -07:00
Boshi Lian
1cd6cd86d9
add callback for pipe start and pipe err (#145)
* add onstart onerr cb

* cover by e2e

* add missing plugin

* happy lint
2023-03-11 03:30:42 -08: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
31738b95b6
add support network hints (#138)
* add support network hints

* add test for multiple network
2023-02-11 01:27:51 -08:00
Boshi Lian
2312f12b15
Update README.md 2023-01-07 07:52:51 -08:00
Boshi Lian
81db4de71f
support kubernetes.io/ssh-auth (#128) 2023-01-07 05:58:44 -08:00
Windfarer
5acbcf6419
fix: kubernetes watch and list in all namespaces (#112)
* watch and list in all namespaces

* add flag

* update readme

* cleaning

* fmt

Co-authored-by: Eric Yang <ericyang@birentech.com>
2022-12-19 01:43:25 -08:00
Boshi Lian
740e31dffc
default to ed25519 (#111)
* s/rsa/ed25519/g

* s/rsakey/ed25519key/g

* ed25519 server key
2022-12-09 06:10:49 -08:00
Boshi Lian
3232bee379 fix build 2022-11-13 11:03:24 +00:00
Boshi Lian
a3b3caaf6d add custom secret field support 2022-11-05 05:57:07 +00:00
Boshi Lian
27b1babbc0 smaller image by keeping k8s and dir plug only 2022-10-25 00:35:45 +00:00
Boshi Lian
cc962457f9 add k8s to e2e 2022-10-24 23:37:38 +00:00
Boshi Lian
6ce942944c fix missing auth in pub 2022-10-23 09:00:21 +00:00