dsh-web
zhu1090093659/dsh-webDeepSeek Harness(DSH)Web 插件聚合生态包 · 一切皆插件,创意工坊分发(dsh-market.com)
DeepSeek Harness 的后台安全审计器:扫描 Agent 输出中的秘密泄漏,在执行前检查命令安全性,并将发现记录到持久化审计日志中。
🇬🇧 English • 🇷🇺 Русский • 🇨🇳 中文说明
|
⭐ If you like this plugin, please star it on GitHub — it shows me that the plugin is useful to you and motivates me to keep developing it.
🐛 If you find a bug or would like to request a feature, open a GitHub issue in any language — I will review your proposal and implement useful suggestions in a future plugin version. |
dsh-shadow-auditor provides real-time, non-intrusive background security auditing and command safety protection for DeepSeek Harness agents.
When autonomous agents write code, stage files, or run shell scripts, there is a constant risk of accidental API key/secret leakage into git diffs or unintentional execution of destructive terminal commands (rm -rf /, dangerous database wipes, credential exports).
dsh-shadow-auditor operates as an in-process security firewall, scanning code diffs for private tokens and verifying terminal commands before execution.
graph LR
subgraph AgentExecution [DSH Agent Runtime Actions]
Agent[🤖 Agent: Writes Code / Prepares Command] --> Intercept{Security Interceptor Hook}
end
subgraph SecurityEngines [dsh-shadow-auditor Engine]
Intercept --> SecretScan[🔑 Secret & Token Scanner: High-Entropy & Key Patterns]
Intercept --> CmdGuard[🛡️ Command Safety Firewall: Destructive Shell Blocker]
end
subgraph Enforcement [Action & Telemetry Pipeline]
SecretScan -->|Clean| Pass[✅ Proceed Execution]
SecretScan -->|Secret Detected| Block1[⛔ Block & Redact Token Payload]
CmdGuard -->|Safe| Pass
CmdGuard -->|Destructive Hazard| Block2[⛔ Block & Raise User Confirmation]
Block1 --> AuditLog[📋 Security Audit Telemetry & Dashboard]
Block2 --> AuditLog
end
style AgentExecution fill:#1e1e2e,stroke:#89b4fa,stroke-width:2px,color:#cdd6f4
style SecurityEngines fill:#181825,stroke:#cba6f7,stroke-width:2px,color:#cdd6f4
style Enforcement fill:#11111b,stroke:#a6e3a1,stroke-width:2px,color:#cdd6f4
lib/guards/secrets.js)lib/guards/command.js)rm -rf, disk wipes, fork bombs, destructive dd, accidental recursive permission overwrites);~/.dsh, ~/.claude, ~/.ssh, /etc, /usr, Windows system folders);-WhatIf, -Confirm, --dry-run, git clean -n), permitting safe inspection without false-positive blocks;lib/client.js)lib/guards/lifecycle-hooks.js)prepend: true) (#125): Guarantees execution at the head of the Cordis handler pipeline before third-party extension handlers execute;secretBlockCritical) (#124): High-severity destructive commands (root wipe, disk formatting, AWS/private key exfiltration) are strictly blocked even in audit_only or warning mode;ask) (#108): Seamlessly integrates with DSH approval mechanism in tools/pre-execute returning { kind: 'ask', reason, displayReason } on suspicious operations;agent/pre-step) (#110): Scans incoming user messages before model ingestion, rejecting jailbreak and prompt-injection payloads early ({ kind: 'reject' });tools/post-execute) (#111): Intercepts tool outputs and masks exposed credentials and high-entropy secrets before model context ingestion.| Tool Name | Parameters | Description |
|---|---|---|
shadow_auditor_scan_diff | diff: string | Scans a unified diff or code chunk for exposed API keys, credentials, and private tokens |
shadow_auditor_check_command | command: string | Evaluates shell commands against destructive execution patterns and safety policies |
shadow_auditor_rules_list | (none) | Returns currently active security rules, patterns, and enforcement modes |
dsh plugin --profile web add @goodandready/dsh-shadow-auditor
settings.yaml)dsh-shadow-auditor:
strictSecretScanning: true # Block execution if API keys or tokens are detected in diffs
blockDangerousCommands: true # Block destructive shell commands automatically
secretBlockCritical: true # Unconditionally block critical threats bypassing soft audit modes
enableReversibleMasking: true # Reversibly replace detected PII and secrets with <TYPE_N> placeholders
shellGuardMode: 'enforce' # Policy for command guard: enforce (block), audit_only (log), ask (interactive user prompt)
diffGateMode: 'warning' # Diff gate mode: disabled, warning, or block
enableAuditBadge: true # Display security shield badge in UI and approval dialogs
enableAuditLog: true # Record persistent JSONL audit logs with rotation under DSH_HOME
When enableReversibleMasking is active (default: true), incoming prompts at agent/pre-step are inspected. Detected secrets, API keys, private keys, emails, IPv4 addresses, and phone numbers are replaced with monotonic placeholders (<KEY_1>, <EMAIL_1>, <IP_1>).
<KEY_10> before <KEY_1>), preventing substring corruption./shadow-auditor restore <masked-text>
en) and Chinese (zh); Russian localization managed via goodandready/dsh-russian-lang.AGENTS.md, index.md) purged; strict $\le 256$ KiB file limit..env, settings.yaml, and credential anchors.dsh-clinebot): Redesigned client settings card into four structured section cards using native DSH design tokens (--dsw-alias-*), clean responsive grids, status badges, and styled form controls.diffGateMode, enableSastScan, and enablePromptInjectionScan.test/ui-and-stability-028.test.mjs (26 test suites passing).secret-write guard strictly targets actual secret and credential stores (.env, .credentials, SSH keys) without falsely matching developer scripts such as check_token.js or test suites test_secret.py.eval examples no longer trigger code security alerts. Safe relative path traversal via import.meta.url and __dirname is permitted.--all).AuditShieldChip is paused when document is hidden.enableAuditLog, maxFileSizeMb, retentionDays) with English and Russian localization (#34).setTimeout delayed fallback to settings.section; settings card registers cleanly and atomically into settings.plugin.item (#35).unavailable, form inputs and the save button are disabled (disabled: true) and a warning notice is displayed (#32).@deepseek-ai/dsh-credentials from peerDependencies in package.json (#33).data-dsh-plugin="dsh-shadow-auditor" to <style> tag to prevent style purging by adjacent plugins.docs/design/DESIGN.md establishing the design specifications for all plugin surfaces.K=$(grep KEY ~/.dsh/.credentials.yaml) && curl ... -H "Authorization: Bearer $K").-d @.env, -F file=@..., --post-file=...), direct file piping (cat .env | curl/nc), input redirection (< .env), and remote file copies (scp/rsync)./audit: Generates a detailed Operation Bill directly in the DSH chat with tool call counts, risk scoring (0–100), suspicious activity tables, and intercepted commands. Flags: --turn (last turn only), --all (all sessions), --json, --since=YYYY-MM-DD, --limit=N (defaults to 50).AuditRecorder): Records audit events to <DSH_HOME>/shadow-auditor/<yyyy-mm>.jsonl with serialized Promise write queue (no concurrency interleaving), automatic .gz compression above 50 MB, and 30-day retention pruning.tools/result to capture actual execution outcomes (result.isError), sanitized error messages, and turn boundaries via session/event (turn/end).curl, wget, scp, ssh, nc, socat) attempting to transmit credential files (.env, id_rsa, .git-credentials, etc.).> and >> pointing outside the workspace (e.g. /etc/, ~/.bashrc, %USERPROFILE%, cron).git push --force: Blocks --force targeting protected branches (main, master, prod) and protected remotes while preserving full rebasing freedom for local feature branches.redactText / redactValue module iteratively sanitizes deeply nested structures from tokens, passwords, and .env assignments until stable.lib/diff-gate/): Multi-category scanner analyzing file diffs and modifications on approval boundaries.SEC-*, SAST-*, PI-*), severity, category, evidence range, explanation, and suggestion-only remediations.disabled, warning, block): Configurable via Web UI settings card; block mode stops critical/high vulnerabilities from executing.// shadow-audit-ignore: <ruleId> comments to bypass false positives without disabling global rules.conversation.session.header.utilities): Injected real-time AuditShieldChip showing session security status and quick audit popup.readRecent(limit) to stream and cap reading of recent records without unpacking historical compressed .gz archives.--limit=N: /audit defaults to the last 50 records tail with configurable --limit=N.session/destroy and capped with LRU eviction.grep -i kill and systemctl status while strictly blocking destructive operations.shadow_auditor_rules_list tool to minimize model prompt pollution.settings.plugin.item): Plugin card registration now uses ctx.slots.inject, eliminating loader crashes caused by registering before the host entry declares the slot (slot is not declared).settings.section): Added automatic fallback to a standalone settings section managed with a timer and disposed via ctx.effect if settings.plugin.item is unavailable.findDangerous): Chained command expressions (&&, ||, ;, newline continuations) are segmented and verified, preventing firewall bypasses via allowlisted prefixes (systemctl status && rm -rf /).scanSecrets): Eliminated false-positive allowlisting of real API tokens that happen to contain the word "example".maskSecret): Intercepted credentials and tokens are redacted (sk-pr...****...1234) before being sent via HTTP API or rendered in Web UI.ctx.effect for clean hot-reload teardown; fixed context scoping for approval/asked listener./audit polling to expanded state, and added unmount guards.Cache-Control: no-store header to the /dsh-shadow-auditor/audit endpoint.MIT © GooDAnDReaDY
This release fixes two command-guard false positives, preserves recursive-delete and protected-file write protection, and adds safe debug diagnostics for best-effort failures.
The command firewall allows rm -f when no recursive flag is present. It continues to block rm -r and rm -rf, including combined or split recursive flags. Protected-file write checks run separately for shell commands and pipeline stages, so a stderr redirect in one command cannot color a later read. Reading settings.yaml with grep, cat, or sed without in-place mode is allowed; writes through redirects, tee, or in-place edits remain blocked.
The analyzer respects quoted and escaped separators. These changes do not alter the network, SQL, service-control, protected Git, device-write, or workspace-escape rules. The guard uses bounded command analysis rather than a complete Bash AST.