AppSecHQ/skill-scanner-test
GitHub: AppSecHQ/skill-scanner-test
针对公共技能目录中 AI Agent 技能和插件的自动化安全扫描流水线,系统性发现 prompt 注入、数据泄露、命令注入等安全风险。
Stars: 4 | Forks: 0
# Skill Scanner 测试
[](https://opensource.org/licenses/MIT)
[](https://www.python.org/downloads/)
[](https://skillscan.io)
[](https://skillscan.io)
一个针对公共技能目录中 AI agent 技能和插件的自动化安全扫描 pipeline。
AI agent 技能——即可安装的、用于扩展编程助手和 AI agent 功能的包——正在成为一个日益增长的攻击面。无论是出于故意还是无意,技能可能包含 prompt 注入、数据泄露、命令注入以及其他漏洞。本项目使用 Cisco 开源的 [skill-scanner](https://github.com/cisco-ai-defense/skill-scanner) 系统地扫描公共技能,并发布扫描结果。
## 状态
本项目处于早期阶段并正在不断发展。当前的实现包括:
- **扫描器:** [Cisco AI Defense skill-scanner](https://github.com/cisco-ai-defense/skill-scanner) (静态 + 行为 + 触发 + LLM + 元分析)
- **技能注册中心:** [skills.sh](https://skills.sh/) 和 [clawhub.ai](https://clawhub.ai/)
- **覆盖范围:** 目前已扫描 614 个技能
- **测试套件:** 77 个测试通过
该项目可以沿这两个维度进行扩展——添加更多的扫描器并 targeting(定位)更多的技能目录。
## 扫描结果
| 指标 | 数量 |
|--------|-------|
| 已扫描技能总数 | 649 |
| 安全技能 | 508 (78%) |
| 存在问题的技能 | 141 (22%) |
| 发现总数 | 1368 |
| 严重程度 | 数量 |
|----------|-------|
| CRITICAL | 204 |
| HIGH | 251 |
| MEDIUM | 707 |
| LOW | 180 |
| 类别 | 数量 |
|----------|-------|
| data_exfiltration | 413 |
| command_injection | 211 |
| social_engineering | 168 |
| transitive_trust_abuse | 151 |
| unauthorized_tool_use | 132 |
| policy_violation | 90 |
| resource_abuse | 88 |
| prompt_injection | 52 |
| tool_chaining_abuse | 30 |
| hardcoded_secrets | 23 |
| skill_discovery_abuse | 6 |
| obfuscation | 3 |
| autonomy_abuse | 1 |
- 这些结果已在 [skillscan.appsechq.com](https://skillscan.appsechq.com/) 进行了可视化。有关按技能划分的详细发现、严重程度分析和主要风险,请参阅 [summary-report.md](results/summary-report.md)。单个技能的扫描结果(JSON + Markdown)位于 [`results/`](results/) 目录中。
## 开始使用
需要 Python 3.10+ 和 Git。
```
git clone https://github.com/AppSecHQ/skill-scanner-test.git
cd skill-scanner-test
python -m venv .venv
source .venv/bin/activate
pip install -r scripts/requirements.txt
```
如果您所在的容器或环境不需要 venv,可以跳过 venv 步骤,直接使用 `pip install -r scripts/requirements.txt --break-system-packages` 进行安装。
### 扫描注册中心的热门技能
```
# 从 skills.sh 扫描前 25 个 skills(默认)
python scripts/scan-skills.py -n 25
# 从 clawhub.ai 扫描前 10 个
python scripts/scan-skills.py --source clawhub -n 10
# 扫描第 11-25 个 skills(分页)
python scripts/scan-skills.py -n 15 --offset 10
# 启用 LLM 语义分析(需要 SKILL_SCANNER_LLM_API_KEY)
python scripts/scan-skills.py -n 25 --use-llm
# 启用 LLM + 元分析以进行误报过滤
python scripts/scan-skills.py -n 25 --use-llm --enable-meta
```
### 扫描特定仓库
```
# 扫描单个 GitHub repo
python scripts/scan-skills.py --repo owner/repo --repo-only
# 将一个 repo 与热门 skills 一同扫描
python scripts/scan-skills.py -n 10 --repo owner/repo
```
### 其他选项
```
# 列出 skills 而不进行扫描
python scripts/scan-skills.py --list-only -n 25
# 从现有结果生成报告(跳过获取 + 扫描)
python scripts/scan-skills.py --skip-scan -o results
# 自定义报告名称
python scripts/scan-skills.py -n 25 --report-name top-25
# Verbose 日志记录
python scripts/scan-skills.py -n 10 -v
```
运行 `python scripts/scan-skills.py --help` 以获取完整的选项列表。
### 运行测试
```
python -m pytest tests/ -v
```
## 项目结构
```
scripts/
scan-skills.py # Main orchestrator and CLI
fetch_skills.py # API fetching from skills.sh and clawhub.ai
run_scans.py # Clone, download, and scan logic
generate_report.py # Aggregate results into markdown/JSON reports
pipeline_utils.py # Shared utilities: logging, HTTP session management
requirements.txt # Dependencies
tests/ # 77 tests across 4 modules
conftest.py # Shared fixtures
test_run_scans.py # Clone, download, scan, ZIP security tests
test_generate_report.py # Report aggregation tests
test_fetch_skills.py # API fetching tests
test_pipeline_utils.py # Session management and retry tests
results/
summary-report.md # Consolidated findings across all skills
-scan.json # Raw scan output per skill
-scan.md # Readable scan report per skill
```
克隆的技能仓库保存在本地的 `skills/` 目录中,但通过 `.gitignore` 被排除在版本控制之外。
## 已知局限性
- 无运行时验证——分析仅限于静态和语义层面
- LLM 和元分析需要 API 密钥(`SKILL_SCANNER_LLM_API_KEY`);如果没有密钥,扫描将仅回退到静态/行为/触发分析
- 仅限于拥有公共源代码仓库的技能
- 扫描器覆盖范围取决于底层工具的规则集
## 链接
- [skillscan.io](https://skillscan.io/) -- 扫描结果交互式仪表板
- [Cisco AI Defense skill-scanner](https://github.com/cisco-ai-defense/skill-scanner)
- [skills.sh](https://skills.sh/)
- [clawhub.ai](https://clawhub.ai/)
- [Agent Skills in the Wild: An Empirical Study of Security Vulnerabilities at Scale](https://arxiv.org/abs/2601.10338) -- 针对来自 skills.rest 和 skillsmp.com 的 31k+ 个技能的大规模安全分析
## 许可证
MIT
标签:AI Defense, AI安全, Chat Copilot, CI/CD安全, CISA项目, Command Injection, Data Exfiltration, ESC8, Llama, LLM Security, Python, Social Engineering, Supply Chain Security, Transitive Trust Abuse, Unauthorized Tool Use, 云安全监控, 人工智能, 传递信任滥用, 命令注入, 大模型安全, 安全扫描, 安全管道, 安全规则引擎, 插件安全, 文档安全, 无后门, 时序注入, 用户模式Hook绕过, 社会工程学, 网络安全研究, 越权工具使用, 静态分析