@pwddd/skills-scanner 3.0.6 → 3.0.7
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.
- package/README.md +12 -32
- package/index.ts +21 -17
- package/openclaw.plugin.json +1 -1
- package/package.json +1 -1
- package/skills/skills-scanner/SKILL.md +29 -34
- package/skills/skills-scanner/scan.py +2 -2
- package/src/commands.ts +302 -302
- package/src/deps.ts +77 -112
- package/src/report.ts +2 -2
- package/src/scanner.ts +6 -2
- package/src/watcher.ts +9 -9
package/README.md
CHANGED
|
@@ -116,29 +116,22 @@ openclaw skills-scanner health
|
|
|
116
116
|
|
|
117
117
|
## 前置要求
|
|
118
118
|
|
|
119
|
-
###
|
|
119
|
+
### Python 3.10+(必需)
|
|
120
120
|
|
|
121
121
|
```bash
|
|
122
122
|
# 检查 Python 版本
|
|
123
123
|
python3 --version
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
### 2. 包管理器(二选一)
|
|
127
124
|
|
|
128
|
-
|
|
125
|
+
# macOS
|
|
126
|
+
brew install python3
|
|
129
127
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
128
|
+
# Linux
|
|
129
|
+
apt-get install python3 python3-pip
|
|
133
130
|
|
|
134
|
-
#
|
|
135
|
-
|
|
131
|
+
# Windows
|
|
132
|
+
# 从 https://www.python.org/downloads/ 下载安装
|
|
136
133
|
```
|
|
137
134
|
|
|
138
|
-
**选项 B:标准 pip(无需额外安装)**
|
|
139
|
-
|
|
140
|
-
如果没有 uv,插件会自动使用 Python 自带的 `pip`。
|
|
141
|
-
|
|
142
135
|
### 2. 启动扫描 API 服务
|
|
143
136
|
|
|
144
137
|
插件需要连接到 skill-scanner-api 服务进行实际的安全扫描。
|
|
@@ -165,14 +158,7 @@ skill-scanner-api
|
|
|
165
158
|
```bash
|
|
166
159
|
# 手动安装依赖
|
|
167
160
|
cd extensions/skills-scanner/skills/skills-scanner
|
|
168
|
-
|
|
169
|
-
# 使用 uv(推荐)
|
|
170
|
-
uv venv .venv --python 3.10
|
|
171
|
-
uv pip install --python .venv/bin/python requests>=2.31.0
|
|
172
|
-
|
|
173
|
-
# 或使用标准 Python
|
|
174
|
-
python3 -m venv .venv
|
|
175
|
-
.venv/bin/python -m pip install requests>=2.31.0
|
|
161
|
+
python3 -m pip install --user "requests>=2.31.0"
|
|
176
162
|
```
|
|
177
163
|
|
|
178
164
|
### API 服务连接失败
|
|
@@ -216,8 +202,7 @@ extensions/skills-scanner/
|
|
|
216
202
|
│ └── types.ts # 类型定义
|
|
217
203
|
└── skills/
|
|
218
204
|
└── skills-scanner/
|
|
219
|
-
|
|
220
|
-
└── .venv/ # Python 虚拟环境(自动创建)
|
|
205
|
+
└── scan.py # Python 扫描脚本
|
|
221
206
|
```
|
|
222
207
|
|
|
223
208
|
## 许可证
|
|
@@ -403,17 +388,13 @@ openclaw skills-scanner clawhub https://clawhub.ai/username/project --json resul
|
|
|
403
388
|
## 依赖要求
|
|
404
389
|
|
|
405
390
|
- Python 3.10+
|
|
406
|
-
- uv(Python 包管理器)
|
|
407
391
|
- skill-scanner-api 服务(需要单独运行)
|
|
408
392
|
|
|
409
393
|
### 安装依赖
|
|
410
394
|
|
|
411
395
|
```bash
|
|
412
|
-
#
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
# Linux
|
|
416
|
-
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
396
|
+
# 确保 Python 已安装
|
|
397
|
+
python3 --version
|
|
417
398
|
|
|
418
399
|
# 启动 API 服务
|
|
419
400
|
skill-scanner-api
|
|
@@ -426,8 +407,7 @@ skill-scanner-api
|
|
|
426
407
|
```bash
|
|
427
408
|
# 手动安装依赖
|
|
428
409
|
cd extensions/skills-scanner/skills/skills-scanner
|
|
429
|
-
|
|
430
|
-
uv pip install --python .venv/bin/python requests
|
|
410
|
+
python3 -m pip install --user "requests>=2.31.0"
|
|
431
411
|
```
|
|
432
412
|
|
|
433
413
|
### API 服务连接失败
|
package/index.ts
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
isFirstRun,
|
|
19
19
|
markConfigReviewed,
|
|
20
20
|
} from "./src/state.js";
|
|
21
|
-
import { ensureDeps,
|
|
21
|
+
import { ensureDeps, getPythonCommand, isPythonReady } from "./src/deps.js";
|
|
22
22
|
import { runScan } from "./src/scanner.js";
|
|
23
23
|
import { buildDailyReport } from "./src/report.js";
|
|
24
24
|
import { ensureCronJob } from "./src/cron.js";
|
|
@@ -31,11 +31,12 @@ import { HIGH_RISK_OPERATION_GUARD } from "./src/high-risk-operation-guard.js";
|
|
|
31
31
|
// Constants
|
|
32
32
|
const PLUGIN_ROOT = process.env.OPENCLAW_PLUGIN_ROOT || __dirname;
|
|
33
33
|
const SKILL_DIR = join(PLUGIN_ROOT, "skills", "skills-scanner");
|
|
34
|
-
const VENV_PYTHON = join(SKILL_DIR, ".venv", "bin", "python");
|
|
35
34
|
const SCAN_SCRIPT = join(SKILL_DIR, "scan.py");
|
|
36
35
|
const STATE_DIR = join(os.homedir(), ".openclaw", "skills-scanner");
|
|
37
36
|
const QUARANTINE_DIR = join(STATE_DIR, "quarantine");
|
|
38
37
|
|
|
38
|
+
const PYTHON_CMD = getPythonCommand();
|
|
39
|
+
|
|
39
40
|
export default function register(api: OpenClawPluginApi) {
|
|
40
41
|
const cfg: ScannerConfig =
|
|
41
42
|
api.config?.plugins?.entries?.["skills-scanner"]?.config ?? {};
|
|
@@ -58,7 +59,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
58
59
|
api.logger.info(`[skills-scanner] API URL: ${apiUrl}`);
|
|
59
60
|
api.logger.info(`[skills-scanner] Scan directories: ${scanDirs.join(", ")}`);
|
|
60
61
|
api.logger.info(
|
|
61
|
-
`[skills-scanner] Python dependencies: ${
|
|
62
|
+
`[skills-scanner] Python dependencies: ${isPythonReady(PYTHON_CMD) ? "✅ Ready" : "❌ Not installed"}`
|
|
62
63
|
);
|
|
63
64
|
|
|
64
65
|
// Inject system prompt guidance (can be disabled via config)
|
|
@@ -110,9 +111,9 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
// Install dependencies immediately
|
|
113
|
-
if (!
|
|
114
|
+
if (!isPythonReady(PYTHON_CMD)) {
|
|
114
115
|
api.logger.info("[skills-scanner] Installing Python dependencies...");
|
|
115
|
-
ensureDeps(
|
|
116
|
+
ensureDeps(PYTHON_CMD, api.logger)
|
|
116
117
|
.then((success) => {
|
|
117
118
|
if (success) {
|
|
118
119
|
api.logger.info("[skills-scanner] ✅ Dependencies installed");
|
|
@@ -140,7 +141,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
140
141
|
start: async () => {
|
|
141
142
|
api.logger.info("[skills-scanner] 🚀 Service starting...");
|
|
142
143
|
|
|
143
|
-
const depsReady = await ensureDeps(
|
|
144
|
+
const depsReady = await ensureDeps(PYTHON_CMD, api.logger);
|
|
144
145
|
|
|
145
146
|
if (!depsReady) {
|
|
146
147
|
api.logger.error("[skills-scanner] ❌ Dependencies installation failed");
|
|
@@ -158,7 +159,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
158
159
|
policy,
|
|
159
160
|
persistWatcherAlert,
|
|
160
161
|
api.logger,
|
|
161
|
-
|
|
162
|
+
PYTHON_CMD,
|
|
162
163
|
SCAN_SCRIPT,
|
|
163
164
|
QUARANTINE_DIR
|
|
164
165
|
);
|
|
@@ -192,7 +193,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
192
193
|
policy,
|
|
193
194
|
preInstallScan,
|
|
194
195
|
onUnsafe,
|
|
195
|
-
|
|
196
|
+
PYTHON_CMD,
|
|
196
197
|
SCAN_SCRIPT,
|
|
197
198
|
api.logger
|
|
198
199
|
);
|
|
@@ -261,9 +262,9 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
261
262
|
api.registerGatewayMethod("skillsScanner.scan", async ({ respond, params }: any) => {
|
|
262
263
|
const { path: p, mode = "scan", recursive = false, detailed = false } = params ?? {};
|
|
263
264
|
if (!p) return respond(false, { error: "Missing path parameter" });
|
|
264
|
-
if (!
|
|
265
|
+
if (!isPythonReady(PYTHON_CMD))
|
|
265
266
|
return respond(false, { error: "Python dependencies not ready" });
|
|
266
|
-
const res = await runScan(
|
|
267
|
+
const res = await runScan(PYTHON_CMD, SCAN_SCRIPT, mode === "batch" ? "batch" : "scan", expandPath(p), {
|
|
267
268
|
recursive,
|
|
268
269
|
detailed,
|
|
269
270
|
behavioral,
|
|
@@ -279,7 +280,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
279
280
|
});
|
|
280
281
|
|
|
281
282
|
api.registerGatewayMethod("skillsScanner.report", async ({ respond }: any) => {
|
|
282
|
-
if (!
|
|
283
|
+
if (!isPythonReady(PYTHON_CMD))
|
|
283
284
|
return respond(false, { error: "Python dependencies not ready" });
|
|
284
285
|
if (scanDirs.length === 0) return respond(false, { error: "No scan directories found" });
|
|
285
286
|
const report = await buildDailyReport(
|
|
@@ -289,7 +290,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
289
290
|
useLLM,
|
|
290
291
|
policy,
|
|
291
292
|
api.logger,
|
|
292
|
-
|
|
293
|
+
PYTHON_CMD,
|
|
293
294
|
SCAN_SCRIPT
|
|
294
295
|
);
|
|
295
296
|
respond(true, { report, state: loadState() });
|
|
@@ -306,7 +307,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
306
307
|
.option("--detailed", "显示所有发现")
|
|
307
308
|
.option("--behavioral", "启用行为分析")
|
|
308
309
|
.action(async (p: string, opts: any) => {
|
|
309
|
-
const res = await runScan(
|
|
310
|
+
const res = await runScan(PYTHON_CMD, SCAN_SCRIPT, "scan", expandPath(p), {
|
|
310
311
|
...opts,
|
|
311
312
|
apiUrl,
|
|
312
313
|
useLLM,
|
|
@@ -323,7 +324,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
323
324
|
.option("--detailed", "显示所有发现")
|
|
324
325
|
.option("--behavioral", "启用行为分析")
|
|
325
326
|
.action(async (d: string, opts: any) => {
|
|
326
|
-
const res = await runScan(
|
|
327
|
+
const res = await runScan(PYTHON_CMD, SCAN_SCRIPT, "batch", expandPath(d), {
|
|
327
328
|
...opts,
|
|
328
329
|
apiUrl,
|
|
329
330
|
useLLM,
|
|
@@ -344,7 +345,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
344
345
|
useLLM,
|
|
345
346
|
policy,
|
|
346
347
|
console,
|
|
347
|
-
|
|
348
|
+
PYTHON_CMD,
|
|
348
349
|
SCAN_SCRIPT
|
|
349
350
|
);
|
|
350
351
|
console.log(report);
|
|
@@ -354,7 +355,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
354
355
|
.command("health")
|
|
355
356
|
.description("检查 API 服务健康状态")
|
|
356
357
|
.action(async () => {
|
|
357
|
-
if (!
|
|
358
|
+
if (!isPythonReady(PYTHON_CMD)) {
|
|
358
359
|
console.error("❌ Python 依赖未就绪");
|
|
359
360
|
process.exit(1);
|
|
360
361
|
}
|
|
@@ -364,7 +365,7 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
364
365
|
const { promisify } = await import("node:util");
|
|
365
366
|
const execAsync = promisify(exec);
|
|
366
367
|
|
|
367
|
-
const cmd = `"${
|
|
368
|
+
const cmd = `"${PYTHON_CMD}" "${SCAN_SCRIPT}" --api-url "${apiUrl}" health`;
|
|
368
369
|
const env = { ...process.env };
|
|
369
370
|
delete env.http_proxy;
|
|
370
371
|
delete env.https_proxy;
|
|
@@ -395,3 +396,6 @@ export default function register(api: OpenClawPluginApi) {
|
|
|
395
396
|
|
|
396
397
|
api.logger.info("[skills-scanner] ✅ Plugin registered");
|
|
397
398
|
}
|
|
399
|
+
|
|
400
|
+
|
|
401
|
+
|
package/openclaw.plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -29,7 +29,7 @@ OpenClaw Skills 安全扫描工具,检测恶意代码、数据窃取、提示
|
|
|
29
29
|
|
|
30
30
|
**检查方法**:
|
|
31
31
|
```bash
|
|
32
|
-
|
|
32
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 health
|
|
33
33
|
```
|
|
34
34
|
|
|
35
35
|
**处理规则**:
|
|
@@ -144,19 +144,13 @@ VirusTotal 是业界权威的多引擎病毒扫描服务,其结果具有极高
|
|
|
144
144
|
|
|
145
145
|
```bash
|
|
146
146
|
# 检查 Python 是否可用
|
|
147
|
-
|
|
147
|
+
python3 --version || echo "请安装 Python 3.10+"
|
|
148
148
|
|
|
149
|
-
#
|
|
150
|
-
|
|
151
|
-
uv venv {baseDir}/.venv --python 3.10 --quiet
|
|
152
|
-
uv pip install --python {baseDir}/.venv/bin/python requests --quiet
|
|
153
|
-
|
|
154
|
-
# 方式 2:使用标准 Python(无需 uv)
|
|
155
|
-
python3 -m venv {baseDir}/.venv
|
|
156
|
-
{baseDir}/.venv/bin/python -m pip install --quiet requests
|
|
149
|
+
# 安装依赖到主机环境
|
|
150
|
+
python3 -m pip install --user --quiet "requests>=2.31.0"
|
|
157
151
|
```
|
|
158
152
|
|
|
159
|
-
|
|
153
|
+
安装只需执行一次。插件会自动处理依赖安装。
|
|
160
154
|
|
|
161
155
|
## 配置
|
|
162
156
|
|
|
@@ -179,7 +173,7 @@ python3 -m venv {baseDir}/.venv
|
|
|
179
173
|
或直接调用时使用 `--api-url` 参数:
|
|
180
174
|
|
|
181
175
|
```bash
|
|
182
|
-
|
|
176
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 scan <路径>
|
|
183
177
|
```
|
|
184
178
|
|
|
185
179
|
---
|
|
@@ -204,7 +198,7 @@ python3 -m venv {baseDir}/.venv
|
|
|
204
198
|
适用于快速安全检查,显示总体安全状态和严重问题。
|
|
205
199
|
|
|
206
200
|
```bash
|
|
207
|
-
|
|
201
|
+
python3 {baseDir}/scan.py --api-url {apiUrl} clawhub <clawhub_url>
|
|
208
202
|
```
|
|
209
203
|
|
|
210
204
|
**示例输出**:
|
|
@@ -219,7 +213,7 @@ python3 -m venv {baseDir}/.venv
|
|
|
219
213
|
显示每个安全发现的详细信息,包括类别、描述、文件位置等。
|
|
220
214
|
|
|
221
215
|
```bash
|
|
222
|
-
|
|
216
|
+
python3 {baseDir}/scan.py --api-url {apiUrl} clawhub <clawhub_url> --detailed
|
|
223
217
|
```
|
|
224
218
|
|
|
225
219
|
**示例输出**:
|
|
@@ -240,7 +234,7 @@ python3 -m venv {baseDir}/.venv
|
|
|
240
234
|
启用 AST 数据流分析,更准确地检测复杂的安全威胁。扫描时间较长但更全面。
|
|
241
235
|
|
|
242
236
|
```bash
|
|
243
|
-
|
|
237
|
+
python3 {baseDir}/scan.py --api-url {apiUrl} clawhub <clawhub_url> --detailed --behavioral
|
|
244
238
|
```
|
|
245
239
|
|
|
246
240
|
**适用场景**:
|
|
@@ -253,7 +247,7 @@ python3 -m venv {baseDir}/.venv
|
|
|
253
247
|
使用 LLM 进行语义分析,检测隐蔽的恶意模式和提示注入。需要 API 服务配置 LLM 支持。
|
|
254
248
|
|
|
255
249
|
```bash
|
|
256
|
-
|
|
250
|
+
python3 {baseDir}/scan.py --api-url {apiUrl} clawhub <clawhub_url> --detailed --behavioral --llm
|
|
257
251
|
```
|
|
258
252
|
|
|
259
253
|
**适用场景**:
|
|
@@ -265,13 +259,13 @@ python3 -m venv {baseDir}/.venv
|
|
|
265
259
|
|
|
266
260
|
```bash
|
|
267
261
|
# 严格模式(最保守,任何可疑行为都标记)
|
|
268
|
-
|
|
262
|
+
python3 {baseDir}/scan.py --api-url {apiUrl} clawhub <clawhub_url> --policy strict
|
|
269
263
|
|
|
270
264
|
# 平衡模式(推荐,默认)
|
|
271
|
-
|
|
265
|
+
python3 {baseDir}/scan.py --api-url {apiUrl} clawhub <clawhub_url> --policy balanced
|
|
272
266
|
|
|
273
267
|
# 宽松模式(只标记明确的威胁)
|
|
274
|
-
|
|
268
|
+
python3 {baseDir}/scan.py --api-url {apiUrl} clawhub <clawhub_url> --policy permissive
|
|
275
269
|
```
|
|
276
270
|
|
|
277
271
|
### 保存扫描结果
|
|
@@ -279,7 +273,7 @@ python3 -m venv {baseDir}/.venv
|
|
|
279
273
|
将扫描结果保存为 JSON 文件,便于后续分析或存档。
|
|
280
274
|
|
|
281
275
|
```bash
|
|
282
|
-
|
|
276
|
+
python3 {baseDir}/scan.py --api-url {apiUrl} clawhub <clawhub_url> --detailed --json /tmp/scan-result.json
|
|
283
277
|
```
|
|
284
278
|
|
|
285
279
|
### 实际使用示例
|
|
@@ -287,7 +281,7 @@ python3 -m venv {baseDir}/.venv
|
|
|
287
281
|
#### 示例 1:快速检查日历 Skill
|
|
288
282
|
|
|
289
283
|
```bash
|
|
290
|
-
|
|
284
|
+
python3 {baseDir}/scan.py --api-url {apiUrl} clawhub https://clawhub.ai/Asleep123/caldav-calendar
|
|
291
285
|
```
|
|
292
286
|
|
|
293
287
|
**用户对话**:
|
|
@@ -303,7 +297,7 @@ AI: 好的,让我先扫描一下这个 skill 的安全性...
|
|
|
303
297
|
#### 示例 2:详细检查 PDF Skill
|
|
304
298
|
|
|
305
299
|
```bash
|
|
306
|
-
|
|
300
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 clawhub https://clawhub.ai/steipete/nano-pdf --detailed
|
|
307
301
|
```
|
|
308
302
|
|
|
309
303
|
**用户对话**:
|
|
@@ -326,7 +320,7 @@ AI: 好的,我会进行详细扫描...
|
|
|
326
320
|
#### 示例 3:深度扫描可疑 Skill
|
|
327
321
|
|
|
328
322
|
```bash
|
|
329
|
-
|
|
323
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 clawhub https://clawhub.ai/username/suspicious-skill --detailed --behavioral --policy strict
|
|
330
324
|
```
|
|
331
325
|
|
|
332
326
|
**用户对话**:
|
|
@@ -349,7 +343,7 @@ AI: 明白,我会使用严格模式进行深度扫描...
|
|
|
349
343
|
#### 示例 4:包含 VirusTotal 扫描结果
|
|
350
344
|
|
|
351
345
|
```bash
|
|
352
|
-
|
|
346
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 clawhub https://clawhub.ai/username/project --detailed
|
|
353
347
|
```
|
|
354
348
|
|
|
355
349
|
**用户对话(未检测到威胁)**:
|
|
@@ -462,25 +456,25 @@ https://clawhub.ai/<username>/<project>
|
|
|
462
456
|
### 基础扫描(推荐,速度快)
|
|
463
457
|
|
|
464
458
|
```bash
|
|
465
|
-
|
|
459
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 scan <skill路径>
|
|
466
460
|
```
|
|
467
461
|
|
|
468
462
|
### 详细模式(显示所有发现)
|
|
469
463
|
|
|
470
464
|
```bash
|
|
471
|
-
|
|
465
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 scan <skill路径> --detailed
|
|
472
466
|
```
|
|
473
467
|
|
|
474
468
|
### 深度扫描(加入行为分析)
|
|
475
469
|
|
|
476
470
|
```bash
|
|
477
|
-
|
|
471
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 scan <skill路径> --detailed --behavioral
|
|
478
472
|
```
|
|
479
473
|
|
|
480
474
|
### 最强扫描(加入 LLM 语义分析)
|
|
481
475
|
|
|
482
476
|
```bash
|
|
483
|
-
|
|
477
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 scan <skill路径> --detailed --behavioral --llm
|
|
484
478
|
```
|
|
485
479
|
|
|
486
480
|
---
|
|
@@ -492,31 +486,31 @@ https://clawhub.ai/<username>/<project>
|
|
|
492
486
|
### 扫描指定目录下的所有 Skills
|
|
493
487
|
|
|
494
488
|
```bash
|
|
495
|
-
|
|
489
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 batch <目录路径>
|
|
496
490
|
```
|
|
497
491
|
|
|
498
492
|
### 递归扫描(含子目录)
|
|
499
493
|
|
|
500
494
|
```bash
|
|
501
|
-
|
|
495
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 batch <目录路径> --recursive
|
|
502
496
|
```
|
|
503
497
|
|
|
504
498
|
### 批量扫描并输出 JSON 报告
|
|
505
499
|
|
|
506
500
|
```bash
|
|
507
|
-
|
|
501
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 batch <目录路径> --detailed --json /tmp/scan-report.json
|
|
508
502
|
```
|
|
509
503
|
|
|
510
504
|
### 常用目录示例
|
|
511
505
|
|
|
512
506
|
扫描 OpenClaw 默认 skills 目录:
|
|
513
507
|
```bash
|
|
514
|
-
|
|
508
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 batch ~/.openclaw/skills
|
|
515
509
|
```
|
|
516
510
|
|
|
517
511
|
扫描 workspace skills:
|
|
518
512
|
```bash
|
|
519
|
-
|
|
513
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 batch ~/.openclaw/workspace/skills --recursive
|
|
520
514
|
```
|
|
521
515
|
|
|
522
516
|
---
|
|
@@ -526,7 +520,7 @@ https://clawhub.ai/<username>/<project>
|
|
|
526
520
|
检查 API 服务是否运行:
|
|
527
521
|
|
|
528
522
|
```bash
|
|
529
|
-
|
|
523
|
+
python3 {baseDir}/scan.py --api-url http://localhost:8000 health
|
|
530
524
|
```
|
|
531
525
|
|
|
532
526
|
---
|
|
@@ -638,3 +632,4 @@ https://clawhub.ai/<username>/<project>
|
|
|
638
632
|
```
|
|
639
633
|
|
|
640
634
|
**即使其他分析器显示安全,VirusTotal 检测到威胁时也必须警告用户!**
|
|
635
|
+
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
OpenClaw Skills 安全扫描器 (HTTP 客户端)
|
|
8
8
|
通过 HTTP API 调用远程 skill-scanner-api 服务
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
注意:此脚本使用系统 Python 运行,需确保已安装 requests 依赖
|
|
11
11
|
"""
|
|
12
12
|
|
|
13
13
|
import sys
|
|
@@ -26,7 +26,7 @@ try:
|
|
|
26
26
|
except ImportError as e:
|
|
27
27
|
print("❌ requests 未安装。")
|
|
28
28
|
print(f" 导入错误: {e}")
|
|
29
|
-
print(" 请运行: pip install requests
|
|
29
|
+
print(" 请运行: pip install requests")
|
|
30
30
|
sys.exit(1)
|
|
31
31
|
|
|
32
32
|
|