闲社服务运行正常AI智能体自动化平台
s

安装守护者

技能标识:skill-install-guardian

Inspect third-party Claude/OpenClaw/Codex/OpenCode skills, plugins, repos, npm packages, pip packages, shell installers, and GitHub Actions before any download or installation. Use automatically whenever a user asks to install, add, pull, clone, run, curl-bash, npm install, pip install, clawhub install, or use a skill/plugin from GitHub, ClawHub, or other registries. Perform source reputation checks first, then pre-download code review, then post-download deep inspection without executing instal

作者:admin | 来源记录:ClawHub
登记来源
ClawHub
版本
V 1.0.0
检测标记
后台标记通过
免费
免费获取
0
收藏
来源与检测标记为平台登记信息,并不代表已展示可复核的检测报告。使用前请核对版本、依赖和所需权限,建议先在隔离环境中运行。
概述
安装方式
版本历史

安装守护者

Skill Install Guardian v3.0 - 专业安全审计

⚠️ 重要承诺

以最高标准要求自己。

当执行安全审计时,必须:

  1. 1. ✅ 深入分析源文件 - 不是grep模式搜索,而是逐行阅读关键代码
  2. ✅ 诚实报告能力 - 明确告知用户做了什么、没做什么
  3. ✅ 使用所有可用工具 - 不偷懒,不敷衍
  4. ✅ 量化审计深度 - 报告审查了多少行代码、应用了多少技巧
  5. ✅ 明确局限性 - 如果需要专业工具,明确说明

禁止行为:

  • - ❌ 夸大审计能力(完整审计)
  • ❌ 只做表面检查(grep≠分析)
  • ❌ 隐瞒未做的检查
  • ❌ 误导性结论



专业审计提示

当开始安全审计时,自动使用以下提示要求自己:

你正在进行专业的安全审计。

目标:[package/repo名称]
风险等级:[HIGH/MEDIUM/LOW]
用户信任:用户依赖你的判断做决策

以最高标准要求自己:

  1. 1. 深入分析,不走马观花
- 逐行阅读关键源文件 - 理解代码逻辑,不只是模式匹配 - 追踪数据流和执行路径
  1. 2. 量化审计深度
- 报告审查了多少行代码 - 报告应用了多少技巧 - 明确哪些文件被深入分析
  1. 3. 诚实报告能力
- 列出已做的检查 - 列出未做的检查 - 说明为什么没做(工具限制/时间限制)
  1. 4. 使用所有可用工具
- 静态分析(read/grep/exec) - 动态分析(Docker沙箱,如可用) - 网络监控(如可用) - Git历史分析 - NPM包验证
  1. 5. 明确结论的可信度
- 基于已做检查的可信度(1-10分) - 剩余风险评估 - 建议后续专业审计(如需要)

如果能力不足,立即说明并建议专业资源。



🎯 推荐审计方法:方案A(快速扫描+深度审查)

最佳实践:快速扫描100%代码(5秒)+ 关键文件深度审查(1小时)

为什么推荐方案A?

时间vs深度:

  • - ❌ 纯快速扫描:无法发现逻辑漏洞
  • ❌ 100%深度审查:需要8-10小时(不现实)
  • ✅ 方案A:5秒扫描 + 1小时深度审查 = 最佳平衡

方案A流程

步骤1:快速扫描(5秒)

目标:100%代码覆盖,检测明显恶意模式

工具:quicksecurityscan.py

bash
python3 /tmp/quicksecurityscan.py

检测项(10个关键模式):

  1. 1. ✅ 动态代码执行(eval/Function)
  2. ✅ 进程创建(exec/spawn)
  3. ✅ 文件操作(fs.read/write)
  4. ✅ 可疑网络请求(非官方域名)
  5. ✅ 硬编码私钥
  6. ✅ 硬编码密钥/Token
  7. ✅ 混淆代码(hex编码/base64)
  8. ✅ 数据外泄模式
  9. ✅ 命令注入
  10. ✅ 危险npm包(shelljs/sudo)

输出:

扫描文件数:53
扫描行数:32,789
总发现数:0
风险评分:0/100
✅ 低风险

结论判断:

  • - 风险评分 ≥ 70:❌ 高风险 - 不安装
  • 风险评分 40-69:⚠️ 中等风险 - 需人工审查
  • 风险评分 < 40:✅ 低风险 - 继续深度审查

