vigilsutra 0.2.1 → 0.2.3

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/dist/cli.js CHANGED
@@ -7,35 +7,35 @@ import { render, FORMATS } from "./reporters/index.js";
7
7
  import { ALL_RULES, findRule, RULES_VERSION } from "./rules/index.js";
8
8
  import { ADAPTERS, PACKAGE_ROOT, installClaude, planClaudeInstall, uninstallClaude } from "./adapters.js";
9
9
  import { SEVERITY_ORDER } from "./types.js";
10
- const HELP = `VigilSutra AI ${VERSION} - offline, read-only security & privacy auditor. Created by Vatsal Shah.
11
-
12
- Usage: vigilsutra <command> [options]
13
-
14
- Commands:
15
- audit [path] Scan a project (default: .). Read-only; no network; no code execution.
16
- --format <f> text (default) | json | markdown | sarif | html
17
- --out <file> Write the report to a file instead of stdout
18
- --fail-on <sev> Exit 1 if any finding is at/above critical|high|medium|low|info
19
- --baseline <file> Suppress findings whose fingerprints are in this baseline
20
- --policy <file> Use this policy file instead of the project's .vigilsutra.yml
21
- --no-policy Ignore the project's .vigilsutra.yml (use when auditing code you do not own)
22
- --report Also write report.md, report.html, results.json, results.sarif to ./vigilsutra-report/
23
- --report-dir <dir> Same, into <dir>
24
- --no-report Do not write report files (they are written by default when you run audit in a terminal without --format/--out)
25
- --no-color Plain output (also honours NO_COLOR)
26
- report [path] Scan and write the report files (Markdown + HTML + JSON + SARIF), then print the summary
27
- baseline [path] --out <file> Record current findings as an accepted baseline
28
- verify [path] --previous <results.json> Re-scan and compare with an earlier JSON result
29
- rules list List implemented rules
30
- explain <RULE-ID> Show rule details, fix and false-positive notes
31
- doctor Environment and offline-readiness check
32
- init [path] Create .vigilsutra.yml if absent (never overwrites)
33
- adapters list Show adapter status
34
- adapters install claude [--project <dir>] [--dry-run] [--force]
35
- adapters uninstall claude [--project <dir>]
36
- --help, --version
37
-
38
- Exit codes: 0 ok | 1 findings at/above --fail-on | 2 usage or runtime error
10
+ const HELP = `VigilSutra AI ${VERSION} - offline, read-only security & privacy auditor. Created by Vatsal Shah.
11
+
12
+ Usage: vigilsutra <command> [options]
13
+
14
+ Commands:
15
+ audit [path] Scan a project (default: .). Read-only; no network; no code execution.
16
+ --format <f> text (default) | json | markdown | sarif | html
17
+ --out <file> Write the report to a file instead of stdout
18
+ --fail-on <sev> Exit 1 if any finding is at/above critical|high|medium|low|info
19
+ --baseline <file> Suppress findings whose fingerprints are in this baseline
20
+ --policy <file> Use this policy file instead of the project's .vigilsutra.yml
21
+ --no-policy Ignore the project's .vigilsutra.yml (use when auditing code you do not own)
22
+ --report Write report.md and report.html (also results.json and results.sarif) to ./vigilsutra-report/. This is the default.
23
+ --report-dir <dir> Same, into <dir>
24
+ --no-report Do not write those files
25
+ --no-color Plain output (also honours NO_COLOR)
26
+ report [path] Same scan as audit. Always writes report.md and report.html (plus JSON and SARIF)
27
+ baseline [path] --out <file> Record current findings as an accepted baseline
28
+ verify [path] --previous <results.json> Re-scan and compare with an earlier JSON result
29
+ rules list List implemented rules
30
+ explain <RULE-ID> Show rule details, fix and false-positive notes
31
+ doctor Environment and offline-readiness check
32
+ init [path] Create .vigilsutra.yml if absent (never overwrites)
33
+ adapters list Show adapter status
34
+ adapters install claude [--project <dir>] [--dry-run] [--force]
35
+ adapters uninstall claude [--project <dir>]
36
+ --help, --version
37
+
38
+ Exit codes: 0 ok | 1 findings at/above --fail-on | 2 usage or runtime error
39
39
  `;
40
40
  const VALUE_FLAGS = new Set(["format", "out", "fail-on", "baseline", "previous", "project", "policy", "report-dir"]);
41
41
  function parse(argv) {
@@ -125,19 +125,12 @@ function main() {
125
125
  }
126
126
  else
127
127
  process.stdout.write(render(result, format, color));
128
- // Reports as files: always for `report`, on request, and by default for an interactive `audit` with no explicit format or file.
129
- const explicitOutput = flags.has("format") || typeof out === "string";
128
+ // Readable reports are files, not only a terminal scrollback. Stdout stays the chosen format.
130
129
  const dirFlag = flags.get("report-dir");
131
- const wantReport = cmd === "report" || flags.has("report") || typeof dirFlag === "string" || (!flags.has("no-report") && !explicitOutput && !!process.stdout.isTTY);
132
- if (wantReport) {
130
+ if (!flags.has("no-report")) {
133
131
  const dir = resolve(typeof dirFlag === "string" ? dirFlag : "vigilsutra-report");
134
132
  writeReportFolder(dir, result);
135
- process.stdout.write(`
136
- Reports written to ${dir}
137
- report.html open this in a browser
138
- report.md Markdown version
139
- results.json, results.sarif for tools and CI
140
- `);
133
+ process.stderr.write(`Reports written to ${dir}\n report.html open this in a browser\n report.md Markdown version\n results.json, results.sarif for tools and CI\n`);
141
134
  }
142
135
  if (failOn && exceeds(result, failOn))
143
136
  process.exit(1);
package/dist/engine.js CHANGED
@@ -7,7 +7,7 @@ import { inventory } from "./scope.js";
7
7
  import { DEFAULT_POLICY, loadPolicy } from "./policy.js";
8
8
  import { redactSpan, scrubTokens, tidy } from "./redact.js";
9
9
  import { SEVERITY_ORDER } from "./types.js";
10
- export const VERSION = "0.2.1";
10
+ export const VERSION = "0.2.3";
11
11
  /** Per rule, per file. Keeps one noisy file from producing an unbounded report. */
12
12
  export const MAX_PER_RULE_PER_FILE = 200;
13
13
  function sha(s) {
@@ -189,6 +189,7 @@ export function audit(opts) {
189
189
  "Source-pattern matches are reported as 'potential' unless the evidence itself is conclusive (for example a token format or an explicit unsafe setting).",
190
190
  "A match on a secret format shows the format, not that the credential is live. No credential was tested.",
191
191
  "Git history, dependencies, advisories, running systems and remote cloud state were not inspected.",
192
+ "Untracked .env files are not read when a git index is present. .env.example, .env.sample and .env.template are never treated as secret files.",
192
193
  "Absence of findings is not evidence of security."
193
194
  ];
194
195
  if (inv.stats.truncated)
@@ -0,0 +1,282 @@
1
+ import { createHash } from "node:crypto";
2
+ import { closeSync, fstatSync, lstatSync, openSync, readSync } from "node:fs";
3
+ import { dirname, isAbsolute, join, relative, resolve } from "node:path";
4
+ const MAX_INDEX_BYTES = 32 * 1024 * 1024;
5
+ const MAX_GITDIR_FILE = 4096;
6
+ export function createGitCache() {
7
+ return { dir: new Map(), index: new Map() };
8
+ }
9
+ /** `.env`, `.env.local`, `.env.production`, and similar. Example and template files are not secret files. */
10
+ export function isDotenvName(name) {
11
+ return /^\.env(\..+)?$/i.test(name) && !/\.(example|sample|template)$/i.test(name);
12
+ }
13
+ /**
14
+ * True when `absFile` is listed in the git index that owns it.
15
+ * `null` means there is no usable index (no repository, or the index could not be parsed).
16
+ * Reads the index file only. Does not run git.
17
+ */
18
+ export function gitTracks(absFile, cache) {
19
+ const info = gitFor(dirname(absFile), cache);
20
+ if (info === "none" || info.paths === null)
21
+ return null;
22
+ let rel = relative(info.workTree, absFile);
23
+ rel = rel.split("\\").join("/");
24
+ if (rel === "" || rel === ".." || rel.startsWith("../") || isAbsolute(rel))
25
+ return null;
26
+ if (info.ignoreCase)
27
+ rel = rel.toLowerCase();
28
+ return info.paths.has(rel);
29
+ }
30
+ /** Local environment files that git does not track are not part of the review. */
31
+ export function shouldSkipUntrackedDotenv(name, absFile, cache) {
32
+ return isDotenvName(name) && gitTracks(absFile, cache) === false;
33
+ }
34
+ function gitFor(dir, cache) {
35
+ const hit = cache.dir.get(dir);
36
+ if (hit)
37
+ return hit;
38
+ const found = readGitAt(dir, cache);
39
+ if (found) {
40
+ cache.dir.set(dir, found);
41
+ return found;
42
+ }
43
+ const parent = dirname(dir);
44
+ if (parent === dir) {
45
+ cache.dir.set(dir, "none");
46
+ return "none";
47
+ }
48
+ const up = gitFor(parent, cache);
49
+ cache.dir.set(dir, up);
50
+ return up;
51
+ }
52
+ function readGitAt(dir, cache) {
53
+ const gitPath = join(dir, ".git");
54
+ let st;
55
+ try {
56
+ st = lstatSync(gitPath);
57
+ }
58
+ catch {
59
+ return null;
60
+ }
61
+ if (st.isSymbolicLink())
62
+ return null;
63
+ if (st.isDirectory()) {
64
+ if (!isRegularFile(join(gitPath, "HEAD")))
65
+ return null;
66
+ return { workTree: dir, ...loadIndex(join(gitPath, "index"), cache, gitPath) };
67
+ }
68
+ if (!st.isFile() || st.size > MAX_GITDIR_FILE || st.size === 0)
69
+ return null;
70
+ const raw = readRegular(gitPath, st);
71
+ if (!raw)
72
+ return null;
73
+ const m = /^gitdir:[ \t]*([^\r\n]+)$/m.exec(raw.toString("utf8"));
74
+ if (!m)
75
+ return null;
76
+ const gitdir = resolve(dir, m[1].trim());
77
+ let gst;
78
+ try {
79
+ gst = lstatSync(gitdir);
80
+ }
81
+ catch {
82
+ return { workTree: dir, paths: null, ignoreCase: false };
83
+ }
84
+ if (!gst.isDirectory() || gst.isSymbolicLink())
85
+ return { workTree: dir, paths: null, ignoreCase: false };
86
+ if (!isRegularFile(join(gitdir, "HEAD")))
87
+ return { workTree: dir, paths: null, ignoreCase: false };
88
+ return { workTree: dir, ...loadIndex(join(gitdir, "index"), cache, gitdir) };
89
+ }
90
+ function loadIndex(indexPath, cache, gitDir) {
91
+ const cached = cache.index.get(gitDir);
92
+ if (cached)
93
+ return cached;
94
+ const ignoreCase = readIgnoreCase(gitDir);
95
+ const store = (paths) => {
96
+ const info = { paths: paths && ignoreCase ? new Set([...paths].map((p) => p.toLowerCase())) : paths, ignoreCase };
97
+ cache.index.set(gitDir, info);
98
+ return info;
99
+ };
100
+ let st;
101
+ try {
102
+ st = lstatSync(indexPath);
103
+ }
104
+ catch {
105
+ return store(new Set());
106
+ }
107
+ if (!st.isFile() || st.isSymbolicLink() || st.size === 0 || st.size > MAX_INDEX_BYTES)
108
+ return store(null);
109
+ const buf = readRegular(indexPath, st);
110
+ return store(buf ? parseGitIndex(buf) : null);
111
+ }
112
+ /** `core.ignorecase` when the config says so. Windows and macOS default to true; Linux defaults to false. */
113
+ function readIgnoreCase(gitDir) {
114
+ const fallback = process.platform === "win32" || process.platform === "darwin";
115
+ const cfgPath = join(gitDir, "config");
116
+ let st;
117
+ try {
118
+ st = lstatSync(cfgPath);
119
+ }
120
+ catch {
121
+ return fallback;
122
+ }
123
+ if (!st.isFile() || st.isSymbolicLink() || st.size > 1024 * 1024)
124
+ return fallback;
125
+ const buf = readRegular(cfgPath, st);
126
+ if (!buf)
127
+ return fallback;
128
+ const m = /^[ \t]*ignorecase[ \t]*=[ \t]*(true|false)[ \t]*$/im.exec(buf.toString("utf8"));
129
+ return m ? m[1].toLowerCase() === "true" : fallback;
130
+ }
131
+ function isRegularFile(abs) {
132
+ try {
133
+ const st = lstatSync(abs);
134
+ return st.isFile() && !st.isSymbolicLink();
135
+ }
136
+ catch {
137
+ return false;
138
+ }
139
+ }
140
+ /** Read a regular file that is still the same inode we just stat'ed. Returns null if it was swapped or is not a file. */
141
+ function readRegular(abs, expected) {
142
+ let fd;
143
+ try {
144
+ fd = openSync(abs, "r");
145
+ }
146
+ catch {
147
+ return null;
148
+ }
149
+ try {
150
+ const now = fstatSync(fd);
151
+ if (!now.isFile() || now.size !== expected.size)
152
+ return null;
153
+ if (expected.ino !== 0 && (now.ino !== expected.ino || now.dev !== expected.dev))
154
+ return null;
155
+ const buf = Buffer.alloc(now.size);
156
+ let off = 0;
157
+ while (off < buf.length) {
158
+ const n = readSync(fd, buf, off, buf.length - off, off);
159
+ if (n === 0)
160
+ break;
161
+ off += n;
162
+ }
163
+ if (off !== buf.length)
164
+ return null;
165
+ return buf;
166
+ }
167
+ catch {
168
+ return null;
169
+ }
170
+ finally {
171
+ closeSync(fd);
172
+ }
173
+ }
174
+ const FILE_MODES = new Set([0o100644, 0o100755, 0o100664, 0o120000, 0o160000]);
175
+ /** Parse a git index (versions 2, 3, and 4; SHA-1 or SHA-256). Returns null if the bytes are not a valid index. */
176
+ export function parseGitIndex(buf) {
177
+ return parseWithHash(buf, 20) ?? parseWithHash(buf, 32);
178
+ }
179
+ function parseWithHash(buf, hashLen) {
180
+ if (buf.length < 12 + hashLen)
181
+ return null;
182
+ if (buf.toString("latin1", 0, 4) !== "DIRC")
183
+ return null;
184
+ const version = buf.readUInt32BE(4);
185
+ if (version < 2 || version > 4)
186
+ return null;
187
+ const count = buf.readUInt32BE(8);
188
+ if (count > 5_000_000)
189
+ return null;
190
+ const end = buf.length - hashLen;
191
+ const algo = hashLen === 32 ? "sha256" : "sha1";
192
+ const sum = createHash(algo).update(buf.subarray(0, end)).digest();
193
+ if (!sum.equals(buf.subarray(end)))
194
+ return null;
195
+ const paths = new Set();
196
+ let pos = 12;
197
+ let prev = "";
198
+ const flagAt = 40 + hashLen;
199
+ for (let i = 0; i < count; i++) {
200
+ if (pos + flagAt + 2 > end)
201
+ return null;
202
+ const mode = buf.readUInt32BE(pos + 24);
203
+ if (!FILE_MODES.has(mode))
204
+ return null;
205
+ const flags = buf.readUInt16BE(pos + flagAt);
206
+ const extended = (flags & 0x4000) !== 0;
207
+ if (extended && version < 3)
208
+ return null;
209
+ let nameAt = pos + flagAt + 2;
210
+ if (extended)
211
+ nameAt += 2;
212
+ if (nameAt > end)
213
+ return null;
214
+ let name;
215
+ let next;
216
+ if (version === 4) {
217
+ const dec = decodeVarint(buf, nameAt, end);
218
+ if (!dec)
219
+ return null;
220
+ const nul = buf.indexOf(0, dec.pos);
221
+ if (nul < 0 || nul >= end)
222
+ return null;
223
+ if (dec.value > prev.length)
224
+ return null;
225
+ name = prev.slice(0, prev.length - dec.value) + buf.toString("utf8", dec.pos, nul);
226
+ prev = name;
227
+ next = nul + 1;
228
+ }
229
+ else {
230
+ const declared = flags & 0xfff;
231
+ let nameEnd;
232
+ if (declared === 0xfff) {
233
+ nameEnd = buf.indexOf(0, nameAt);
234
+ if (nameEnd < 0 || nameEnd >= end)
235
+ return null;
236
+ }
237
+ else {
238
+ nameEnd = nameAt + declared;
239
+ if (nameEnd >= end || buf[nameEnd] !== 0)
240
+ return null;
241
+ }
242
+ name = buf.toString("utf8", nameAt, nameEnd);
243
+ const raw = nameEnd + 1 - pos;
244
+ next = pos + ((raw + 7) & ~7);
245
+ }
246
+ if (!name || name.includes("\\") || name.startsWith("/") || name.split("/").includes(".."))
247
+ return null;
248
+ paths.add(name);
249
+ if (next <= pos || next > end)
250
+ return null;
251
+ pos = next;
252
+ }
253
+ while (pos + 8 <= end) {
254
+ const sig = buf.toString("latin1", pos, pos + 4);
255
+ const size = buf.readUInt32BE(pos + 4);
256
+ if (size > end || pos + 8 + size > end)
257
+ return null;
258
+ // A split index keeps the real entries elsewhere. Don't treat a partial list as complete.
259
+ if (sig === "link")
260
+ return null;
261
+ pos += 8 + size;
262
+ }
263
+ if (pos !== end)
264
+ return null;
265
+ return paths;
266
+ }
267
+ /** Git's offset varint: continuation bytes are biased by +1. See git's decode_varint. */
268
+ function decodeVarint(buf, pos, end) {
269
+ if (pos >= end)
270
+ return null;
271
+ let c = buf[pos++];
272
+ let val = c & 127;
273
+ let guard = 0;
274
+ while (c & 128) {
275
+ if (pos >= end || ++guard > 9)
276
+ return null;
277
+ val += 1;
278
+ c = buf[pos++];
279
+ val = val * 128 + (c & 127);
280
+ }
281
+ return { value: val, pos };
282
+ }
@@ -81,13 +81,13 @@ export const secretRules = [
81
81
  {
82
82
  ...base,
83
83
  id: "VS-SECRET-006",
84
- title: "Environment file present in scanned tree",
84
+ title: "Tracked environment file with a secret value",
85
85
  severity: "medium",
86
86
  confidence: "medium",
87
87
  status: "potential",
88
88
  cwe: ["CWE-312", "CWE-798"],
89
- description: "A `.env`-style file exists in the scanned tree and contains at least one secret-named variable with a non-placeholder value. If it is tracked by git it exposes that value. File contents are not echoed.",
90
- falsePositives: "Files that are git-ignored and never committed. This scanner does not read git state in v0.1, so it cannot tell. Files holding only placeholders or non-secret settings are not reported.",
89
+ description: "A `.env` file (not an example, sample, or template) contains a secret-named variable with a non-placeholder value. File contents are not echoed. When a git index is present, environment files that are not listed in it are not read. When there is no usable git index, the file is still reviewed.",
90
+ falsePositives: "Placeholder values and non-secret settings. `.env.example`, `.env.sample`, and `.env.template` are not reported. A local `.env` that git does not track is not a finding.",
91
91
  applies: (f) => /^\.env(\..+)?$/.test(f.name) && !/\.(example|sample|template)$/.test(f.name),
92
92
  check: (f) => {
93
93
  const idx = f.lines.findIndex((l) => {
package/dist/scope.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { lstatSync, readdirSync, realpathSync, openSync, readSync, closeSync, fstatSync } from "node:fs";
2
2
  import { join, basename, extname, relative, isAbsolute } from "node:path";
3
3
  import { makeIgnoreMatcher } from "./policy.js";
4
+ import { createGitCache, shouldSkipUntrackedDotenv } from "./git-index.js";
4
5
  /** True when `p` is `root` or lies beneath it (case-insensitive on Windows). */
5
6
  export function isInside(root, p) {
6
7
  const fix = (s) => (process.platform === "win32" ? s.toLowerCase() : s);
@@ -56,6 +57,7 @@ export function inventory(rootInput, policy) {
56
57
  };
57
58
  const files = [];
58
59
  const allPaths = new Set();
60
+ const gitCache = createGitCache();
59
61
  const deadline = Date.now() + policy.timeLimitMs;
60
62
  const walk = (dirAbs, dirRel) => {
61
63
  if (stats.truncated)
@@ -105,6 +107,12 @@ export function inventory(rootInput, policy) {
105
107
  stats.skippedIgnored++;
106
108
  continue;
107
109
  }
110
+ // A local .env that git does not track is not a committed secret. Leave it unread.
111
+ // With no usable git index, the file is still reviewed.
112
+ if (shouldSkipUntrackedDotenv(e.name, abs, gitCache)) {
113
+ stats.skippedIgnored++;
114
+ continue;
115
+ }
108
116
  allPaths.add(rel);
109
117
  if (st.size > policy.maxFileSize) {
110
118
  stats.skippedTooLarge++;
@@ -1,28 +1,28 @@
1
- # Trust and verification
2
-
3
- Everything on this page can be re-run. Where something has **not** been verified, it says so.
4
-
5
- ## Claim, evidence, how to check
6
-
7
- | Claim | Evidence | Reproduce |
8
- |---|---|---|
9
- | Works offline, no network or subprocess use | Static test, runtime test with blocked network and subprocess APIs, Linux network-namespace test in CI: [offline-verification.md](offline-verification.md) | `npm test` |
10
- | Does not crash, hang or leak on hostile input | Fuzz and ReDoS tests; two real quadratic regexes were found and fixed: [fuzzing.md](fuzzing.md) | `npm test` |
11
- | Tests exercise the code | 98.4 % line, 89.6 % branch coverage: [coverage.md](coverage.md) | see file |
12
- | Few false positives on real code | Benchmark on 18 public repositories with a labeled sample, a holdout sample and a regression check: [benchmark.md](benchmark.md) | `node benchmarks/run.mjs` |
13
- | How it compares | Same commits scanned with Gitleaks and Semgrep: [benchmark.md](benchmark.md#comparison-with-other-open-source-scanners) | **benchmark** workflow |
14
- | Small, auditable supply chain | Zero runtime dependencies, SBOMs, `npm audit` clean, pinned Actions: [supply-chain.md](supply-chain.md) | `npm sbom`, `npm audit` |
15
- | Reviewed for security flaws | Internal review plus CodeQL, ten fixes with tests: [internal-review.md](internal-review.md). **Not independent.** | read the tests |
16
- | Name conflicts | Preliminary search, **not clearance**: [trademark-search.md](trademark-search.md) | |
17
- | How vulnerabilities are handled | [SECURITY.md](../../SECURITY.md) and the public ledger [security-advisories.md](../security-advisories.md) | |
18
-
19
- ## What is deliberately not claimed
20
-
21
- - No claim of certification, compliance, or "secure".
22
- - No recall figure: how many real problems VigilSutra misses is **not measured**.
23
- - No independent review or independent labels yet; [REVIEW-REQUEST.md](REVIEW-REQUEST.md) explains how to provide them.
24
- - No adoption claims. See [ADOPTERS.md](../../ADOPTERS.md).
25
-
26
- ## The plan behind this page
27
-
28
- [TRUST-PLAN.md](TRUST-PLAN.md) lists every gap that was identified, what was done and what remains (some items need the owner or an outside party).
1
+ # Trust and verification
2
+
3
+ Everything on this page can be re-run. Where something has **not** been verified, it says so.
4
+
5
+ ## Claim, evidence, how to check
6
+
7
+ | Claim | Evidence | Reproduce |
8
+ |---|---|---|
9
+ | Works offline, no network or subprocess use | Static test, runtime test with blocked network and subprocess APIs, Linux network-namespace test in CI: [offline-verification.md](offline-verification.md) | `npm test` |
10
+ | Does not crash, hang or leak on hostile input | Fuzz and ReDoS tests; two real quadratic regexes were found and fixed: [fuzzing.md](fuzzing.md) | `npm test` |
11
+ | Tests exercise the code | 98.4 % line, 89.6 % branch coverage: [coverage.md](coverage.md) | see file |
12
+ | Few false positives on real code | Benchmark on 18 public repositories with a labeled sample, a holdout sample and a regression check: [benchmark.md](benchmark.md) | `node benchmarks/run.mjs` |
13
+ | How it compares | Same commits scanned with Gitleaks and Semgrep: [benchmark.md](benchmark.md#comparison-with-other-open-source-scanners) | **benchmark** workflow |
14
+ | Small, auditable supply chain | Zero runtime dependencies, SBOMs, `npm audit` clean, pinned Actions: [supply-chain.md](supply-chain.md) | `npm sbom`, `npm audit` |
15
+ | Reviewed for security flaws | Internal review plus CodeQL, ten fixes with tests: [internal-review.md](internal-review.md). **Not independent.** | read the tests |
16
+ | Name conflicts | Preliminary search, **not clearance**: [trademark-search.md](trademark-search.md) | |
17
+ | How vulnerabilities are handled | [SECURITY.md](../../SECURITY.md) and the public ledger [security-advisories.md](../security-advisories.md) | |
18
+
19
+ ## What is deliberately not claimed
20
+
21
+ - No claim of certification, compliance, or "secure".
22
+ - No recall figure: how many real problems VigilSutra misses is **not measured**.
23
+ - No independent review or independent labels yet; [REVIEW-REQUEST.md](REVIEW-REQUEST.md) explains how to provide them.
24
+ - No adoption claims. See [ADOPTERS.md](../../ADOPTERS.md).
25
+
26
+ ## The plan behind this page
27
+
28
+ [TRUST-PLAN.md](TRUST-PLAN.md) lists every gap that was identified, what was done and what remains (some items need the owner or an outside party).
@@ -1,31 +1,31 @@
1
- # Trust plan: gaps, work done, what remains
2
-
3
- Written 2026-11-01 after an independent-auditor style review of what a skeptical visitor would ask for. Status values: **Done**, **Done with caveat**, **Blocked** (needs the owner or an outside party), **Not possible by tooling**.
4
-
5
- | # | Gap | Status | What was done | What remains |
6
- |---|---|---|---|---|
7
- | 1 | Real-world accuracy evidence (fixtures were written by the rule author) | **Done with caveat** | Ran 18 public repos; labeled a sample; found and fixed 20+ false-positive classes; measured a holdout sample; regression-checked that real findings survive: [benchmark.md](benchmark.md) | Labels are AI-assigned and the sample is not random. Independent human re-labeling would strengthen it |
8
- | 2 | Comparison with other tools on a shared corpus | **Done with caveat** | Gitleaks 8.30.1 and Semgrep 1.183.0 on identical commits, on Linux CI; 7 deliberately vulnerable projects included | Trivy and CodeQL not run. Recall not measured |
9
- | 3 | Independent verification | **Blocked / not possible by tooling** | Internal review with 10 fixes and tests; GitHub CodeQL (an independent static analyzer) now runs on every push and found 3 real-or-near-real issues that were fixed: [internal-review.md](internal-review.md); open request for reviewers: [REVIEW-REQUEST.md](REVIEW-REQUEST.md) | Someone outside the project has to review it. Owner: recruit a reviewer |
10
- | 4 | npm provenance | **Blocked** | `release.yml` publishes with provenance via Trusted Publishing; Actions pinned; Dependabot on | Owner must add the Trusted Publisher on npmjs.com and run a release. Versions 0.1.0 and 0.1.1 on npm have no provenance |
11
- | 5 | Verified offline claim | **Done** | Runtime test with blocked network/subprocess APIs; Linux network-namespace step in CI: [offline-verification.md](offline-verification.md) | |
12
- | 6 | Visible CI status | **Done** | CI badge, 3 OS x Node 20/22 matrix, compatibility page; OpenSSF Scorecard published (5.5/10 at first run); CodeQL on every push | Scorecard weak spots: branch protection, required code review, repository age, OpenSSF best-practices badge (owner actions) |
13
- | 7 | Fuzz and ReDoS testing | **Done** | Seeded fuzz and adversarial-timing tests; found 2 real quadratic regexes: [fuzzing.md](fuzzing.md) | No formal regex analysis |
14
- | 8 | Coverage figure | **Done** | 98.4 % lines, 89.6 % branches: [coverage.md](coverage.md) | No enforced threshold or mutation testing |
15
- | 9 | Dependency, license and SBOM report | **Done** | CycloneDX and SPDX SBOMs, license table, `npm audit`: [supply-chain.md](supply-chain.md) | Zero runtime dependencies, so little to report |
16
- | 10 | Security response record | **Done with caveat** | Policy, targets, public ledger: [security-advisories.md](../security-advisories.md) | There is no external report history yet and none was invented |
17
- | 11 | Real demo | **Done with caveat** | Terminal image generated from real output (`docs/assets/demo.svg`) | A public demo repository showing alerts in GitHub's code-scanning tab was **not created** (needs the owner's approval to create another public repository). No animated GIF |
18
- | 12 | Stars, early adopters, answered issues | **Not possible by tooling** | `ADOPTERS.md`, issue templates, [launch-kit.md](../launch-kit.md) | Real users and their feedback |
19
- | 13 | Launch write-up with real numbers | **Done with caveat** | Draft in [launch-kit.md](../launch-kit.md) using measured numbers | Owner to publish and promote |
20
- | 14 | Public changelog and cadence | **Done with caveat** | CHANGELOG, tags, releases | Cadence depends on the maintainer |
21
- | 15 | Rule precision claims in docs | **Done** | Each rule's false-positive text kept; benchmark per-rule table; confidence lowered for test and example paths | |
22
- | H1 | Exposed GitHub token | **Blocked** | Never written to the repo | Owner must revoke it |
23
- | H2 | npm package owned by a personal account, org exists | **Blocked** | | `npm owner add` / transfer to the `vigilsutra` org |
24
- | H3 | Trademark clearance | **Blocked** | Preliminary search: [trademark-search.md](trademark-search.md) | Formal search by an attorney |
25
- | H4 | Dependabot pull requests (5 open) | **Pending (owner decision)** | Recommendation: merge the three official-action bumps (`actions/checkout` 7, `actions/setup-node` 7, `codeql-action` 4) once CI is green on the PR; close TypeScript 7 (its CI run fails) and `@types/node` 26 (the package supports Node 20, so types for Node 26 would hide API misuse) | Merge or close each |
26
-
27
- ## Principles used
28
-
29
- 1. Publish measured results only, with method and limits next to the number.
30
- 2. Fix what the measurement finds, then measure again on data the fixes were not tuned on.
31
- 3. Never invent users, reviews, reports or endorsements.
1
+ # Trust plan: gaps, work done, what remains
2
+
3
+ Written 2026-11-01 after an independent-auditor style review of what a skeptical visitor would ask for. Status values: **Done**, **Done with caveat**, **Blocked** (needs the owner or an outside party), **Not possible by tooling**.
4
+
5
+ | # | Gap | Status | What was done | What remains |
6
+ |---|---|---|---|---|
7
+ | 1 | Real-world accuracy evidence (fixtures were written by the rule author) | **Done with caveat** | Ran 18 public repos; labeled a sample; found and fixed 20+ false-positive classes; measured a holdout sample; regression-checked that real findings survive: [benchmark.md](benchmark.md) | Labels are AI-assigned and the sample is not random. Independent human re-labeling would strengthen it |
8
+ | 2 | Comparison with other tools on a shared corpus | **Done with caveat** | Gitleaks 8.30.1 and Semgrep 1.183.0 on identical commits, on Linux CI; 7 deliberately vulnerable projects included | Trivy and CodeQL not run. Recall not measured |
9
+ | 3 | Independent verification | **Blocked / not possible by tooling** | Internal review with 10 fixes and tests; GitHub CodeQL (an independent static analyzer) now runs on every push and found 3 real-or-near-real issues that were fixed: [internal-review.md](internal-review.md); open request for reviewers: [REVIEW-REQUEST.md](REVIEW-REQUEST.md) | Someone outside the project has to review it. Owner: recruit a reviewer |
10
+ | 4 | npm provenance | **Blocked** | `release.yml` publishes with provenance via Trusted Publishing; Actions pinned; Dependabot on | Owner must add the Trusted Publisher on npmjs.com and run a release. Versions 0.1.0 and 0.1.1 on npm have no provenance |
11
+ | 5 | Verified offline claim | **Done** | Runtime test with blocked network/subprocess APIs; Linux network-namespace step in CI: [offline-verification.md](offline-verification.md) | |
12
+ | 6 | Visible CI status | **Done** | CI badge, 3 OS x Node 20/22 matrix, compatibility page; OpenSSF Scorecard published (5.5/10 at first run); CodeQL on every push | Scorecard weak spots: branch protection, required code review, repository age, OpenSSF best-practices badge (owner actions) |
13
+ | 7 | Fuzz and ReDoS testing | **Done** | Seeded fuzz and adversarial-timing tests; found 2 real quadratic regexes: [fuzzing.md](fuzzing.md) | No formal regex analysis |
14
+ | 8 | Coverage figure | **Done** | 98.4 % lines, 89.6 % branches: [coverage.md](coverage.md) | No enforced threshold or mutation testing |
15
+ | 9 | Dependency, license and SBOM report | **Done** | CycloneDX and SPDX SBOMs, license table, `npm audit`: [supply-chain.md](supply-chain.md) | Zero runtime dependencies, so little to report |
16
+ | 10 | Security response record | **Done with caveat** | Policy, targets, public ledger: [security-advisories.md](../security-advisories.md) | There is no external report history yet and none was invented |
17
+ | 11 | Real demo | **Done with caveat** | Terminal image generated from real output (`docs/assets/demo.svg`) | A public demo repository showing alerts in GitHub's code-scanning tab was **not created** (needs the owner's approval to create another public repository). No animated GIF |
18
+ | 12 | Stars, early adopters, answered issues | **Not possible by tooling** | `ADOPTERS.md`, issue templates, [launch-kit.md](../launch-kit.md) | Real users and their feedback |
19
+ | 13 | Launch write-up with real numbers | **Done with caveat** | Draft in [launch-kit.md](../launch-kit.md) using measured numbers | Owner to publish and promote |
20
+ | 14 | Public changelog and cadence | **Done with caveat** | CHANGELOG, tags, releases | Cadence depends on the maintainer |
21
+ | 15 | Rule precision claims in docs | **Done** | Each rule's false-positive text kept; benchmark per-rule table; confidence lowered for test and example paths | |
22
+ | H1 | Exposed GitHub token | **Blocked** | Never written to the repo | Owner must revoke it |
23
+ | H2 | npm package owned by a personal account, org exists | **Blocked** | | `npm owner add` / transfer to the `vigilsutra` org |
24
+ | H3 | Trademark clearance | **Blocked** | Preliminary search: [trademark-search.md](trademark-search.md) | Formal search by an attorney |
25
+ | H4 | Dependabot pull requests (5 open) | **Pending (owner decision)** | Recommendation: merge the three official-action bumps (`actions/checkout` 7, `actions/setup-node` 7, `codeql-action` 4) once CI is green on the PR; close TypeScript 7 (its CI run fails) and `@types/node` 26 (the package supports Node 20, so types for Node 26 would hide API misuse) | Merge or close each |
26
+
27
+ ## Principles used
28
+
29
+ 1. Publish measured results only, with method and limits next to the number.
30
+ 2. Fix what the measurement finds, then measure again on data the fixes were not tuned on.
31
+ 3. Never invent users, reviews, reports or endorsements.