All Projects → lmammino → webhook-tunnel

lmammino / webhook-tunnel

Licence: MIT license
A little HTTP proxy suitable to create tunnels for webhook endpoints protected behind a firewall or a VPN

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to webhook-tunnel

Frpc Android
Android,安卓版frpc,一个快速反向代理,可帮助您将NAT或防火墙后面的本地服务器暴露给Internet。
Stars: ✭ 205 (+225.4%)
Mutual labels:  tunnel, https, firewall
Nps
一款轻量级、高性能、功能强大的内网穿透代理服务器。支持tcp、udp、socks5、http等几乎所有流量转发,可用来访问内网网站、本地支付接口调试、ssh访问、远程桌面,内网dns解析、内网socks5代理等等……,并带有功能强大的web管理端。a lightweight, high-performance, powerful intranet penetration proxy server, with a powerful web management terminal.
Stars: ✭ 19,537 (+30911.11%)
Mutual labels:  tunnel, https, firewall
LightTunnel
LightTunnel-内网穿透映射工具,支持TCP、HTTP、HTTPS穿透映射,支持Windows、Linux、Mac、Android系统
Stars: ✭ 40 (-36.51%)
Mutual labels:  tunnel, https
Lanproxy
lanproxy是一个将局域网个人电脑、服务器代理到公网的内网穿透工具,支持tcp流量转发,可支持任何tcp上层协议(访问内网网站、本地支付接口调试、ssh访问、远程桌面、http代理、https代理、socks5代理...)。技术交流QQ群 678776401
Stars: ✭ 4,784 (+7493.65%)
Mutual labels:  tunnel, firewall
Mr2
Mr.2 can help you expose local server to external network. Support both TCP/UDP, of course support HTTP. Zero-Configuration.
Stars: ✭ 1,102 (+1649.21%)
Mutual labels:  tunnel, firewall
gost
GO Simple Tunnel - a simple tunnel written in golang
Stars: ✭ 154 (+144.44%)
Mutual labels:  tunnel, https
client
Remote access and tunnels to your localhost from everywhere in the world.
Stars: ✭ 25 (-60.32%)
Mutual labels:  tunnel, https
Docker Host
A docker sidecar container to forward all traffic to local docker host or any other host
Stars: ✭ 769 (+1120.63%)
Mutual labels:  tunnel, firewall
Gitwebhookproxy
A proxy to let webhooks reach running services behind a firewall – [✩Star] if you're using it!
Stars: ✭ 123 (+95.24%)
Mutual labels:  webhook, firewall
Ngrok
Expose your localhost to the web. Node wrapper for ngrok.
Stars: ✭ 1,897 (+2911.11%)
Mutual labels:  tunnel, webhook
Sish
HTTP(S)/WS(S)/TCP Tunnels to localhost using only SSH.
Stars: ✭ 2,087 (+3212.7%)
Mutual labels:  tunnel, https
Pyngrok
A Python wrapper for ngrok
Stars: ✭ 159 (+152.38%)
Mutual labels:  tunnel, webhook
aiotunnel
HTTP tunnel on top of aiohttp and asyncio
Stars: ✭ 29 (-53.97%)
Mutual labels:  tunnel, https
tlstun
A socks tunnel client and server using websockets over http and tls
Stars: ✭ 36 (-42.86%)
Mutual labels:  tunnel, firewall
tunman
Comprehensive solution for SSH tunnels - respawning, healthchecking/monitoring
Stars: ✭ 43 (-31.75%)
Mutual labels:  tunnel, firewall
Awesome Anti Censorship
curated list of open-source anti-censorship tools
Stars: ✭ 521 (+726.98%)
Mutual labels:  tunnel, firewall
Frp
A fast reverse proxy to help you expose a local server behind a NAT or firewall to the internet.
Stars: ✭ 51,746 (+82036.51%)
Mutual labels:  tunnel, firewall
Fq Book
📖《这本书能让你连接互联网》详细阐述代理、隧道、VPN运作过程,并对GFW策略如:地址端口封锁、服务器缓存投毒、数字验证攻击、SSL连接阻断做相关的原理说明
Stars: ✭ 2,393 (+3698.41%)
Mutual labels:  tunnel, https
Ahri
Ahri is an intranet sharing tool. Like VPN
Stars: ✭ 205 (+225.4%)
Mutual labels:  tunnel, firewall
aio-doh
Asynchronous DNS-over-HTTPS client for Python
Stars: ✭ 14 (-77.78%)
Mutual labels:  https

webhook-tunnel

npm version CircleCI JavaScript Style Guide Known Vulnerabilities

A little HTTP proxy suitable to create tunnels for webhook endpoints protected behind a firewall or a VPN

Rationale

If you are doing security properly in your company, it's very likely that most of your resources will be protected behind a firewall or a VPN, including things like Continuous Integration pipelines (e.g. Jenkins) or other tools with web based integrations.

