tancheng33/dsh-egress-guard ↗★ 0
dsh-egress-guard
Runtime security gate for DeepSeek Harness: egress host allowlist, secret redaction in tool results, and an append-only audit log
安装
npx -p @deepseek-ai/dsh dsh plugin --profile web add github:tancheng33/dsh-egress-guard说明文档
阅读完整 README ↗dsh-egress-guard
English | 中文
给 DeepSeek Harness 工具调用加的运行时安全网关。
生态里已有的安全插件都是在 agent 跑起来之前静态扫描配置文件。这个插件挂在工具执行管线上,作用于调用本身:
| 规则 | 扩展点 | 作用 |
|---|---|---|
| 出站白名单 | tools/pre-execute | 调用里出现白名单之外的网络目的地时拒绝(或转审批)——curl 到某个 paste 站、git push 到陌生远端、fetch 到外传端点。 |
| 密钥脱敏 | tools/post-execute | 在模型、持久化会话日志、Code Mode 程序读到之前,把工具结果里的凭据改写掉。 |
| 审计日志 | 两条瀑布 | 每个决策都追加成一行 JSONL,包括 monitor 模式下"本来会拦"的那些。 |
不 fork、不改 loop:三个监听器挂在文档化的扩展点上,卸载时干净释放。
安装
dsh plugin --profile add dsh-egress-guard
bundle 默认是 mode: monitor,所以装上它不会弄坏你现有的配置:所有规则照常评估、照常写审计日志,但不拦截、不改写。先看一天日志,再去 profile 的 cordis.patch.yml 里打开强制:
- id: egress-guard
config:
mode: enforce
egress:
enabled: true
allowHosts: ['*.github.com', '*.npmjs.org', 'api.deepseek.com']
denyHosts: []
allowLoopback: true
onViolation: deny
redact:
enabled: true
builtins: true
extraPatterns: []
placeholder: '[redacted:{name}]'
audit:
enabled: true
path: ''
logAllowed: false
注意 patch 替换的是整个 config,不是深合并——你想保留的键都要重写一遍。
配置项
| 键 | 默认值 | 含义 |
|---|---|---|
mode | monitor | off 什么都不注册;monitor 只评估只记录;enforce 真拦真改。 |
egress.allowHosts | schema 里为 [],bundle 里给了一份起步清单 | 放行的主机。*.example.com 同时覆盖主域名和所有子域名。留空表示只用黑名单。 |
egress.denyHosts | [] | 始终拒绝,优先级高于 allowHosts 和 allowLoopback。 |