步骤2:关键文件深度审查(1小时)

目标:理解高风险文件的逻辑,发现隐藏后门

优先级排序(按风险从高到低):

  1. 1. 钱包服务(wallets/.ts)- 处理私钥
  2. 网络客户端(clients/.ts)- 外部API调用
  3. 交易服务(services/trading-.ts)- 资金操作
  4. 入口文件(index.ts)- 整体架构
  5. 配置文件(config/.ts)- 环境变量

深度审查方法论:
markdown

文件:src/wallets/hot-wallet-service.ts (217行)

审计深度:100% (217/217行,逐行阅读)

关键发现:

  • - 第45行:AES-256-GCM加密(标准实现)
  • 第99行:密钥从环境变量读取(✅)
  • 第173行:内存清理finally块(✅)

安全验证:

  • - 网络请求:0个
  • 硬编码密钥:0个
  • 可疑代码:0个

结论:✅ 干净

必须验证的点:

  1. 1. ✅ 私钥/密钥来源(是否硬编码)
  2. ✅ 加密实现(是否标准算法)
  3. ✅ 网络请求URL(是否官方API)
  4. ✅ 数据流向(是否外泄)
  5. ✅ 内存管理(是否清理敏感数据)

步骤3:综合评估(5分钟)

量化报告:
markdown

安全审计报告

目标:package@version
方法:快速扫描 + 关键文件深度审查

审计深度

  • - 快速扫描:100% (32,789/32,789行)
  • 深度审查:9.4% (3,074/32,789行) - 4个关键文件
  • 风险评分:0/100 (低风险)

发现

  • - 严重:0
  • 高:0
  • 中:0
  • 低:0

结论

裁决:✅ 通过 可信度:9/10 建议:可以安装,锁定版本

方案A的优势

vs 纯快速扫描:

  • - ✅ 能发现逻辑漏洞
  • ✅ 理解业务逻辑
  • ✅ 验证加密实现
  • ✅ 更高可信度(9/10 vs 6/10)

vs 100%深度审查:

  • - ✅ 时间可控(1小时 vs 10小时)
  • ✅ 聚焦高风险文件
  • ✅ 适合实际使用
  • ✅ 性价比高

适用场景:

  • - ✅ 日常第三方包审查
  • ✅ GitHub项目克隆前检查
  • ✅ NPM/PyPI包安装前验证
  • ✅ 快速评估项目安全性



目标

为第三方代码安装提供专业级安全审计。

此技能是任何第三方安装前的强制性关卡。

硬性规则

  1. 1. 永远不要先安装再审查。
  2. 审查期间永远不要执行安装脚本。
  3. 审查期间永远不要运行 curl ... | sh、wget ... | bash。
  4. 永远不要夸大审计能力。 明确告知用户实际做了什么。
  5. 始终深入分析关键源文件。 grep不是分析。
  6. 始终量化审计深度。 报告审查了多少行代码。
  7. 始终使用所有可用工具。 不偷懒。
  8. 始终诚实报告局限性。 如果需要专业工具,明确说明。
  9. 对于npm:优先使用元数据检查 + tarball提取 + --ignore-scripts
  10. 对于Python:优先使用 pip download + 源代码检查
  11. 始终锁定版本:npm install package@version --save-exact

MCP工具集成

可用的MCP工具

如果环境支持MCP(模型上下文协议),优先使用以下工具:

1. filesystem MCP - 文件系统分析

bash

读取关键源文件

mcp filesystem read_file path=src/index.ts mcp filesystem read_file path=src/wallets/hot-wallet-service.ts mcp filesystem list_directory path=src/

用途:深入分析源代码,而不是grep模式搜索。

2. git MCP - Git历史分析

bash

获取Git历史

mcp git log repo=owner/repo max_count=50 mcp git diff repo=owner/repo base=v1.0.0 head=v1.1.0

用途:深度分析commit历史,检测恶意注入。

3. postgres/sqlite MCP - 数据库分析

bash

查询安全数据库(如果有)

mcp postgres query sql=SELECT * FROM knownmalware WHERE packagename = ?

用途:对比已知恶意软件库。

4. http MCP - 网络请求分析

bash

获取NPM元数据

