Preface¶
When developing applications or orchestrating Agents in DSH (DeepSeek Harness), configurations are often scattered across Docker Compose files, IAM policy JSONs, OAuth applications, and CORS settings. While secret scanning and dependency auditing can identify “what is missing,” they rarely answer whether “the permissions granted are excessive relative to actual needs.” Excessive permissions typically trigger no warnings: services run normally until a vulnerability is exploited, revealing that a container has root access equivalent to the host, or that IAM wildcards have expanded the lateral movement surface.
Below is an introduction to the community plugin @deepwhale-cn/dsh-least-privilege (repository feely0208/dsh-least-privilege), maintained by feely0208 and categorized under admin-security. It performs least privilege checks at the code and configuration literal level, specifically targeting practices that are “obviously excessive” such as container root/privileged access, IAM wildcards, fully open CORS, and admin token applications.
What is this¶
In short: It performs static scanning on configuration files within the current workspace to flag high-risk and medium-risk patterns of excessive permissions.
It has a different role from the series’ dsh-data-scan: while the latter checks for sensitive data exposure, this plugin checks whether the permissions to access data are set too loosely. The npm package name is @deepwhale-cn/dsh-least-privilege, with version 0.1.1 in current materials, licensed under MIT; it requires Node.js >= 18 and DSH >= 0.1.0-rc.6.
What it checks¶
The README divides rules into two tiers based on severity:
| Level | Content |
|---|---|
| High | Containers running as root or using --privileged; wildcard patterns like Action: * in IAM policies |
| Medium | CORS allowing all origins; applying for admin tokens or full scopes |
The documentation uses a leftover privileged: true in a Compose file as an example: once the requirement disappears but the configuration remains, a vulnerability inside the container can escalate permissions from “application process” to nearly host-level access. The plugin targets these types of asymptomatic, high-consequence configuration remnants.
Installation and Activation¶
To integrate with DSH (web profile):
dsh plugin --profile web add @deepwhale-cn/dsh-least-privilege
To use as a CLI tool without going through DSH:
npx @deepwhale-cn/dsh-least-privilege
Before installation, it is recommended to review the source code and MIT license in the GitHub repository. The plugin reads project files with the current process permissions via DSH or npx, so you should align the target directories and trust boundaries for scanning.
Typical Usage¶
After installation, you can invoke the binary dsh-least-privilege:
- Demo mode, to view sample output and rule demonstrations:
dsh-least-privilege --demo
- List built-in rules and their rationale:
dsh-least-privilege --list-rules
- Generate an HTML report for scan results (example filename
r.html):
dsh-least-privilege --html r.html
The official README provides screenshots of inspection reports, demo mode output, and rule descriptions located under plugin-assets on deepwhale.org.cn, facilitating comparison with CLI output formats.
Boundaries and Use Cases¶
Who it is for: Teams that need lightweight permission checkups in CI, before changing configurations, or within DSH workflows; when used in conjunction with “Permissions and Emergency Response” plugins in the DeepWhale Network Security Guardian series, it complements the “Access Control” link.
Limitations to be aware of (from the README “Boundaries”):
- Only checks for “obviously excessive” patterns; permissions that are broad but do not use wildcards require manual review.
- Does not parse the actual effective policies on the cloud provider side (inheritance, conditions, permission boundaries, etc.), only looking at literal configurations in the repository.
USER rootin the builder stage of multi-stage Dockerfiles may be harmless and requires your own judgment.
For the DSH community plugin directory, see dsh-plugin.org and the domestic SkillHub directory page. In terms of ecosystem, DSH emphasizes “Everything is a plugin”; the directory sites are community-maintained and have no official affiliation with DeepSeek / High-Flyer.
Conclusion¶
dsh-least-privilege turns least privilege from a principle into an executable repository scan: high-risk container privileges and IAM wildcards, as well as medium-risk CORS and token scopes, can be flagged before merging. It cannot replace policy simulations in the cloud console, but it can block the most common “forgot to change config” amplifiers.
- Directory Page: https://www.skillhub.cn/plugins/feely0208/dsh-least-privilege
- GitHub: https://github.com/feely0208/dsh-least-privilege