{"id":31559189,"url":"https://github.com/rgzr/sshtun","last_synced_at":"2025-10-05T01:15:20.693Z","repository":{"id":33896490,"uuid":"149263469","full_name":"rgzr/sshtun","owner":"rgzr","description":"Go package to create SSH tunnels","archived":false,"fork":false,"pushed_at":"2024-12-18T13:25:27.000Z","size":55,"stargazers_count":92,"open_issues_count":2,"forks_count":15,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-12-18T14:37:28.009Z","etag":null,"topics":["forwarding","go","golang","ssh","ssh-tunnel"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rgzr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-18T09:35:04.000Z","updated_at":"2024-12-18T13:25:31.000Z","dependencies_parsed_at":"2024-06-18T17:08:36.266Z","dependency_job_id":"72f3ff4c-db66-43de-89e8-8f0c2fcc56a1","html_url":"https://github.com/rgzr/sshtun","commit_stats":{"total_commits":18,"total_committers":6,"mean_commits":3.0,"dds":"0.33333333333333337","last_synced_commit":"f583b3b1ecc1669ca34f3f39771c24f13fe75615"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/rgzr/sshtun","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgzr%2Fsshtun","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgzr%2Fsshtun/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgzr%2Fsshtun/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgzr%2Fsshtun/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rgzr","download_url":"https://codeload.github.com/rgzr/sshtun/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rgzr%2Fsshtun/sbom","scorecard":{"id":773892,"data":{"date":"2025-08-11","repo":{"name":"github.com/rgzr/sshtun","commit":"de6b8d6b242ded300a2807676c89b0fc7efe21e7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.6,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":2,"reason":"Found 4/19 approved changesets -- score normalized to 2","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/govulncheck.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: third-party GitHubAction not pinned by hash: .github/workflows/govulncheck.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/rgzr/sshtun/govulncheck.yml/main?enable=pin","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 16 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T03:00:32.176Z","repository_id":33896490,"created_at":"2025-08-23T03:00:32.176Z","updated_at":"2025-08-23T03:00:32.176Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278397912,"owners_count":25980082,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-04T02:00:05.491Z","response_time":63,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["forwarding","go","golang","ssh","ssh-tunnel"],"created_at":"2025-10-05T01:15:13.861Z","updated_at":"2025-10-05T01:15:20.687Z","avatar_url":"https://github.com/rgzr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sshtun\n\n[![GoDoc](https://godoc.org/github.com/golang/gddo?status.svg)](https://godoc.org/github.com/rgzr/sshtun)\n\nsshtun is a Go package that provides a SSH tunnel with port forwarding supporting:\n\n* TCP and unix socket connections\n* Password authentication\n* Un/encrypted key file authentication\n* `ssh-agent` based authentication\n* Both local and remote port forwarding\n\nBy default it reads the default linux ssh private key locations and fallbacks to using `ssh-agent`, but a specific authentication method can be set.\n\nThe default locations are `~/.ssh/id_rsa`, `~/.ssh/id_dsa`, `~/.ssh/id_ecdsa`, `~/.ssh/id_ecdsa_sk`, `~/.ssh/id_ed25519` and `~/.ssh/id_ed25519_sk`.\n\n\n## Installation\n\n`go get github.com/rgzr/sshtun`\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"time\"\n\n\t\"github.com/rgzr/sshtun\"\n)\n\nfunc main() {\n\t// We want to connect to port 8080 on our machine to acces port 80 on my.super.host.com\n\tsshTun := sshtun.New(8080, \"my.super.host.com\", 80)\n\n\t// We print each tunneled state to see the connections status\n\tsshTun.SetTunneledConnState(func(tun *sshtun.SSHTun, state *sshtun.TunneledConnState) {\n\t\tlog.Printf(\"%+v\", state)\n\t})\n\n\t// We set a callback to know when the tunnel is ready\n\tsshTun.SetConnState(func(tun *sshtun.SSHTun, state sshtun.ConnState) {\n\t\tswitch state {\n\t\tcase sshtun.StateStarting:\n\t\t\tlog.Printf(\"STATE is Starting\")\n\t\tcase sshtun.StateStarted:\n\t\t\tlog.Printf(\"STATE is Started\")\n\t\tcase sshtun.StateStopped:\n\t\t\tlog.Printf(\"STATE is Stopped\")\n\t\t}\n\t})\n\n\t// We start the tunnel (and restart it every time it is stopped)\n\tgo func() {\n\t\tfor {\n\t\t\tif err := sshTun.Start(context.Background()); err != nil {\n\t\t\t\tlog.Printf(\"SSH tunnel error: %v\", err)\n\t\t\t\ttime.Sleep(time.Second) // don't flood if there's a start error :)\n\t\t\t}\n\t\t}\n\t}()\n\n\t// We stop the tunnel every 20 seconds (just to see what happens)\n\tfor {\n\t\ttime.Sleep(time.Second * time.Duration(20))\n\t\tlog.Println(\"Lets stop the SSH tunnel...\")\n\t\tsshTun.Stop()\n\t}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgzr%2Fsshtun","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frgzr%2Fsshtun","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frgzr%2Fsshtun/lists"}