* 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> |
||
|---|---|---|
| .. | ||
| docker.go | ||
| main.go | ||
| README.md | ||
| skel.go | ||
docker plugin for sshpiperd
This plugin queries dockerd for containers and creates pipes to them.
Usage
sshpiperd docker
start a container with sshpiper labels
docker run -d -e USER_NAME=user -e USER_PASSWORD=pass -e PASSWORD_ACCESS=true -l sshpiper.username=pass -l sshpiper.container_username=user -l sshpiper.port=2222 lscr.io/linuxserver/openssh-server
connect to piper
ssh -l pass piper
Config docker connection
Docker connection is configured with environment variables below:
https://pkg.go.dev/github.com/docker/docker/client#FromEnv
- DOCKER_HOST: to set the url to the docker server, default "unix:///var/run/docker.sock"
- DOCKER_API_VERSION: to set the version of the API to reach, leave empty for latest.
- DOCKER_CERT_PATH: to load the TLS certificates from.
- DOCKER_TLS_VERIFY: to enable or disable TLS verification, off by default.
Container Labels for plugin
- sshpiper.username: username to filter containers by
downstream's username. left empty to auth withauthorized_keysonly. - sshpiper.container_username: username of container's sshd
- sshpiper.port: port of container's sshd
- sshpiper.authorized_keys: authorized_keys to verify against
downstream. in base64 format - sshpiper.private_key: private_key to sent to container's sshd. in base64 format