DeepSHPlugins
dsh-plugin-gate 项目预览
GITHUB / COMMUNITY PROJECT

dsh-plugin-gate

安全与运维JavaScriptMIT

DSH 插件的安装安全闸门:在 "dsh plugin add" 前对本地目录或 npm 包做"杀毒"式扫描(安装脚本、权限、密钥、网络回连),给出 BLOCK/WARN/PASS 判定。

1 Stars863683348 更新时间 2026-08-18
访问 GitHub 仓库
dsh-plugin-gate 项目预览

项目介绍

中文

DSH 插件的安装安全闸门:在 "dsh plugin add" 前对本地目录或 npm 包做"杀毒"式扫描(安装脚本、权限、密钥、网络回连),给出 BLOCK/WARN/PASS 判定。

English

Installation safety gate for DSH plugins: antivirus-style scan of install scripts, permissions, secrets and network callbacks on local directories or npm tarballs, returning a BLOCK/WARN/PASS verdict before "dsh plugin add".

项目信息与收录信号

快照 2026-09-11
作者 / 组织
863683348
仓库
863683348/dsh-plugin-gate
GitHub Stars
1
Forks
1
开发语言
JavaScript
许可证
MIT
最近推送
2026-08-18
Manifest
数据中检测到声明

公开仓库不自动等于可商用;许可证与当前兼容性以原项目文档为准。Manifest 和数据评分不构成安装安全认证。

数据评分

62/ 100
维护活跃
84
文档与实用信息
100
生态关注度
24
安装便捷信号
80
项目声明信号
100

README 含完整安装与使用说明;关注度尚低(1)。

评分来自已有数据快照的五维模型,仅作浏览参考,不是实际使用评测或安全检测结论。

安装与使用

所有项目资料与许可均以对应 GitHub 仓库为准。

dsh plugin --profile web add github:863683348/dsh-plugin-gate

复制命令不会自动执行。请先阅读仓库文档,确认环境要求与许可证。

项目截图

仓库 README

GitHub 原文

已保存的仓库文档快照;文档抓取时间未记录,可能与上方目录介绍处于不同版本。安装前请核对当前仓库说明。

dsh-plugin-gate

Installation safety gate & data-protection guard for DeepSeek Harness — 60 static signature rules (31 high / 24 medium / 5 low) scan plugin sources for malicious install scripts, credential theft, obfuscation and network callbacks before you run dsh plugin add, and 12 destructive-command patterns plus workspace-boundary checks stop rm -rf-class accidents before they happen.

The plugin marketplace is growing fast (thousands of entries), and malicious code mixed into a plugin is only a matter of time. dsh-plugin-gate gives the agent a gate_scan tool that inspects a plugin source — a local directory or an npm tarball — for the classic malware shapes:

DomainWhat it checks
Scriptsnpm lifecycle scripts (pre/install/postinstall), exec/spawn/shell:true, curlsh, encoded PowerShell, cmd/WSH launch, dynamic require
Obfuscationeval / new Function / vm.runIn*, hex-escape floods, base64 blobs, char-array packing
Permissionscredential env reads (OPENAI_API_KEY etc.), ssh/aws/npmrc file reads, writes to system/home/dotfile paths, chmod 777, sandbox-escalation requests
Networkexternal URLs & hosts, fetch/axios/socket/WebSocket/DNS APIs, cloud-metadata endpoints (169.254.169.254), Discord/Telegram/Slack webhooks, .onion, read-then-send exfiltration shape
Secretshardcoded sk- keys, ghp_ tokens, AWS keys, private key blocks, bearer tokens
Supply chainexact-version direct dependencies checked against Google OSV (ranges and official @deepseek-ai packages skipped; configurable, offline-degrades)

The gate is read-only: it never executes scanned code and never writes files.

Install

In your DSH profile:

dsh plugin --profile <profile> add dsh-plugin-gate
# or add the bundle patch manually:
#   dsh --profile <profile> --patch ./node_modules/dsh-plugin-gate/cordis.patch.yml

Usage

Ask the agent to scan a plugin before installing it (the plugin also injects prompt guidance that tells the agent to do this automatically):

gate_scan target: "npm:dsh-plugin-some-package"
gate_scan target: "npm:[email protected]"   # pinned version
gate_scan target: "./downloaded-plugin"                 # local directory

v1.1 - Data-protection guard

Before any destructive operation, ask the agent to evaluate it with gate_guard (also injected into prompt guidance):

gate_guard command: "rm -rf ./node_modules" gate_guard path: ".dsh-memory-setup/memory.json" action: "delete"

  • BLOCK - device/root-level destruction (rm -rf /, rmdir /s /q, format, dd to a block device, mkfs, drive-root deletes): refuse.
  • WARN - recursive/force deletes, targets outside the workspace, or critical files (memory.json, .git, ...): confirm the exact target first.
  • PASS - no destructive signature detected.

Result shape:

{
  "verdict": "BLOCK" | "WARN" | "PASS",
  "score": 254,
  "summary": { "high": 0, "medium": 1, "low": 3, "categories": { "network": 4 } },
  "network": { "hosts": [...], "unallowlisted": [...], "readAndSendFiles": [...] },
  "hits": [{ "rule": "fetch_call", "category": "network", "severity": "medium",
             "file": "lib/index.js", "line": 12, "evidence": "...", "hint": "..." }],
  "recommendations": [...]
}

Verdict semantics

  • BLOCK — at least one high-severity signature. Do not install until the maintainer ships a clean rebuild you can scan again.
  • WARN — medium-severity patterns that need manual review (network I/O, home-path writes, base64 blobs). Inspect every hit in context.
  • PASS — no risky signatures. Heuristic only — keep normal caution with unknown maintainers.

Context-aware rules: exec()/execSync() hits are downgraded when the file does not import child_process (typical RegExp#exec false positive); code-context rules (exec, eval, curl|sh, PowerShell…) are downgraded to low when found in comments or documentation (examples, not behavior) — while secrets and webhooks stay flagged even in comments. Dependencies installed from git/http/file URLs are flagged as risky_dependency, and >4000-char minified lines as minified_line (low).

Configuration

KeyDefaultMeaning
maxFiles1000hard cap on scanned files per directory walk
maxFileBytes2 MiBper-file text cap
includeNodeModulesfalsedescend into node_modules
maxTarballBytes32 MiBnpm tarball download cap
allowlistHosts[]hosts never listed as unallowlisted
osvChecktruequery Google OSV for known vulnerabilities on exact-version deps
osvMaxDeps8max exact-version direct deps checked
osvTimeoutMs10000per-dep OSV query timeout
promptSectiontrueinject agent guidance
sectionOrder5prompt section order

Development

node --check lib/*.js
node test/rules.test.mjs   # main-module mode (node --test is blocked in the DSH sandbox)
node test/scan.test.mjs

Pure logic lives in lib/rules.js (signatures), lib/targz.js (in-memory tar.gz), lib/scan.js (orchestration + verdict). The Cordis plugin is lib/index.js.

Security

The gate never executes scanned content. It is a heuristic signature scanner — it can miss novel malware and over-flag innocent code. Review BLOCK/WARN hits yourself; see SECURITY.md.

License

MIT

使用前核对

安装步骤、兼容版本与授权范围以原项目当前文档为准。Stars 和评分是快照中的导航信号。

安装与排错 · 项目问题反馈

同类项目