In such scenarios, it becomes tricky to integrate external services (e.g. GitHub) with your internal tools through web hooks.

For example, it becomes hard to allow GitHub to notify your secured CI instance that there's a new push on one of the projects that your CI is building.

Webhook-tunnel allows you to create an HTTP tunnel that can be used for routing web hooks requests through your security layers.

This approach creates a connection channel from the outside to your internal infrastructure, so be sure to limit the access to the tunnel as much as you can.

To increase the security level of the tunnel, Webhook-tunnel can be configured to apply a number of diffent filters over the HTTP requests and block them from getting into the internal network. Consult the section filters to know more about this aspect.

Here's an example configuration that demonstrates how the tunnel can be used:

Example CI diagram

Install

From npm:

npm install --global webhook-tunnel

(this requires npm and Node.js version >= 8)

Or you can simply download one of the binaries available in the Releases section.

Note: the compiled executable contains a full-blown version of the Node.js runtime embedded in it. So use this version only if you want to run the tunnel in an environment that does not have a supported version of Node.js already installed.

Execute

To execute the proxy in your server:

webhook-tunnel <target>

Where target is the full URL where every request will be proxied to.

E.g.

webhook-tunnel http://myprivatejenkins.tld/somepath/

By default the server will be bound to 0.0.0.0:12345.

Command line options

This is the full list of supported command line options:

Options:
  --help               Show help                                       [boolean]
  --bind-address, -a   The bind address of the server
                                                   [string] [default: "0.0.0.0"]
  --port, -p           The port on which the server will be listening to
                                                       [number] [default: 12345]
  --expect-cidr, -C    Rejects the request if it is not coming from one of the
                       specified IP ranges (CIDRs)                       [array]
  --expect-path, -P    Rejects the request if it is not addressed to one of the
                       specified path prefixes                           [array]
  --expect-query, -Q   Rejects the request if it doesn't contain any of
                       specified query parameters with a matching value (e.g.
                       token=1234)                                       [array]
  --expect-header, -H  Rejects the request if it doesn't contain any of
                       specified headers with a matching value (e.g.
                       x-token=1234)                                     [array]
  --expect-method, -M  Rejects the request if it is not using one of the
                       specified methods (e.g. `GET`)                    [array]
  --log-level, -l      Logging level (one of 'fatal', 'error', 'warn', 'info',
                       'debug', 'trace' or 'silent')  [string] [default: "info"]
  --version            Show version number                             [boolean]

Filters

Webhook-tunnel supports a number of filters straight away. The currently supported filters are:

By default every filter is disabled, so every request can cross the tunnel. For every filter you can specify one or more rules. As soon as you have a rule for a filter, No request can pass the tunnel unless the request matches the rule.

We can recap the internal flow with the following statements:

  1. if no filter is used (no rules in every filter), every request can cross the tunnel
  2. if you have a rule under a filter, every request is blacklisted, unless it matches the rule
  3. if you have a filter with more than one rule, then at least one rule per every filter should be matched to allow the request to cross the tunnel.

IP Ranges

If you want to accept requests that come only from a selected list of IPs you can run the tunnel with the option --expect-cidr. This option allows you to add a rule under the CIDR filter. You can create multiple rules by using the option multiple times.

Example:

webhook-tunnel http://somedonain.tld --expect-cidr 22.23.24.25/22 --expect-cidr 120.25.25.25/22

This way the tunnel will accept only requests coming from 22.23.24.25/22 or 120.25.25.25/22.

Request path

You can restrict the requests being tunneled by path prefix with the option --expect-path. By default all the paths are accepted but you can add one or more path rules as in the following example:

webhook-tunnel http://somedonain.tld --expect-path /path1 --expect-path /path2

With this configuration requests with a prefix path of /path1 and /path2 (e.g. /path1/producs or /path123) will be allowed, while all the other requests will be rejected.

Query string

You can restrict the requests being tunneled by query parameters with the option --expect-query. This option accepts arguments in the form key=value. You can specify multiple --expect-query options and the request will be tunneled only if at least one of the rules is matched.

E.g.

webhook-tunnel http://somedonain.tld --expect-query token=xyz --expect-query auth=admin

With this configuration requests with a query string like ?token=xyz or ?auth=admin will be allowed, while all the other requests will be rejected.

Header

Headers filters behave exactly like query string, except that headers are used for the match. To specify headers rules you have to use the --expect-header option.

Method

You can restrict the requests by HTTP method (get, post, patch, etc.).

To set the method rules you have to use the --expect-method option. You can specify the option multiple times and the request will be tunneled only if at least one of the rules is matched.

E.g.

webhook-tunnel http://somedonain.tld --expect-method get --expect-method post

Will accept only post or get requests.

Contributing

Everyone is very welcome to contribute to this project. You can contribute just by submitting bugs or suggesting improvements by opening an issue on GitHub.

License

Licensed under MIT License. © Luciano Mammino.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].