Commit graph

34 commits

Author SHA1 Message Date
4a3de923de Remove debug logging, keep fingerprint passthrough 2025-12-21 09:57:35 -05:00
5370758c30 Add more debug logging 2025-12-21 09:50:11 -05:00
f127c624c0 Add INFO logging for fingerprint passthrough 2025-12-21 09:47:57 -05:00
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
e6667a6b8c Pass client SSH key fingerprint in upstream username
When using public key auth, include the client's key fingerprint
in the upstream username with format: fp:FINGERPRINT.originaluser

This allows upstream servers (like maldoror) to identify users
by their original SSH key even when sshpiper uses its own key
for upstream authentication.
2025-12-21 08:43:18 -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
Boshi Lian
7fdd88982a
introduce uri for flexable upstream conn (#615)
* Deprecate host and port fields in Upstream message; introduce uri field for connection details

* Update libplugin/plugin.proto

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

* refactor(grpc): streamline upstream connection handling and add GetOrGenerateUri method

* refactor(libplugin): update GetOrGenerateUri to return error and add IPv6 test

* refactor(libplugin): simplify GetOrGenerateUri to remove error return and update tests

* Update cmd/sshpiperd/internal/plugin/grpc.go

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

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-06-30 15:18:57 -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
3757d80348
support proxy banner from upstream (#548)
* remove unused logs

* add banner to server password

* add updated crypto lib

* add test

* refactor: clean up whitespace in banner test

* fix: update test case name to use underscores for consistency
2025-03-20 00:55:03 -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
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
73fa95c057
fix lint (#428) 2024-08-15 00:58:08 -07:00
Matej Trop
9cd6050812
Allow plugins to set a log formatter when TTY isn't allocated (#385) 2024-05-17 11:42:28 -07:00
Matej Trop
73169bbace
Make the log formatter configurable (#371)
* Make the log formatter configurable

The change lets us configure the deamon and the plugins to output logs
in the JSON format, which is easier to parse/filter by log processing
tools.

* Add validation for the log-format flag
2024-05-08 15:11:18 -07:00
Boshi Lian
82ac6a5fff
add remote signer api and e2e test of it (#320) 2024-02-11 01:54:55 -08:00
Boshi Lian
050a9baadb
Add doc and tests for ioconn package (#291) 2023-12-25 15:01:40 -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
Matthew Atkinson
13fcc8c0a8
Add support for using CA certs for upstream ssh connection (#210) 2023-08-25 17:32:49 -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
a3b3caaf6d add custom secret field support 2022-11-05 05:57:07 +00:00
Boshi Lian
006fcb31da adopt official non auth callback 2022-10-22 11:18:47 +00:00
Boshi Lian
319824e564 align log level across plugins
happy lint

happy lint
2022-08-05 23:08:01 +00:00
Boshi Lian
3047473814 impl hostkey verify for working dir 2022-07-06 18:32:35 +00:00
Boshi Lian
bc9875c4b5 happy lint 2022-07-06 17:27:39 +00:00
Boshi Lian
9e702013c6 update proto grpc 2022-07-06 16:46:25 +00:00
Boshi Lian
5e0572a43f minor fix while doing docs 2022-07-05 20:31:14 +00:00
Boshi Lian
fd0a0c628e first move of working dir 2022-07-04 16:49:50 +00:00
Boshi Lian
8d56673982 template for easier plugin 2022-07-04 16:49:50 +00:00
Boshi Lian
dbef31dd3d libplugin 2022-07-04 16:49:50 +00:00