Introduction¶
DeepSeek Harness (DSH) is a plugin-centric ecosystem. In the secure development lifecycle, passively waiting for alerts is often lagging and insufficient for grasping system status in real-time. Dolphin transforms penetration testing methodologies (information gathering, vulnerability detection, exploitation verification, reporting) into a proactive defense patrol process, filling the gap of “proactive defense patrol” within the DSH ecosystem. Just like a dolphin cruising, it periodically and proactively performs security scanning and assessments on target hosts.
Core Capabilities¶
Dolphin mainly provides the following capabilities:
- Semgrep-based Scanning: Utilizes a static analysis engine for rule matching.
- SSH-based Remote Patrol: Distributes scanning commands to remote hosts via SSH for execution, retrieves results, and archives them locally.
- Structured Report Generation: Outputs a unified SecurityFinding data model, archived as a JSON report.
- Cross-platform Support: Supports Windows / Linux / macOS / WSL2.
- Isolated Deployment: Automatically deploys semgrep in isolation on the target side to avoid polluting the production environment (supports pipx / venv / portable packages).
- Zero Hardcoded Paths: All data paths are derived from the runtime API, compatible with both Windows and POSIX paths.
- Pure JS SSH Layer: Based on ssh2, allowing any combination of control and target operating systems.
- Automatic Health Check: Automatically probes the remote environment before patrolling.
- Remote Command POSIX Validation: Performs syntax validation before dispatching commands to prevent injection.
Installation and Dependencies¶
This plugin is maintained by ccr-wer and is released under the MIT license.
- Install the Plugin
Install via the npm registry:
npm install dsh-dolphin-security
-
Environment Requirements
- Node.js >= 20
- npm package manager
-
Prerequisites
Dolphin depends on semgrep (LGPL-2.1). You must install semgrep first and ensure it is callable directly from the command line:
pip install semgrep
After installation, verify via `semgrep --version`.
Usage¶
Dolphin can run as a plugin within the DSH host or as a standalone CLI script.
Local Scan
Perform a static scan on a specified directory:
node dolphin-patrol.js --local <directory>
# Example
node dolphin-patrol.js --local D:/your-project/src
Remote Patrol
Perform inspections on remote hosts via SSH. You need to define the target host information first (usually referring to the test-ssh-hosts.js template), then execute:
node dolphin-patrol.js --patrol <alias> <remote_directory>
# Example
node dolphin-patrol.js --patrol server01 /srv/app
If semgrep is not installed on the remote side, the plugin will automatically deploy it in an isolated environment (e.g., ~/.local/share/pipx or /tmp) to execute the scan.
Self-test and Debugging
# Run self-check
node dolphin-patrol.js
# Simulated data self-test
node dolphin-core.js --mock [directory]
# SSH engine self-check
node dolphin-ssh-core.js
# Test host library and health check
node test-ssh-hosts.js
# Start local ssh2 server to verify the full closed loop
node test-ssh-hosts.js --live
Technical Details and Architecture¶
- Architecture: Adopts a three-layer architecture of “Eyes (Scanning Layer), Hands (Execution Layer), Brain (Fusion Controller)”.
dolphin-core.jshandles scanning encapsulation,dolphin-ssh-core.jshandles SSH/SFTP capabilities, anddolphin-patrol.jsmanages command dispatch and result aggregation. - Secure Deployment: Remote tool deployment uses isolation techniques (pipx / venv / portable packages). Use of
sudoor writing to system site-packages is strictly prohibited. Remote commands undergo strict POSIX syntax validation. - Cross-platform: The SSH layer is implemented in pure JS, supporting any combination of control and target operating systems.
Precautions¶
- Disclaimer: This project is strictly prohibited for illegal penetration testing. It is intended only for systems and code for which you possess legal ownership or have obtained explicit written authorization. Using this tool to initiate scans against third-party systems may violate relevant laws and regulations.
- Permission Requirements: semgrep must be installed and added to the PATH beforehand.
- Installation Method: Please ensure you install via
npm install. Do not manually copy directories to avoid missing runtime files.
Resources¶
- Official Directory: https://www.skillhub.cn/plugins/ccr-wer/dsh-dolphin-security
- Source Repository: https://github.com/ccr-wer/dsh-dolphin-security