Secure reverse proxy with TLS encryption and access control.
© 2025 ZeroPath Corp. - zeropath.com
- ✅ TLS Encrypted - All traffic encrypted with TLS
- ✅ Access Control - Client-side network and port restrictions
- ✅ Reverse Proxy - Client connects outbound only
- ✅ Flexible Modes - Full proxy or specific port forwarding
- Custom credential (
CHISEL_AUTH) – generate a unique value for each deployment (for exampleexport BROKER_AUTH="broker:$(openssl rand -base64 32)") and supply it to both the server and every client. - TLS trust material – the server terminates TLS with a self-signed certificate. Persist or mount your own certificate/key pair in
/tmp/certsso clients can trust the endpoint according to your organization’s policies. NET_ADMINcapability for network policies – required whenever you useALLOWED_NETWORKSorBLOCKED_PORTS. Without it the client stops instead of falling back to an unrestricted proxy.
export BROKER_AUTH="broker:$(openssl rand -base64 32)"Use the same credential for the server container and every client you deploy.
docker build -f Dockerfile.server -t broker-server .
docker build -f Dockerfile.client -t broker-client .docker run -d \
--name broker-server \
-p 8443:8443 \
-p 1080:1080 \
-e CHISEL_AUTH="$BROKER_AUTH" \
broker-serverdocker run -d \
--name broker-client \
-e BROKER_SERVER="your-server:8443" \
-e CHISEL_AUTH="$BROKER_AUTH" \
broker-client# Supports both CIDR ranges and individual IPs
docker run -d \
--name broker-client \
--cap-add=NET_ADMIN \
-e BROKER_SERVER="your-server:8443" \
-e CHISEL_AUTH="$BROKER_AUTH" \
-e ALLOWED_NETWORKS="192.168.1.0/24,10.0.0.0/16,10.0.137.151,172.16.5.22" \
broker-client# Block sensitive ports (SSH, RDP, SMB)
docker run -d \
--name broker-client \
--cap-add=NET_ADMIN \
-e BROKER_SERVER="your-server:8443" \
-e CHISEL_AUTH="$BROKER_AUTH" \
-e BLOCKED_PORTS="22,3389,445" \
broker-client# Only forward specific services - no general proxy
docker run -d \
--name broker-client \
-e BROKER_SERVER="your-server:8443" \
-e CHISEL_AUTH="$BROKER_AUTH" \
-e BROKER_MODE="ports" \
-e ALLOWED_TARGETS="8080:192.168.1.126:80,3306:192.168.1.100:3306" \
broker-client
# This creates:
# server:8080 → 192.168.1.126:80
# server:3306 → 192.168.1.100:3306| Variable | Description | Example |
|---|---|---|
BROKER_SERVER |
Server address (required) | broker.example.com:8443 |
CHISEL_AUTH |
Authentication | broker:$(openssl rand -base64 32) |
BROKER_MODE |
socks or ports |
ports |
ALLOWED_NETWORKS |
CIDR ranges and/or IPs (requires NET_ADMIN) | 192.168.1.0/24,10.0.0.50,172.16.0.0/12 |
BLOCKED_PORTS |
Block specific ports (requires NET_ADMIN) | 22,3389,445 |
ALLOWED_TARGETS |
Port forwards for ports mode |
8080:web:80,3306:db:3306 |
The ALLOWED_NETWORKS variable accepts both CIDR notation and individual IP addresses:
# CIDR ranges
ALLOWED_NETWORKS="192.168.1.0/24,10.0.0.0/16,172.16.0.0/12"
# Individual IPs
ALLOWED_NETWORKS="10.0.137.151,192.168.1.50,172.16.5.22"
# Mix of both
ALLOWED_NETWORKS="192.168.1.0/24,10.0.137.151,172.16.0.0/16,192.168.5.100"The test script provides an interactive menu to test different restriction modes:
./test-client.sh
# You'll see:
# 1) Full network proxy (unrestricted)
# 2) Network/IP restricted proxy
# 3) Specific port forwarding only
# 4) Proxy with blocked portsThe script prompts for BROKER_SERVER and CHISEL_AUTH if they are not already set in your environment.
IMPORTANT: Always use --max-time with curl to prevent hanging!
# After client connects (check first!)
docker exec broker-server netstat -tulpan | grep 1080
# Use as SOCKS5 proxy
curl --max-time 5 --proxy socks5://server:1080 https://httpbin.org/ip
curl --max-time 10 --proxy socks5://server:1080 http://192.168.1.100
# With proxychains4
echo "socks5 server 1080" >> /etc/proxychains4.conf
proxychains4 curl http://192.168.1.100Instead of full proxy, forward only needed services:
-e BROKER_MODE="ports" \
-e ALLOWED_TARGETS="8080:web.internal:80,3306:db.internal:3306"Limit proxy to specific networks and IPs:
-e ALLOWED_NETWORKS="192.168.1.0/24,10.0.0.0/16,10.0.137.151"At minimum, block administrative ports:
-e BLOCKED_PORTS="22,3389,445,5900,5985,5986"Even with strong credentials, restrict who can reach port 1080:
iptables -A INPUT -p tcp --dport 1080 -s YOUR_IP/32 -j ACCEPT
iptables -A INPUT -p tcp --dport 1080 -j DROPPersist or mount your TLS material (key and certificate) into /tmp/certs so that clients can trust the server endpoint. Rotate these files according to your organization’s policies and distribute the public certificate alongside the broker credentials.
Client Restrictions:
[Client] → [Network Filter] → [Chisel Client] → TLS → [Server:8443]
|
├─ ALLOWED_NETWORKS: CIDR ranges or individual IPs
├─ BLOCKED_PORTS: Block sensitive ports
└─ ALLOWED_TARGETS: Only specific services
Server Side:
[Server:8443] → [Proxy:1080] (opens after client connects)
┌────────────────────────────┐ ┌────────────────────────────┐
│ Customer Internal VCS │ │ ZeroPath SaaS Platform │
└──────────────┬─────────────┘ └──────────────┬─────────────┘
│ │
│ (1) HTTPS/Webhooks │
▼ │
┌───────────────┐ │
│ Broker Client │ │
│ (self-hosted) │ │
└──────┬────────┘ │
│ (2) Enforced egress (iptables/netpol)│
▼ │
┌───────────────┐ Mutual auth TLS ┌───────────────┐
│ Reverse Tunnel│ ==================> │ Broker Server │
│ (outbound) │ <================== │ (self-hosted) │
└───────────────┘ (3) Control/Data └──────┬────────┘
│
│ (4) SOCKS / port forwards
▼
┌────────────────────┐
│ ZeroPath Scanners │
└────────────────────┘
Port 1080 only opens AFTER a client connects!
# Before client connects
netstat -an | grep 1080 # Nothing
# After client connects
netstat -an | grep 1080 # tcp 0.0.0.0:1080 LISTENAlways use --max-time:
curl --max-time 10 --proxy socks5://server:1080 http://targetClient automatically uses --tls-skip-verify for self-signed certs.
Requires --cap-add=NET_ADMIN when running container.
docker logs broker-server | grep session
docker exec broker-server netstat -tulpan | grep 1080Dockerfile.server- Server containerDockerfile.client- Client containerserver-entrypoint.sh- Server scriptclient-entrypoint.sh- Client script with access controlstest-client.sh- Interactive test with restriction examplesdeploy-example.sh- Production deployment examples
© 2025 ZeroPath Corp. - zeropath.com