moltbot-security 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +64 -0
  2. package/SKILL.md +335 -0
  3. package/package.json +27 -0
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # Moltbot Security Guide
2
+
3
+ Security hardening for Moltbot/Clawdbot. Lock down your gateway, fix file permissions, set up authentication, configure firewalls.
4
+
5
+ **Based on real vulnerability research** that found 1,673+ exposed Clawdbot/Moltbot gateways on Shodan.
6
+
7
+ ## Install
8
+
9
+ **ClawdHub:**
10
+ ```bash
11
+ clawdhub install NextFrontierBuilds/moltbot-security
12
+ ```
13
+
14
+ **npm:**
15
+ ```bash
16
+ npm install moltbot-security
17
+ ```
18
+
19
+ ## The 5 Essentials
20
+
21
+ 1. **Bind to loopback** — Never expose gateway publicly
22
+ 2. **Set auth token** — Require authentication
23
+ 3. **Fix file permissions** — Only you read configs
24
+ 4. **Update Node.js** — v22.12.0+ required
25
+ 5. **Use Tailscale** — Secure remote access
26
+
27
+ ## Quick Audit
28
+
29
+ ```bash
30
+ clawdbot security audit --deep --fix
31
+ ```
32
+
33
+ ## What Gets Exposed
34
+
35
+ Without proper security:
36
+ - Conversation histories (Telegram, WhatsApp, Signal)
37
+ - API keys (Claude, OpenAI)
38
+ - OAuth tokens and credentials
39
+ - Full shell access
40
+
41
+ ## Secure Config Template
42
+
43
+ ```json
44
+ {
45
+ "gateway": {
46
+ "bind": "loopback",
47
+ "auth": {
48
+ "mode": "token",
49
+ "token": "YOUR_64_CHAR_HEX_TOKEN"
50
+ },
51
+ "tailscale": {
52
+ "mode": "serve"
53
+ }
54
+ }
55
+ }
56
+ ```
57
+
58
+ ## Credits
59
+
60
+ Based on research by [@NickSpisak_](https://x.com/NickSpisak_)
61
+
62
+ ---
63
+
64
+ Built by [@NextXFrontier](https://x.com/NextXFrontier)
package/SKILL.md ADDED
@@ -0,0 +1,335 @@
1
+ ---
2
+ name: moltbot-security
3
+ description: Security hardening guide for Moltbot/Clawdbot. Lock down your gateway, fix file permissions, set up auth, configure firewalls. Based on real vulnerability research.
4
+ version: 1.0.0
5
+ author: NextFrontierBuilds
6
+ keywords: moltbot, clawdbot, security, hardening, gateway, firewall, tailscale, ssh, authentication, ai-agent
7
+ ---
8
+
9
+ # Moltbot Security Guide
10
+
11
+ Your Moltbot gateway was designed for local use. When exposed to the internet without proper security, attackers can access your API keys, private messages, and full system access.
12
+
13
+ **Based on:** Real vulnerability research that found 1,673+ exposed Clawdbot/Moltbot gateways on Shodan.
14
+
15
+ ---
16
+
17
+ ## TL;DR - The 5 Essentials
18
+
19
+ 1. **Bind to loopback** — Never expose gateway to public internet
20
+ 2. **Set auth token** — Require authentication for all requests
21
+ 3. **Fix file permissions** — Only you should read config files
22
+ 4. **Update Node.js** — Use v22.12.0+ to avoid known vulnerabilities
23
+ 5. **Use Tailscale** — Secure remote access without public exposure
24
+
25
+ ---
26
+
27
+ ## What Gets Exposed (The Real Risk)
28
+
29
+ When your gateway is publicly accessible:
30
+ - Complete conversation histories (Telegram, WhatsApp, Signal, iMessage)
31
+ - API keys for Claude, OpenAI, and other providers
32
+ - OAuth tokens and bot credentials
33
+ - Full shell access to host machine
34
+
35
+ **Prompt injection attack example:** An attacker sends you an email with hidden instructions. Your AI reads it, extracts your recent emails, and forwards summaries to the attacker. No hacking required.
36
+
37
+ ---
38
+
39
+ ## Quick Security Audit
40
+
41
+ Run this to check your current security posture:
42
+
43
+ ```bash
44
+ clawdbot security audit --deep
45
+ ```
46
+
47
+ Auto-fix issues:
48
+
49
+ ```bash
50
+ clawdbot security audit --deep --fix
51
+ ```
52
+
53
+ ---
54
+
55
+ ## Step 1: Bind Gateway to Loopback Only
56
+
57
+ **What this does:** Prevents the gateway from accepting connections from other machines.
58
+
59
+ Check your `~/.clawdbot/clawdbot.json`:
60
+
61
+ ```json
62
+ {
63
+ "gateway": {
64
+ "bind": "loopback"
65
+ }
66
+ }
67
+ ```
68
+
69
+ **Options:**
70
+ - `loopback` — Only accessible from localhost (most secure)
71
+ - `lan` — Accessible from local network only
72
+ - `auto` — Binds to all interfaces (dangerous if exposed)
73
+
74
+ ---
75
+
76
+ ## Step 2: Set Up Authentication
77
+
78
+ **Option A: Token Authentication (Recommended)**
79
+
80
+ Generate a secure token:
81
+
82
+ ```bash
83
+ openssl rand -hex 32
84
+ ```
85
+
86
+ Add to your config:
87
+
88
+ ```json
89
+ {
90
+ "gateway": {
91
+ "auth": {
92
+ "mode": "token",
93
+ "token": "your-64-char-hex-token-here"
94
+ }
95
+ }
96
+ }
97
+ ```
98
+
99
+ Or set via environment:
100
+
101
+ ```bash
102
+ export CLAWDBOT_GATEWAY_TOKEN="your-secure-random-token-here"
103
+ ```
104
+
105
+ **Option B: Password Authentication**
106
+
107
+ ```json
108
+ {
109
+ "gateway": {
110
+ "auth": {
111
+ "mode": "password"
112
+ }
113
+ }
114
+ }
115
+ ```
116
+
117
+ Then:
118
+
119
+ ```bash
120
+ export CLAWDBOT_GATEWAY_PASSWORD="your-secure-password-here"
121
+ ```
122
+
123
+ ---
124
+
125
+ ## Step 3: Lock Down File Permissions
126
+
127
+ **What this does:** Ensures only you can read sensitive config files.
128
+
129
+ ```bash
130
+ chmod 700 ~/.clawdbot
131
+ chmod 600 ~/.clawdbot/clawdbot.json
132
+ chmod 700 ~/.clawdbot/credentials
133
+ ```
134
+
135
+ **Permission meanings:**
136
+ - `700` = Only owner can access folder
137
+ - `600` = Only owner can read/write file
138
+
139
+ Or let Clawdbot fix it:
140
+
141
+ ```bash
142
+ clawdbot security audit --fix
143
+ ```
144
+
145
+ ---
146
+
147
+ ## Step 4: Disable Network Broadcasting
148
+
149
+ **What this does:** Stops Clawdbot from announcing itself via mDNS/Bonjour.
150
+
151
+ Add to your shell config (`~/.zshrc` or `~/.bashrc`):
152
+
153
+ ```bash
154
+ export CLAWDBOT_DISABLE_BONJOUR=1
155
+ ```
156
+
157
+ Reload:
158
+
159
+ ```bash
160
+ source ~/.zshrc
161
+ ```
162
+
163
+ ---
164
+
165
+ ## Step 5: Update Node.js
166
+
167
+ Older Node.js versions have security vulnerabilities. You need **v22.12.0+**.
168
+
169
+ Check version:
170
+
171
+ ```bash
172
+ node --version
173
+ ```
174
+
175
+ **Mac (Homebrew):**
176
+ ```bash
177
+ brew update && brew upgrade node
178
+ ```
179
+
180
+ **Ubuntu/Debian:**
181
+ ```bash
182
+ curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
183
+ sudo apt-get install -y nodejs
184
+ ```
185
+
186
+ **Windows:** Download from [nodejs.org](https://nodejs.org/)
187
+
188
+ ---
189
+
190
+ ## Step 6: Set Up Tailscale (Remote Access)
191
+
192
+ **What this does:** Creates encrypted tunnel between your devices. Access Clawdbot from anywhere without public exposure.
193
+
194
+ **Install Tailscale:**
195
+
196
+ ```bash
197
+ # Linux
198
+ curl -fsSL https://tailscale.com/install.sh | sh
199
+ sudo tailscale up
200
+
201
+ # Mac
202
+ brew install tailscale
203
+ ```
204
+
205
+ **Configure Clawdbot for Tailscale:**
206
+
207
+ ```json
208
+ {
209
+ "gateway": {
210
+ "bind": "loopback",
211
+ "tailscale": {
212
+ "mode": "serve"
213
+ }
214
+ }
215
+ }
216
+ ```
217
+
218
+ Now access via your Tailscale network only.
219
+
220
+ ---
221
+
222
+ ## Step 7: Firewall Setup (UFW)
223
+
224
+ **For cloud servers (AWS, DigitalOcean, Hetzner, etc.)**
225
+
226
+ **Install UFW:**
227
+ ```bash
228
+ sudo apt update && sudo apt install ufw -y
229
+ ```
230
+
231
+ **Set defaults:**
232
+ ```bash
233
+ sudo ufw default deny incoming
234
+ sudo ufw default allow outgoing
235
+ ```
236
+
237
+ **Allow SSH (don't skip!):**
238
+ ```bash
239
+ sudo ufw allow ssh
240
+ ```
241
+
242
+ **Allow Tailscale (if using):**
243
+ ```bash
244
+ sudo ufw allow in on tailscale0
245
+ ```
246
+
247
+ **Enable:**
248
+ ```bash
249
+ sudo ufw enable
250
+ ```
251
+
252
+ **Verify:**
253
+ ```bash
254
+ sudo ufw status verbose
255
+ ```
256
+
257
+ ⚠️ **Never do this:**
258
+ ```bash
259
+ # DON'T - exposes your gateway publicly
260
+ sudo ufw allow 18789
261
+ ```
262
+
263
+ ---
264
+
265
+ ## Step 8: SSH Hardening
266
+
267
+ **Disable password auth (use SSH keys):**
268
+
269
+ ```bash
270
+ sudo nano /etc/ssh/sshd_config
271
+ ```
272
+
273
+ Change:
274
+ ```
275
+ PasswordAuthentication no
276
+ PermitRootLogin no
277
+ ```
278
+
279
+ Restart:
280
+ ```bash
281
+ sudo systemctl restart sshd
282
+ ```
283
+
284
+ ---
285
+
286
+ ## Security Checklist
287
+
288
+ Before deploying:
289
+
290
+ - [ ] Gateway bound to `loopback` or `lan`
291
+ - [ ] Auth token or password set
292
+ - [ ] File permissions locked (600/700)
293
+ - [ ] mDNS/Bonjour disabled
294
+ - [ ] Node.js v22.12.0+
295
+ - [ ] Tailscale configured (if remote)
296
+ - [ ] Firewall blocking port 18789
297
+ - [ ] SSH password auth disabled
298
+
299
+ ---
300
+
301
+ ## Config Template (Secure Defaults)
302
+
303
+ ```json
304
+ {
305
+ "gateway": {
306
+ "port": 18789,
307
+ "bind": "loopback",
308
+ "auth": {
309
+ "mode": "token",
310
+ "token": "YOUR_64_CHAR_HEX_TOKEN"
311
+ },
312
+ "tailscale": {
313
+ "mode": "serve"
314
+ }
315
+ }
316
+ }
317
+ ```
318
+
319
+ ---
320
+
321
+ ## Credits
322
+
323
+ Based on security research by [@NickSpisak_](https://x.com/NickSpisak_) who found 1,673+ exposed gateways on Shodan.
324
+
325
+ Original article: https://x.com/nickspisak_/status/2016195582180700592
326
+
327
+ ---
328
+
329
+ ## Installation
330
+
331
+ ```bash
332
+ clawdhub install NextFrontierBuilds/moltbot-security
333
+ ```
334
+
335
+ Built by [@NextXFrontier](https://x.com/NextXFrontier)
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "moltbot-security",
3
+ "version": "1.0.0",
4
+ "description": "Security hardening guide for Moltbot/Clawdbot. Lock down gateway, fix permissions, set up auth, configure firewalls. Based on real vulnerability research.",
5
+ "main": "SKILL.md",
6
+ "keywords": [
7
+ "moltbot",
8
+ "clawdbot",
9
+ "security",
10
+ "hardening",
11
+ "gateway",
12
+ "firewall",
13
+ "tailscale",
14
+ "ssh",
15
+ "authentication",
16
+ "ai-agent",
17
+ "devops",
18
+ "infosec"
19
+ ],
20
+ "author": "tytaninc7",
21
+ "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "https://github.com/NextFrontierBuilds/moltbot-security"
25
+ },
26
+ "homepage": "https://github.com/NextFrontierBuilds/moltbot-security#readme"
27
+ }