BotonJ/dsh-plugin-sentinel ↗★ 0
dsh-plugin-sentinel
DSH 插件安检机 — install-time static security auditor for DeepSeek Harness plugin bundles. Zero dependencies, zero install scripts, zero build step.
安装
$
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:BotonJ/dsh-plugin-sentinel说明文档
阅读完整 README ↗dsh-plugin-sentinel 🔒
DSH 插件安检机 — 给 DeepSeek Harness 装一台插件安检机:在安装任何社区插件之前做纯静态安全审计,输出按严重度排序的结构化风险报告。
官方文档对 GitHub 安装方式的警告原话:
prepare脚本授权是 "permission to execute the package's code on your machine at install time, outside any sandbox the agent runs under"。DSH 生态 24 小时收录 288+ 社区插件——这台安检机就是为了让"先过安检再安装"成为一句话的事。
安装
dsh plugin --profile add github:/dsh-plugin-sentinel
# 或本地安装
dsh plugin --profile add ./dsh-plugin-sentinel
装好后对 DSH 说:
- 「帮我装 github:xxx/yyy 这个插件」→ 模型会先调
audit_plugin过安检,block则拒绝安装并说明风险 - 「巡检我当前 profile 装过的插件安不安全」→
audit_installed
提供的工具
| 工具 | 用途 |
|---|---|
audit_plugin | 审计一个插件目录或 .tgz 压缩包:安装期脚本、动态执行、凭据读取、网络外传、patch 层 !!js 表达式、静默禁用安全行、路径穿越、软链接… |
audit_installed | 巡检 profile 内全部社区 bundle(官方 @deepseek-ai/* 内置包标记 trusted 跳过) |
结论分级:pass(通过)/ review(需人工审查)/ block(建议拒绝)。风险分权重 critical=10 / high=5 / medium=2 / low=1。
安全设计:安检机自身的攻击面为零
| 决策 | 理由 |
|---|---|
| 零 npm 依赖、零安装脚本、零构建 | package.json 没有 scripts、没有 dependencies;从 GitHub 安装不需要 pnpm allowBuilds 授权,不存在安装期执行 |
| 原生 JSON-Schema ToolDefinition 注册(MCP 工具同款路径) | 全部源码只 import Node 内置模块,不依赖任何运行时包 |
纯 JS tar 解析(node:zlib + 手写 ustar/pax/GNU-longname) | .tgz 审计全程在内存完成,被审计的恶意代码不落盘;全程不用 child_process |
词法剥离扫描:先剥注释/字符串再匹配危险 API;模板 ${} 插值内的代码保留 | 字符串和注释里写着 eval( 不算证据(防误报);藏在插值里的代码跑不掉(防漏报) |
| 组合规则 | 读取 × 网络出站 = 凭据外传特征(critical);编码载荷 × 动态执行(critical);shell × 网络(critical) |