Introduction¶
In the development machines of the multi-agent era, credentials are scattered across ~/.gitconfig, agent configurations, .git/config, and various .env files. Once the git url.*.insteadof or pushurl embeds a token (e.g., https://oauth2:<token>@gitlab.example.com/...), every git remote -v will print the secret into logs, chats, or CI pipelines.
The previous approach involved manually checking file permissions one by one and grepping remote configurations, which is time-consuming and prone to omissions. dsh-fleet-audit turns this into a single command in DSH: one-click read-only audit with fully masked output. DSH’s philosophy is “everything is a plugin,” and this kind of security baseline checkup fits perfectly as a mounted plugin. Below is an introduction to the positioning, features, installation, and usage of this plugin.
What is it¶
dsh-fleet-audit is a DSH agent fleet health audit plugin maintained by LeslieWylie, currently at version 0.0.1, and licensed under the MIT License. It performs only three tasks: checking credential file permissions, scanning for embedded credentials in git remotes, and identifying common provider token literal prefixes. The entire plugin is read-only, has zero dependencies, and is deterministic; it reports issues without modifying any files.
Core Features¶
Credential File Permission Checks¶
Checks permissions for common credential files such as ~/.gitconfig, ~/.netrc, ~/.npmrc, ~/.env, ~/.ssh/, etc. These files should be tightened to 600/700. If the group or other users have read access, they are marked as tooOpen.
Embedded Credential Scanning in Git Remote¶
Scans ~/.gitconfig and .git/config in given directories to identify embedded credentials like https://user:pass@host, https://oauth2:TOKEN@host, or token-based usernames. The credential portion in URLs in the output is masked with ***, ensuring no plaintext is leaked on a per-byte basis.
Provider Token Literal Prefix Scanning¶
Performs literal scanning based on common prefixes such as github / github-fine-grained / gitlab / gitlab-ci / slack / aws / openai / jwt, reporting only “Type × Count” without outputting the content itself. This check can be disabled via the scanSecrets parameter.
Security Boundaries¶
- Read-only: No file writing, no process spawning, no network access, no state saving.
- Masked: All suspected credentials are masked, and tests assert that the output JSON does not contain raw keys.
- Bounded: Limits are set for the number of git configs (default 200, max 2000) and recursion depth (default 5, max 20) to prevent the scan from getting out of control.
Installation and Enablement¶
Plugins are installed to a specified profile via the dsh plugin command:
dsh plugin --profile web add github:LeslieWylie/dsh-fleet-audit
For local verification, you can point directly to a local path:
dsh plugin --profile web add /path/to/dsh-fleet-audit
The runtime requires Node ^22.19.0 || >=24.0.0, with peer dependencies being @deepseek-ai/cordis ^4.0.1 and @deepseek-ai/dsh-tools ^0.1.0-rc.6. After installation, restart dsh web and simply say “audit my local credentials health” or “run fleet_audit” to execute.
Typical Usage¶
The audit is performed via a tool call with the following parameters:
| Parameter | Type | Description |
|---|---|---|
roots |
string[] | Directories to recursively scan .git/config in (optional; defaults to only checking ~/.gitconfig) |
files |
string[] | Absolute paths of additional credential files to check permissions for |
scanSecrets |
boolean | Whether to scan token literal prefixes (default true) |
maxGitConfigs |
number | Upper limit for git config scanning (default 200, max 2000) |
maxDepth |
number | Directory recursion depth (default 5, max 20) |
The output is a sanitized JSON report containing a summary of permission issues, git leaks, and token occurrences:
{
"ok": true,
"summary": { "files": 5, "tooOpen": 1, "gitLeaks": 2, "secretFiles": 1, "issues": 4, "scannedGitConfigs": 12 },
"checks": {
"credentialFiles": [
{ "path": "/Users/alice/.gitconfig", "exists": true, "mode": "644", "tooOpen": true }
],
"gitRemoteLeaks": [
{ "file": "/Users/alice/code/proj/.git/config", "host": "gitlab.example.com", "maskedUrl": "https://***:***@gitlab.example.com/group/proj.git" }
],
"secrets": [
{ "file": "/Users/alice/.gitconfig", "providers": [ { "provider": "github", "count": 1 } ] }
]
},
"note": "Read-only audit; secret-like values are masked in the output. Fix permissions with chmod 600 and rotate any exposed credentials."
}
Use Cases and Notes¶
This plugin is suitable for performing regular health checks in development machines shared by multiple agents, CI containers, or long-running agent environments: to confirm that credential file permissions are not too loose, that no tokens are embedded in remote configurations, and that no scattered key prefixes are found in code or configurations.
Clarify its boundaries before use:
- Scans only text-based configuration files; does not parse encrypted storage, system keychains, or binary files.
- Token prefix recognition is based on heuristic rules; it may miss reports (non-standard prefixes) or produce false positives (requires manual review).
- By default, it only checks a fixed list of credential files; arbitrary paths must be explicitly specified via
roots/files. - The plugin does not actively modify any files. If leaks are found, you must manually run
chmod 600and rotate the credentials. - The plugin runs with the permissions of the current dsh process; it is recommended to check the source code and license before installing.
To uninstall, execute:
dsh plugin --profile <p> remove dsh-fleet-audit
Or remove the corresponding line from dsh.profile.bundles. The plugin is read-only and stateless; uninstalling does not affect any user data.
One final note: This is an independent community plugin with no affiliation to DeepSeek official or its DSH repository; the dsh-plugin topic is added when published to the repository for discoverability.
Summary¶
dsh-fleet-audit turns the three easily overlooked matters—whether credential permissions are tightened, whether tokens are embedded in remotes, and whether there are exposed key prefixes—into a single command using a read-only, zero-dependency, output-masked plugin. Install it, run it, and then manually tighten permissions and rotate keys based on the report for a complete health audit.