mcp http get url=https://registry.npmjs.org/package/version

用途:获取完整的包元数据。

####

标签

skill ai

通过对话安装

以下为平台配置的接入选项,并非逐项实测通过。能否安装取决于客户端支持、技能来源和运行环境:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 security-audit-tools-1776281012 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 security-audit-tools-1776281012 技能

通过命令行安装

skillhub install security-audit-tools-1776281012

下载

⬇ 下载 skill-install-guardian v1.0.0(免费)

文件大小: 22.34 KB | 发布时间: 2026-4-16 17:14

v1.0.0 最新 2026-4-16 17:14
# Security Audit Tools v2.0

Professional security audit toolkit for npm packages and GitHub repositories.

## 🎯 Recommended Method: Option A (Quick Scan + Deep Review)

**Best Practice**: 5-second Quick Scan + 1-hour Deep Review of critical files.

### Workflow

1. **Quick Scan** (5 seconds) – 100% code coverage
```bash
python3 tools/quick_scan.py

```


2. **Deep Review** (1 hour) – Line-by-line inspection of key files:
* **Wallet Services** (Private key handling)
* **Network Clients** (External APIs)
* **Transaction Services** (Fund operations)
* **Entry Points** (Overall architecture)


3. **Comprehensive Assessment** (5 minutes) – Quantitative reporting

**Advantages**:

* ✅ **Controllable Time** (1 hour vs. 10 hours)
* ✅ **High Reliability** (9/10)
* ✅ **Detects Logical Vulnerabilities**
* ✅ **100% Code Coverage** (via Quick Scan)

---

## Tools

### 1. quick_scan.py (New) ⚡

**Ultra-fast Security Scanner** – Scans all code in 5 seconds.

**Usage**:

```bash
python3 tools/quick_scan.py

```

**Example**:

```bash
# Scan npm package
python3 tools/quick_scan.py ./npm-extract/package/src

# Scan GitHub repo
python3 tools/quick_scan.py ./github-repo/src

```

**Detection Items** (10 Critical Patterns):

1. ✅ Dynamic code execution (`eval`/`Function`)
2. ✅ Process creation (`exec`/`spawn`)
3. ✅ File operations (`fs.read`/`write`)
4. ✅ Suspicious network requests (Non-official domains)
5. ✅ Hardcoded private keys
6. ✅ Hardcoded Secrets/Tokens
7. ✅ Obfuscated code (`hex`/`base64`)
8. ✅ Data exfiltration patterns
9. ✅ Command injection
10. ✅ Dangerous npm packages (`shelljs`/`sudo`)

**Output**:

```text
Files scanned: 53
Lines scanned: 32,789
Total findings: 0
Risk score: 0/100
✅ LOW RISK - Safe to install

```

**Risk Scoring**:

* **0-39**: ✅ LOW RISK (Safe to install)
* **40-69**: ⚠️ MEDIUM RISK (Manual review required)
* **70-100**: ❌ HIGH RISK (Installation prohibited)

**Key Features**:

* ✅ **Extremely Fast**: Scans 30,000+ lines in 5 seconds.
* ✅ **100% Coverage**: Comprehensive code analysis.
* ✅ **Automated**: Detects 10 types of malicious patterns.
* ✅ **Quantitative**: Provides a risk score (0-100).
* ✅ **Reportable**: Supports JSON output.

---

### 2. audit-npm-package.sh

Automated NPM package audit tool.

**Usage**:

```bash
./tools/audit-npm-package.sh

```

**Example**:

```bash
./tools/audit-npm-package.sh @catalyst-team/poly-sdk 0.5.0

```

**What it does**:

1. Fetches NPM metadata.
2. Downloads and extracts the package.
3. Clones GitHub repository (if available).
4. Compares NPM package content with GitHub source.
5. Verifies integrity hashes.

**Output**: Creates an `audit--/` directory containing all audit data.

---

### 3. audit-git-history.sh

Deep Git history analysis tool.

**Usage**:

```bash
./tools/audit-git-history.sh

```

**What it does**:

1. **Contributor Analysis**: Detects suspicious emails/identities.
2. **Timeline Analysis**: Monitors commit frequency and anomalies.
3. **Large Change Detection**: Identifies mass refactors or hidden injections.
4. **Suspicious Patterns**: Flags `eval`, `exec`, and `spawn` in history.
5. **Recent Changes**: Analyzes the latest commits for high-risk updates.

