dsh-vet 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/docs/rules/scan.empty-audit.md +27 -0
- package/lib/index.d.mts +1 -1
- package/lib/index.mjs +27 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# dsh-vet
|
|
2
2
|
|
|
3
|
+
[](https://github.com/rogerdigital/dsh-vet/blob/main/.dsh-vet/report.json)
|
|
4
|
+
|
|
3
5
|
Security vetting for DeepSeek Harness (DSH) plugins: permission & supply-chain
|
|
4
6
|
audits before install, graded via the open [`dsh-vet/v1`](docs/dsh-vet-v1.md)
|
|
5
7
|
report standard.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# scan.empty-audit
|
|
2
|
+
|
|
3
|
+
No analyzable JavaScript found in the target.
|
|
4
|
+
|
|
5
|
+
## What it looks for
|
|
6
|
+
|
|
7
|
+
The scanner found zero `.js`/`.mjs`/`.cjs` files (or Node-shebang bin
|
|
8
|
+
scripts) in the audited tree. This rule fires on behalf of the report's
|
|
9
|
+
readers: a scan that audited nothing must not read as a clean pass.
|
|
10
|
+
|
|
11
|
+
## Severity / confidence policy
|
|
12
|
+
|
|
13
|
+
**medium / high.** Nothing was analyzed — that is a fact, and a grade of A
|
|
14
|
+
here would be vacuous. Found live during v0.2 activation: a
|
|
15
|
+
TypeScript-source repository scanned as a local path ships no `.js` in its
|
|
16
|
+
working tree, so `.` audits nothing while the badge reads green.
|
|
17
|
+
|
|
18
|
+
## False positives
|
|
19
|
+
|
|
20
|
+
Targets that genuinely contain no JavaScript at all (a data package, a
|
|
21
|
+
documentation bundle). If that is you, the finding is still correct — you
|
|
22
|
+
are advertising an audit that cannot say anything.
|
|
23
|
+
|
|
24
|
+
## Remediation
|
|
25
|
+
|
|
26
|
+
Audit what actually ships: pass the npm package specifier (or a directory
|
|
27
|
+
containing the built output) instead of the source tree.
|
package/lib/index.d.mts
CHANGED
|
@@ -271,7 +271,7 @@ declare function runRules(analysis: Analysis, only?: string[]): VetFinding[];
|
|
|
271
271
|
//#endregion
|
|
272
272
|
//#region src/scanner.d.ts
|
|
273
273
|
/** Kept in lockstep with package.json; a test asserts they match. */
|
|
274
|
-
declare const SCANNER_VERSION = "0.2.
|
|
274
|
+
declare const SCANNER_VERSION = "0.2.1";
|
|
275
275
|
interface ScanOptions extends ResolveOptions {
|
|
276
276
|
/** Injectable clock for deterministic tests/reports. */
|
|
277
277
|
now?: () => string;
|
package/lib/index.mjs
CHANGED
|
@@ -1601,9 +1601,31 @@ function runRules(analysis, only) {
|
|
|
1601
1601
|
* over the same artifact with the same version are identical.
|
|
1602
1602
|
*/
|
|
1603
1603
|
/** Kept in lockstep with package.json; a test asserts they match. */
|
|
1604
|
-
const SCANNER_VERSION = "0.2.
|
|
1604
|
+
const SCANNER_VERSION = "0.2.1";
|
|
1605
|
+
/**
|
|
1606
|
+
* A scan that audited zero JavaScript files must not read as a clean pass —
|
|
1607
|
+
* a TypeScript source tree scanned as a local path has no `.js` to analyze,
|
|
1608
|
+
* and silence there would be an A-by-vacuity. (Found live during v0.2
|
|
1609
|
+
* activation; docs/rules/scan.empty-audit.md.)
|
|
1610
|
+
*/
|
|
1611
|
+
function emptyAuditFinding(targetSpecifier) {
|
|
1612
|
+
return {
|
|
1613
|
+
id: "scan.empty-audit",
|
|
1614
|
+
title: "No analyzable JavaScript found in the target",
|
|
1615
|
+
severity: "medium",
|
|
1616
|
+
confidence: "high",
|
|
1617
|
+
evidence: [{
|
|
1618
|
+
file: ".",
|
|
1619
|
+
note: `zero .js/.mjs/.cjs files (or Node-shebang bin scripts) found under ${targetSpecifier}`
|
|
1620
|
+
}],
|
|
1621
|
+
remediation: "Audit what actually ships: pass the npm package specifier (or a directory containing the built output) instead of the source tree.",
|
|
1622
|
+
references: ["https://github.com/rogerdigital/dsh-vet/blob/main/docs/rules/scan.empty-audit.md"]
|
|
1623
|
+
};
|
|
1624
|
+
}
|
|
1605
1625
|
async function scanDirectory(dir, options = {}) {
|
|
1606
1626
|
const analysis = analyze(dir);
|
|
1627
|
+
const findings = options.rules ? runRules(analysis, options.rules) : runRules(analysis);
|
|
1628
|
+
if (analysis.files.length === 0) findings.push(emptyAuditFinding(dir));
|
|
1607
1629
|
return createReport({
|
|
1608
1630
|
target: {
|
|
1609
1631
|
kind: "local-path",
|
|
@@ -1614,13 +1636,15 @@ async function scanDirectory(dir, options = {}) {
|
|
|
1614
1636
|
version: SCANNER_VERSION,
|
|
1615
1637
|
ranAt: options.now?.() ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
1616
1638
|
},
|
|
1617
|
-
findings
|
|
1639
|
+
findings
|
|
1618
1640
|
});
|
|
1619
1641
|
}
|
|
1620
1642
|
async function scan(specifier, options = {}) {
|
|
1621
1643
|
const resolved = await resolveTarget(specifier, options);
|
|
1622
1644
|
try {
|
|
1623
1645
|
const analysis = analyze(resolved.rootDir);
|
|
1646
|
+
const findings = options.rules ? runRules(analysis, options.rules) : runRules(analysis);
|
|
1647
|
+
if (analysis.files.length === 0) findings.push(emptyAuditFinding(specifier));
|
|
1624
1648
|
return createReport({
|
|
1625
1649
|
target: resolved.target,
|
|
1626
1650
|
scanner: {
|
|
@@ -1628,7 +1652,7 @@ async function scan(specifier, options = {}) {
|
|
|
1628
1652
|
version: SCANNER_VERSION,
|
|
1629
1653
|
ranAt: options.now?.() ?? (/* @__PURE__ */ new Date()).toISOString()
|
|
1630
1654
|
},
|
|
1631
|
-
findings
|
|
1655
|
+
findings
|
|
1632
1656
|
});
|
|
1633
1657
|
} finally {
|
|
1634
1658
|
resolved.cleanup();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-vet",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Security vetting for DeepSeek Harness (DSH) plugins: permission & supply-chain audits before install, graded via the open dsh-vet/v1 report standard.",
|
|
5
5
|
"dsh": {
|
|
6
6
|
"seams": ["fs", "shell", "web"]
|