Releases: jkrandom-sudo/dsh-plugin-audit
Releases · jkrandom-sudo/dsh-plugin-audit
Release list
v0.1.2
Fixes
- Sentinel no longer a silent no-op — v0.1.x read
exec.args, but the host'sToolRuntime.createExecutiondelivers parsed tool arguments inexec.arguments. Every sentinel rule always passed in production; the test harness mirrored the same wrong shape, which is why earlier verification missed it. The sentinel now readsexec.arguments ?? exec.args, and the harness dispatches the real host shape. (#4) - Invariant no longer false-fails on routine tool errors — the host runs
tools/post-executefor failed calls too, and error results carry novalue; the marker check now requiresisError !== true. (#4) format: "json"implemented — previously documented but ignored; the tool now returns the structured report JSON. (#4)- Walker: depth pruning sets
truncated; unreadable files/dirs are skipped and counted instead of failing the audit; byte-exact reads viabytesRead; code-point ordering instead oflocaleCompare. (#4) sensitiveEnvVarsis once more a subset ofenvVars, as documented. (#4)- Report card escapes
|, backticks and newlines in attacker-controlled text (Markdown table injection). (#4) - Bundle-patch stats no longer count indented config list items as patch rows. (#4)
- Plugins shipping only build output (
dist/lib) can no longer earn a cleaninfocard — zero scanned files forces anotice. (#4)
Features
- Binding-aware detection: import/require aliases are resolved to their local names (
readFileSync as rfs,const { execSync: run } = require(...)),vmdestructuring caught,map.get(no longer flagged ashttp.get; async fs methods,export ... from, dynamicimport(), URL userinfo/IPv6/trailing-dot extraction, network-library import flagging. (#4) - New
src/events.tstypes the host tool-pipeline waterfalls on cordisEvents— listener shapes are now compile-time checked (the mechanism that would have caught the sentinel regression at build time). (#4) - Report card gains a Declared dependencies row. (#4)
Tests
- 24 → 89 tests: hash-based read-only proof, walk caps (files/depth/bytes/unreadable/skipped dirs), manifest branches, report edge rendering (row cap, caveats, Markdown escaping), sentinel rule matrix (allowlist case/wildcards, file-extension fallback, shell key variants, home dotfiles), binding-aware detection matrix, sort-order pins, dist-only evasion. (#4)
Docs
- Example card regenerated from the real renderer;
./src/*export documented as the official template convention; known scanner boundaries (no symlink following, string/comment matches) listed. (#4)
Verification
pnpm typecheck && pnpm test && pnpm build— all green (89 tests, 8 files).- Real-environment re-verification: in-process boot of the actual
webprofile composition against the installed DSH snapshot, dispatching the real host exec shape{ name, arguments }— 7/7 PASS, including sentinelaskoncat ~/.ssh/id_rsaand on curl egress to an unlisted host, and a realplugin_auditrun (risk=review, findings=10, writesPerformed=false).
Full Changelog: v0.1.1...v0.1.2
v0.1.1
Docs
- Rewrote both READMEs (EN/ZH) around what the project does and how to use it: leads with the problem statement, embeds a real
plugin_auditpermission card, tabulates the sentinel rules with triggering examples, documents tool arguments in Quick start, and removes machine-specific verification details (full record remains in PR #1 and the v0.1.0 notes).
Verification
pnpm test— 23/23 green; docs-only change, no code touched.
Full Changelog: v0.1.0...v0.1.1
v0.1.0
Features
- Static audit engine (
src/scanner/): read-only walker (400-file / 256 KB caps), capability detection (fs read/write, subprocess, network, env access, credential paths, dynamic exec, patch overrides, manifest) with file/line evidence,package.json+cordis.patch.ymlanalysis,info / notice / reviewrisk grading. plugin_audittool: audits a local plugin directory and returns a Markdown permission card plus JSON summary{ markdown, risk, filesScanned, findingsCount, writesPerformed }.writesPerformed: falseis contractual; the optionaldsh-plugin-audit/invariantcompanion fails the session if a result ever loses the marker.- Runtime sentinel (
src/sentinel/):tools/pre-executewaterfall listener returningask(host approval prompt; degrades todenywithout one) for credential-path references, shell egress toward non-allowlisted hosts, and home-directory dotfile writes. Configurable viasentinelEnabled/allowedHosts(schemastery schema).
Fixes
- Bundle patch no longer wires the
./invariantcompanion: stock web/base profiles do not provide theinvariantsservice, and the pending row blocked boot (found during real-profile verification). The companion remains exported for profiles that do provide it.
Tests
- 23 vitest tests: loader export-shape unwrap, schema defaults, three fixture scans (suspicious / clean / patch-override), Markdown card snapshot, sentinel rule matrix, disposal cleanup, invariant register/fail paths. Fixtures under
tests/fixtures/.
Docs
- Bilingual README:
README.md(English) /README.zh.md(中文) — overview, compatibility, install (npm + GitHub), uninstall, quick start, configuration, permissions & data, troubleshooting, development, license & security. - MIT license.
Verification
pnpm typecheck && pnpm test && pnpm build— all green (23/23).- Real DSH environment (mainline snapshot 2026-08-14, local
webprofile): installed viadsh plugin --profile web add; composed profile booted in-process with zero errors (the loader aborts boot on any non-activating entry);plugin_auditresolved via the realToolRuntime; sentinel returnedaskforcat ~/.ssh/id_rsaand delegatedpnpm test; end-to-end audit of a suspicious fixture returnedrisk=review, 10 findings,writesPerformed=false.
Full Changelog: https://github.com/jkrandom-sudo/dsh-plugin-audit/commits/v0.1.0