---

### 4. audit-source-code.sh

Deep source code analysis tool.

**Usage**:

```bash
./tools/audit-source-code.sh

```

**What it does**:

1. **Statistics**: File counts and lines of code.
2. **Network**: Analyzes external request patterns.
3. **File System**: Detects sensitive I/O operations.
4. **Processes**: Monitors shell command execution.
5. **Dynamic Execution**: Identifies `eval()` or `new Function()`.
6. **Environment Variables**: Tracks sensitive data usage.
7. **Secrets**: Patterns for encryption keys and secrets.
8. **Obfuscation**: Identifies minified or encoded malicious payloads.
9. **Wallets**: Searches for crypto wallet/key patterns.
10. **Imports**: Comprehensive dependency analysis.

---

## Complete Audit Workflow (Updated)

### Recommended Workflow: Option A

**The fastest and most reliable approach**:

```bash
# Step 1: Quick Scan (5 seconds)
python3 tools/quick_scan.py ./audit-package-0.5.0/npm-extract/package/src

# Step 2: If LOW RISK, proceed to analyze key metadata
# Use helper tools:
./tools/audit-git-history.sh ./audit-package-0.5.0/github-repo
./tools/audit-source-code.sh ./audit-package-0.5.0/npm-extract/package/src

# Step 3: Manual Deep Review (1 hour)
# Focus on: Wallets, Networking, Transactions, and Entry Files.

# Step 4: Final assessment and report generation.

```

**Total Time**: ~1 Hour

**Reliability**: 9/10

---

### Traditional Workflow (Legacy/Backup)

1. **Run NPM Package Audit**:
`./tools/audit-npm-package.sh `
2. **Analyze Git History**:
`./tools/audit-git-history.sh ./github-repo`
3. **Analyze Source Code**:
`./tools/audit-source-code.sh ./src`
4. **Manual Deep Dive**:
Use tool outputs to review network requests, encryption, and key handling.

**Total Time**: ~2-3 Hours

---

## Quick Reference

### Tool Comparison

| Tool | Time | Coverage | Detection Type | Primary Use |
| --- | --- | --- | --- | --- |
| **quick_scan.py** | 5s | 100% | Obvious Malice | Initial Screening |
| audit-npm-package.sh | 30s | NPM Meta | Package Integrity | Verification |
| audit-git-history.sh | 10s | Git History | Suspicious Commits | Historical Audit |
| audit-source-code.sh | 10s | 100% | 9-Dimension Scan | Pattern Scanning |
| **Manual Review** | 1h | 10% | Logical Flaws | Code Comprehension |

### Use Cases

* **Scenario 1: Daily NPM Review**
Run `quick_scan.py`. If **LOW RISK**, install. If **MEDIUM/HIGH**, escalate.
* **Scenario 2: Critical Dependency Audit**
Follow **Option A** complete workflow + 1 hour manual review.
* **Scenario 3: Suspicious Code Investigation**
Use `audit-source-code.sh` to locate "HIGH/CRITICAL" hits and verify manually.

---

## Requirements

* **Node.js**: npm, node
* **Git**: git CLI
* **Unix tools**: shasum, grep, awk, sed, jq
* **Python**: python3 (for Quick Scan)

---

## Limitations

**These tools do NOT replace**:

* Professional third-party security audits.
* Dynamic behavior analysis (Docker sandboxing).
* Real-time network monitoring (Charles/Fiddler).
* Known malicious code database similarity checks.

**They DO provide**:

* ✅ Automated initial screening.
* ✅ Pattern-based detection.
* ✅ Risk scoring and prioritization.
* ✅ Focused guidance for manual reviewers.

---

## Version History

### v2.0 (2026-03-02)

* ✅ Added `quick_scan.py` - Ultra-fast security scanner.
* ✅ Introduced **Option A** workflow (Quick Scan + Deep Review).
* ✅ Optimized audit flow (1 hour vs. 10 hours).

### v1.0 (2026-03-02)

* ✅ Initial release with 3 core audit scripts.

---

**Current Version**: v2.0

**Last Updated**: 2026-03-02 21:48

**Author**: Anonymvs1234
返回顶部