Repository navigation
Contributing
Contributions are reviewed with two questions in mind: does the change keep the operator in control, and does it keep the evidence trustworthy? The full guide, including coding standards and commit style, is CONTRIBUTING.md. By participating you agree to the Code of Conduct.
- Use the plugin only on systems you own or have written authorization to test.
- Fixtures are local and synthetic; never add real client data, credentials or live target output.
- For a large change, open a feature request first so design and safety impact can be discussed.
- Report security problems privately per SECURITY.md.
Node.js 20 or newer, no npm dependencies, no install step — node_modules should not exist in a
clean checkout.
git clone https://github.com/sm0k3net/dsh-redteam.git
cd dsh-redteam
node --version # 20.x or 22.x
node scripts/build-client.mjs # regenerate client.js from src-client/
node --test test/*.test.mjs # full suite: 714 cases (712 pass, 0 fail, 2 environment-dependent skips)Useful variants:
node --test test/tools.test.mjs
node --test --test-name-pattern="approval" test/
REDTEAM_DOCKER_TEST=1 node --test test/docker-live.test.mjsThe Docker test is opt-in: it creates a throwaway container, pulls the Kali image, needs network
for apt-get update, and removes the container afterwards. It never touches the production
dsh-redteam-kali container. Do not run it in a normal edit/test loop.
| Path | Contents |
|---|---|
index.js |
Host entry: composition, lifecycle, doctrine section. |
client.js |
Generated client artifact; never edit by hand. |
src-client/ |
Concatenated client sources, ordered by filename. |
lib/host/ |
Store, engine, Kali, wordlists, OSINT, browser, web/API testing, evidence, reports, PDF, i18n, and the assurance modules (verifiers, identity, oob, planner, team, sarif, retest). |
lib/host/knowledge/ |
Citation data: PTES, WSTG, OWASP, CWE, ATT&CK, NIST. |
wordlists/ |
Bundled lists and manifest.json. |
test/ |
node:test suites, fixtures and the opt-in Docker test. |
scripts/ |
build-client.mjs and enable-docker-access.sh. |
- Define it in
lib/host/tools.jsinsideregisterTools(ctx, engine)withname,description,parameters(JSON Schema),output: textOutput()andasync execute(args, exec). - Keep the handler thin: resolve the session, call the engine, return
ok(summary, data)orfail(error). Policy, scope checks and phase gates belong in the engine. - If the tool can act on a target, route it through the existing RoE and scope checks. If it is exploitation-class, it must go through the approval path with an honest rationale and impact.
- Add tests to
test/tools.test.mjsfor registration count, schema and refusal paths, and to the engine suite for policy. The registration count is asserted (51 in 1.3.0), so update it when the count changes. A new pure module gets its owntest/<module>.test.mjsand is wired into the guarded factory inindex.js. - Document it in docs/TOOLS.md and in the README tool list.
- Add
RT.components.NameDrawer = function (props) { … }in an existing grouped source file or a newsrc-client/NN-name.jsthat keeps the concatenation order sensible. There is no module export. - Use
RT.hfor elements,props.act(action, payload)for operator actions andprops.t(key)for text. Add every key in English and Russian tosrc-client/00-core.js. - Render it from the matching branch in
src-client/90-app.jsand add a button that callssetDrawer('name'). Follow the existing prop names. - Treat the snapshot as read-only: the client renders state and posts actions. It never constructs a command or touches the filesystem.
- Run
node scripts/build-client.mjsand commitclient.jswith the sources in the same commit. - Extend a client test under
test/client-*.test.mjsso the drawer renders from a fixture snapshot.
A change is rejected regardless of code quality if it:
- bypasses or weakens scope enforcement, RoE acceptance, Safe-mode approvals, the audit trail, evidence hashing or execution gates;
- lets the agent accept the RoE, switch modes or resolve its own approval;
- adds unapproved persistence, self-propagation or exfiltration beyond the accepted scope;
- adds an undocumented or non-opt-in network call, telemetry or remote logging;
- writes outside the documented
$DSH_HOME/redteam/layout or makes evidence mutable; - runs
apton the host or executes a third-party tool on the host that belongs in the container; - includes a real credential, customer name or live target output.
Gate changes are product decisions: open a feature request and get maintainer agreement before writing the patch. Any accepted gate change needs a regression test proving the gate still denies the unapproved path. The sixteen invariants are listed in Architecture.
- ESM only, explicit extensions, no external dependencies, no side effects at import time.
- Factories return plain objects; expected failures return
{ ok: false, error, detail }. - Bound every input and output; a new external input needs a cap and a test.
- Never interpolate into a shell; pass argv arrays and redact secrets before persisting or logging.
- Resolve paths and keep them under the state root.
- Client sources are concatenated: no
import/exportinsrc-client/.
- Imperative subject around 72 characters; the body explains why and the trade-off; reference the issue. One logical change per commit and pull request.
- Commit
client.jswith thesrc-client/change that produced it; CI fails on a stale artifact. - Fill in the PR template: what changed, why, how it was tested, safety impact,
node --testresult. - At least one maintainer reviews; safety-relevant changes get an explicit threat-model review.
- CI must pass on Node 20 and 22, including the artifact check.
- Bump
versioninpackage.jsonfollowing semantic versioning. - Update
CHANGELOG.mdwith the date and user-visible changes. - Rebuild
client.jsif client sources changed; run the full suite and, where possible, the opt-in Docker test. - Commit as
Release vX.Y.Z. - Create an annotated tag
vX.Y.Z, push the branch and the tag. -
release.ymlverifies tests, checks the tag againstpackage.json, buildsdsh-redteam-vX.Y.Z.tar.gzwithgit archive, writesSHA256SUMSand attaches both to the GitHub Release. - Install from the release tarball once to confirm the artifact works.
- Never move or delete a published tag; ship a patch release instead.
- Architecture — module map and security invariants
- Release notes 1.3.0 — what changed in this release
- Roadmap — candidate work and explicit non-goals
- CONTRIBUTING.md
Wordlists and methodology data carry attribution requirements. If you change
wordlists/manifest.json, lib/host/knowledge/*.json or anything derived from an upstream corpus,
update wordlists/README.md and
docs/ATTRIBUTION.md and
keep the license MIT-compatible. Do not add a full breach dump. Design questions belong in an
issue; there is no Discussions forum.
dsh-redteam is MIT licensed. Use it only against systems you are authorized to test. — Report a vulnerability · Issues
dsh-redteam
Start here
Reference
- Agent tools
- Configuration
- Kali toolbox
- Wordlists
- OSINT
- Web and API testing
- Exploitation loop
- Team and planning
- Evidence and reports
- Scope and safety
- Resources
- Architecture
Operations
Project