-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy-example.sh
More file actions
executable file
·163 lines (142 loc) · 4.99 KB
/
deploy-example.sh
File metadata and controls
executable file
·163 lines (142 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#!/bin/bash
# ZeroPath Broker - Production Deployment Examples
# © 2025 ZeroPath Corp. - zeropath.com
echo "========================================="
echo " ZeroPath Broker Deployment"
echo "========================================="
echo "© 2025 ZeroPath Corp. - zeropath.com"
echo ""
if [ -z "${BROKER_SERVER:-}" ]; then
echo -n "Enter broker server address (host:port): "
read BROKER_SERVER
fi
if [ -z "$BROKER_SERVER" ]; then
echo "ERROR: Broker server address is required." >&2
exit 1
fi
if [ -z "${BROKER_AUTH:-}" ]; then
echo -n "Enter CHISEL_AUTH credential (username:password): "
read -r BROKER_AUTH
fi
if [ -z "$BROKER_AUTH" ]; then
echo "ERROR: CHISEL_AUTH credential is required." >&2
exit 1
fi
# Example 1: High Security - Specific Services Only
deploy_high_security() {
echo "[ZeroPath] Deploying HIGH SECURITY configuration"
echo "[ZeroPath] Only allowing specific service access:"
echo " • Web UI on port 8080"
echo " • Database on port 3306"
echo ""
docker run -d \
--name broker-client-secure \
--restart unless-stopped \
-e BROKER_SERVER="${BROKER_SERVER}" \
-e CHISEL_AUTH="${BROKER_AUTH}" \
-e BROKER_MODE="ports" \
-e ALLOWED_TARGETS="8080:webapp.internal:80,3306:database.internal:3306" \
broker-client
echo "[ZeroPath] ✓ Deployed - Only specified services accessible"
}
# Example 2: Medium Security - Network Restricted
deploy_medium_security() {
echo "[ZeroPath] Deploying MEDIUM SECURITY configuration"
echo "[ZeroPath] Network access restrictions:"
echo " • Internal networks and specific IPs only"
echo " • Blocked admin ports"
echo ""
docker run -d \
--name broker-client-medium \
--restart unless-stopped \
--cap-add=NET_ADMIN \
-e BROKER_SERVER="${BROKER_SERVER}" \
-e CHISEL_AUTH="${BROKER_AUTH}" \
-e BROKER_MODE="socks" \
-e ALLOWED_NETWORKS="192.168.0.0/16,10.0.0.0/8,172.16.0.0/12,10.0.137.151" \
-e BLOCKED_PORTS="22,23,3389,445,5900,5985,5986" \
broker-client
echo "[ZeroPath] ✓ Deployed - Network restricted proxy"
}
# Example 3: Low Security - Full Access (NOT RECOMMENDED)
deploy_low_security() {
echo "[ZeroPath] Deploying LOW SECURITY configuration"
echo "[ZeroPath] ⚠ WARNING: Full network access enabled!"
echo ""
docker run -d \
--name broker-client-full \
--restart unless-stopped \
-e BROKER_SERVER="${BROKER_SERVER}" \
-e CHISEL_AUTH="${BROKER_AUTH}" \
-e BROKER_MODE="socks" \
broker-client
echo "[ZeroPath] ⚠ Deployed - Full access (secure with server firewall!)"
}
# Example 4: Custom Configuration
deploy_custom() {
echo "[ZeroPath] Custom deployment configuration:"
echo ""
echo "Enter server address (e.g., broker.example.com:8443):"
read SERVER
echo "Select security level:"
echo "1) High - Specific ports only"
echo "2) Medium - Network restricted proxy"
echo "3) Low - Full proxy"
read LEVEL
case $LEVEL in
1)
echo "Enter port forwards (e.g., 8080:web:80,3306:db:3306):"
read FORWARDS
docker run -d \
--name broker-client-custom \
--restart unless-stopped \
-e BROKER_SERVER="$SERVER" \
-e CHISEL_AUTH="${BROKER_AUTH}" \
-e BROKER_MODE="ports" \
-e ALLOWED_TARGETS="$FORWARDS" \
broker-client
;;
2)
echo "Enter allowed networks/IPs (e.g., 192.168.1.0/24,10.0.137.151):"
read NETWORKS
docker run -d \
--name broker-client-custom \
--restart unless-stopped \
--cap-add=NET_ADMIN \
-e BROKER_SERVER="$SERVER" \
-e CHISEL_AUTH="${BROKER_AUTH}" \
-e ALLOWED_NETWORKS="$NETWORKS" \
-e BLOCKED_PORTS="22,3389,445" \
broker-client
;;
3)
docker run -d \
--name broker-client-custom \
--restart unless-stopped \
-e BROKER_SERVER="$SERVER" \
-e CHISEL_AUTH="${BROKER_AUTH}" \
broker-client
;;
esac
echo "[ZeroPath] ✓ Custom deployment complete"
}
# Menu
echo "Select deployment type:"
echo "1) High Security - Specific services only"
echo "2) Medium Security - Network restricted proxy"
echo "3) Low Security - Full proxy (not recommended)"
echo "4) Custom Configuration"
echo ""
echo -n "Choice [1-4]: "
read CHOICE
case $CHOICE in
1) deploy_high_security ;;
2) deploy_medium_security ;;
3) deploy_low_security ;;
4) deploy_custom ;;
*) echo "[ZeroPath] Invalid choice"; exit 1 ;;
esac
echo ""
echo "[ZeroPath] Deployment complete!"
echo "[ZeroPath] Check status: docker logs broker-client-*"
echo "[ZeroPath] Stop: docker stop broker-client-*"