57 Commits

Author SHA1 Message Date
Jaime Pillora 44310b6566 Enforce auth ACL on tunnel channels
Previously, authfile ACL restrictions were only checked during the
initial config handshake. This adds ACL enforcement at the tunnel
layer when processing SSH channel requests, ensuring that each
outbound connection is validated against the user's allowed addresses.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-09 20:47:37 +11:00
Jaime Pillora 59e5362e6b Bump to Go 1.22. Add .rpm .deb and .akp to releases. Fix bad version comparison. 2024-08-05 15:50:20 +10:00
guangwu dca1156401 chore: remove refs to deprecated io/ioutil (#459)
thanks @testwill
2023-10-19 22:58:31 +11:00
Jaime Pillora 69093be1d9 Bump to Go 1.21 (#440)
Co-authored-by: cmeng <cmenginnz@gmail.com>
2023-08-19 11:00:41 +10:00
invist 4f58a395f6 Update version.go (#288) 2022-10-31 15:54:57 +11:00
BigSully ed6adb98bc Respond to /health and /version by request path rather than by the whole url string (#328)
Co-authored-by: bar <foo@example.org>
2022-10-31 15:53:36 +11:00
Paul Frischknecht 56ccb008ad Update server.go
spelling authenication -> authentication
2022-06-16 19:38:05 +02:00
Jaime Pillora c410372d0a display client ip in verbose server logs (closes #233) 2021-01-14 03:39:38 +11:00
Jaime Pillora 87675c40bc check for listen errors (fixes #232) 2021-01-14 03:35:37 +11:00
Jaime Pillora 6ddc09d281 document udp, log client connection failures, expose more settings via env-vars 2020-11-17 04:53:43 +11:00
Jaime Pillora 6fce8e1e6e fix Server.Start error (closes #195) 2020-09-17 22:22:33 +10:00
Jaime Pillora 9baf31411d only show LE warning if using a domain 2020-09-03 07:28:55 +10:00
Jaime Pillora 59d78358cc merge mtls (thanks @wxia20) 2020-09-03 07:08:55 +10:00
Jaime Pillora 0edc0e5399 Merge remote-tracking branch 'wxia/mTLS_authentication' 2020-09-01 07:08:18 +10:00
Will Xia 3542fb8e85 address PR code review feedback 2020-08-30 08:18:26 -04:00
Jaime Pillora 798ec04a6b fix stdio "cannot listen", fix udp goroutine leak 2020-08-29 01:27:08 +10:00
Will Xia 7ca9034c47 mTLS authentication feature.
1. Adding client cert and key to Chisel client.
2. Adding trusted CAs to Chisel server.
3. Adding TLS/mTLS e2e test case and test certs and keys.
4. Adding flag and help comments.
2020-08-24 18:17:38 -04:00
Jaime Pillora 4f33489f62 fix multiple getters panic 2020-08-22 22:29:13 +10:00
Jaime Pillora d8b404bd02 add tls (and auto-certificate) support 2020-07-23 05:11:28 +10:00
Jaime Pillora 3ae61e5d5d add ResetUsers server method (closes #175) 2020-07-23 01:29:57 +10:00
Jaime Pillora e3abdc607e udp listener cleanup, add early port listen checks 2020-07-23 01:26:47 +10:00
Jaime Pillora edad853073 improved teardown and logging 2020-07-19 04:46:49 +10:00
Jaime Pillora 53e72fe2ba add udp support, massive refactor and more (see below)
* split out share/ package into multiple subpackages
* added share/compat.go to keep backward compatibility(ish)
* moved shared tunnelling logic from client/server packages into share/tunnel/
* added remote protocol "<host>:<port>/<protocol>", currently supporting tcp and udp
* added an end-to-end test suite
* added TODO e2e tests as contribution targets
* added deep context integration for improved cleanup and cancellation
2020-07-18 11:05:53 +10:00
Jaime Pillora 68050d031a merge client reverse+socks PR by @aus (closes #78)
- @aus's branch also includes PR for
custom headers, thanks @AkeemMcLennon  (closes #90)
- support client connections via socks
- add more architectures to the built releases
- remove vendor (go.sum will enforce correct deps)
2020-05-20 21:13:48 +10:00
Jaime Pillora 04d4f30dd6 upgrade deps, rename test/ to bench/, add goreleaser 2020-04-02 01:31:42 +11:00
aus 4a52b79310 enable real ip logging 2019-10-29 14:30:52 -05:00
aus 6d83df33d1 Merge branch 'client-socks' of https://github.com/aus/chisel into red 2019-08-28 11:46:40 -05:00
aus c9b6bf910c change import url to aus/chisel 2019-08-28 11:44:25 -05:00
Anthony Lapenna f3a8df20e3 add a the ability to add/delete users dynamically (#107)
* add a the ability to add/delete users dynamically

* update the AddUser function to support multiple authorized addrs
2019-07-25 09:21:13 +10:00
Anthony Lapenna 18d8d6f71f add a GetFingerprint() getter to Server struct 2019-06-07 14:17:56 +12:00
aus 8607fa10b4 rework to support remote R:socks syntax 2019-02-23 15:09:25 -06:00
Jaime Pillora 4a85f97336 bump protocol version 2018-12-29 23:36:44 +11:00
Jaime Pillora d96b66e70b merged #72 which adds reverse tunnelling (thanks @sunshineco!), fixed potential race, USR2 to print go stats, many small cleanups 2018-12-29 22:51:40 +11:00
Eric Sunshine a11a3dd2dd server: add reverse port forwarding restrictions
Although reverse port forwarding (sharing client ports with the server)
should not generally leak any resources from the server to the client,
the facility may nevertheless be abused if the client is able to open a
server port which is otherwise meant for some other purpose on the
server. (This might happen, for instance, if a service on the server has
crashed or becomes somehow disabled, thus freeing the port which would
otherwise be occupied by the service.)

To mitigate such potential abuse, disable reverse port forwarding by
default and introduce server option --reverse to enable it explicitly.
Additionally, subject reverse port forwarding remotes to server-side
--authfile restrictions (for instance, "^R:0.0.0.0:7000$").
2018-12-23 16:25:45 -05:00
Eric Sunshine 8724c90273 support reverse port forwarding
Normal port forwarding shares server ports to the client, allowing the
client to access ports on the server (or ports on other machines
accessible from the server). Sometimes, however, it is necessary to
share ports in the opposite direction, allowing the server to access
ports on the client (or ports on other machines accessible from the
client). Reverse port forwarding is analogous to ssh's -R forwarding
which complements normal -L forwarding.

Reverse port forwarding remotes are specified as
"R:<local-interface>:<local-port>:<remote-host>:<remote-port>", where
<local-interface> and <local-port> refer to the server side, and
<remote-host> and <remote-port> refer to the client side. For instance,
"R:2222:localhost:22" forwards port 2222 on the server to port 22 on the
client.
2018-12-23 16:25:44 -05:00
Eric Sunshine 5b5e3fafb9 remote: introduce notation for reverse port forwarding
An upcoming enhancement will add reverse port forwarding support (client
sharing its ports to the server) to complement the existing port
forwarding (server sharing its ports to the client). As a first step,
introduce notation for specifying a remote for reverse port forwarding;
i.e. "R:<local-interface>:<local-port>:<remote-host>:<remote-port>".

At this stage, reverse port forwarding remotes are recognized but never
actually created. A subsequent change will flesh out the functionality.
2018-12-23 16:25:44 -05:00
Eric Sunshine d670c83e2b handleTCPStream: relocate from server/ to share/
server/handleTCPStream() is sufficiently general to handle TCP stream
functionality for both the client and server. Therefore, move it to
share/ so it can be re-used by the client when chisel learns to
support reverse port forwarding, in which case TCP stream handling
will be done by the client rather than the server.
2018-12-23 16:25:44 -05:00
Eric Sunshine 26610d754e handleTCPStream: divorce from chserver.Server
Aside from a minor dependency upon chserver.Server, the existing
Server.handleTCPStream() is sufficiently general for either the server
or client side. For instance, when chisel learns to support reverse
port forwarding, in which case the client, not the server, will be
handling the TCP stream, it will make sense to re-use existing
functionality rather than duplicating it. Therefore, divorce the TCP
stream handling code from chserver.Server, freeing it up for use by
the client too.
2018-12-23 16:25:44 -05:00
Eric Sunshine 777ce484f9 generalize connection statistics maintenance
Presently, only the server maintains connection statistics, however,
when reverse port forwarding is eventually supported by chisel, the
client will also want to do so. Rather than duplicating this
functionality in the client, generalize the existing functionality as
chshare.ConnStats, allowing it to be used by both client and server.
2018-12-23 16:25:44 -05:00
Eric Sunshine 7cfb8e424c fix documentation, comment, status message typos 2018-12-23 16:25:44 -05:00
Jaime Pillora 06c8264689 fix ssh handshake issue 2018-10-20 23:16:04 +11:00
Jaime Pillora b56ba689a8 merged health/version checks, more cleanup 2018-10-20 22:01:08 +11:00
Jaime Pillora 6997312c1f merge config file watch, minor cleanup 2018-10-20 21:35:49 +11:00
Rohith 00af5b2c96 Chisel Service Health Check
This adds a simple endpoint (nothing more than a 200 OK) on /health to check the chisel service is running
2018-01-17 12:29:31 +00:00
Rohith 1f07744c34 Users Reloading
The current implementation does not permit the reload on server configuration, this PR adds the feature permiting uses to dynamically reload config. Note, at the moment this does not kill off connection already authentication, I'll leave that to another PR
2018-01-17 11:35:02 +00:00
Matt Joiner 98a384727a Some trivial changes 2017-11-15 12:43:50 +11:00
Jaime Pillora 87a853937c add connection counts to verbose logs 2017-04-08 16:28:27 +10:00
Jaime Pillora 26c6b88579 dockerfile fix again, minor logging changes 2017-04-07 23:14:48 +10:00
Jaime Pillora 6cb3ab2186 added SOCKS5 server support, added HTTP CONNECT Proxy client support, improved cli, improve docs, added badges 2017-04-07 20:18:15 +10:00
Lyntor Paul Figueroa 5398b7dd6a Remove unnecessary changes 2016-06-10 19:19:37 +08:00