
jkrandom-sudo/dsh-plugin-audit
40最近提交 2026年8月14日
dsh-plugin-audit DSH 插件
dsh-plugin-audit 是一个 DSH 插件,提供对第三方插件的静态审计和运行时哨兵功能。静态扫描器生成权限配置文件卡,显示插件访问的文件、进程、主机和凭据。哨兵监视 DSH 的 pre-execute 瀑布,当工具调用访问凭据路径或向未知主机发送数据时,向用户请求批准。
如何安装 dsh-plugin-audit DSH 插件
dsh plugin --profile web add dsh-plugin-audit复制不会执行命令。安装 dsh-plugin-audit DSH 插件前请核对仓库和版本。
dsh-plugin-audit DSH 插件数据来源
dsh-plugin-audit DSH 插件快照日期:2026年8月16日
discovered
dsh-plugin-audit DSH 插件能做什么
- 对任意插件目录进行静态审计,扫描源代码、package.json 和 cordis.patch.yml,生成包含风险等级和发现的权限配置文件卡。
- 运行时哨兵监听 tools/pre-execute 瀑布,对凭据访问、向未知主机的 shell 出口或写入 home 目录点文件返回“ask”裁决。
- 通过合约保证只读;每个审计报告包含 writesPerformed: false,并提供可选的 invariant 伴生组件强制执行。
- 可配置的 allowedHosts 列表用于 shell 出口,支持精确匹配和通配符后缀规则。
- 无网络调用或遥测;报告中的主机均从源代码文本中提取,从不实际连接。
- 支持 Markdown 和 JSON 两种输出格式。
dsh-plugin-audit DSH 插件适合哪些场景
- 在安装第三方插件前审计其权限,了解其访问的资源。
- 监控运行中的工具调用,防止意外凭据泄露或数据外传。
- 审查自己的插件开发,检查是否有不必要的权限使用。
- 通过要求对未批准主机的出口进行批准来强制执行安全策略。
- 使用 JSON 审计输出集成到 CI 检查等自动化工作流中。
dsh-plugin-audit DSH 插件适合谁
- 安装第三方插件并希望评估其安全状况的 DSH 用户。
- 需要了解代码权限配置的插件开发者。
- 管理多个插件的 DSH 环境的安全管理员。
dsh-plugin-audit DSH 插件的限制
- 扫描器基于源代码文本而非 AST,字符串和注释可能触发误报。
- 不跟踪符号链接;扫描上限为 400 个文件 / 每个文件 256 KB,并跳过 node_modules、.git、lib 和 dist。
- 哨兵仅适用于提供 tools/pre-execute 瀑布的 DSH 配置文件;需要特定的 DSH 主分支快照(2026-08-14)和 Node.js ^22.19.0 || >=24.0.0。
- 该插件是审计辅助工具,而非杀毒软件;干净的报告意味着“未发现证据”,而非“安全”。
- 仅包含构建输出(dist/lib)的包始终至少得到 NOTICE 等级,因为无可扫描内容。
dsh-plugin-audit DSH 插件的仓库 README 摘录
以下文字摘自 dsh-plugin-audit DSH 插件的上游仓库 jkrandom-sudo/dsh-plugin-audit 的 README,版权归原作者,仅作引用。
**Know what a DSH plugin can do before you let it run.** `dsh-plugin-audit` profiles third-party plugins statically — which files, processes, hosts, env vars and credential paths their code touches, with file/line evidence — and arms a runtime sentinel that asks for your approval when any tool call reaches for credentials or moves data to unknown hosts. ## What it does **1. Static audit — the `plugin_audit` tool.** Point it at any plugin directory; it scans the source, `package.json` and `cordis.patch.yml`, then returns a permission profile card: ```markdown ## Plugin audit: fixture-suspicious-plugin **Risk: REVIEW** — REVIEW — human review recommended before installing > 1 files scanned; risk=review; 10 findings (4 review, 4 notice, 2 info) ### Permission profile | Surface | Observed | |---|---| | Filesystem read | **yes** | | Filesystem write | **yes** | | Child processes | **yes** | | Network | **yes** | | Outbound hosts | `evil.example.com`, `exfil.badhost.io`, `telemetry.example.net` | | Env variables | `GITHUB_TOKEN`, `HOME` | | Credential-looking env | `GITHUB_TOKEN` | | Credential paths | `.npmrc`, `.ssh` | | Dynamic code execution | **yes** | | Injected services | `
阅读完整 README仓库许可: MIT
dsh-plugin-audit DSH 插件常见问题
如何安装 dsh-plugin-audit?
在 DSH 环境中运行 `dsh plugin --profile web add dsh-plugin-audit`。该命令会注册包并应用包含哨兵的 cordis.patch.yml 配置。安装完成后,重启配置文件以激活插件。
如何使用这个工具审计一个插件?
你可以让 agent 执行“Audit the plugin at <路径>”,或者直接调用 plugin_audit 工具,传入 JSON 对象如 `{ "path": "/绝对路径/到/插件", "format": "markdown" }`。工具会返回一个 Markdown 权限配置文件卡和一个包含风险等级、文件数和发现项的 JSON 摘要。
运行时哨兵做了什么?
哨兵挂接到 DSH 的 `tools/pre-execute` 瀑布。当工具调用即将执行时,它根据风险规则进行检查:凭据路径访问、向未知主机的 shell 出口、或写入 home 目录点文件。如果匹配,则返回“ask”裁决,触发主机的批准提示。如果没有批准通道,则调用被静默拒绝。
如何配置哨兵的 allowedHosts?
编辑配置文件 `cordis.patch.yml` 中插件的 `config` 部分,添加 `allowedHosts` 列表,例如 `github.com` 或 `*.deepseek.com`。哨兵会自动允许向这些主机的 shell 出口,无需确认。
如何卸载 dsh-plugin-audit?
运行 `dsh plugin --profile web remove dsh-plugin-audit`。该命令会从配置文件的 package.json 中移除依赖并删除 bundle 行。之后重启配置文件。插件不会在配置文件自身的依赖元数据之外写入任何持久数据,因此无需额外清理。