vigilsutra 0.1.0 → 0.1.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/CHANGELOG.md +22 -13
- package/README.md +25 -14
- package/dist/adapters.js +24 -5
- package/dist/cli.js +23 -10
- package/dist/engine.js +29 -7
- package/dist/policy.js +13 -4
- package/dist/redact.js +2 -1
- package/dist/reporters/index.js +9 -5
- package/dist/rules/agents-privacy.js +5 -5
- package/dist/rules/code.js +26 -6
- package/dist/rules/infra.js +21 -7
- package/dist/rules/secrets.js +13 -5
- package/dist/rules/util.js +33 -2
- package/dist/scope.js +36 -10
- package/docs/assets/demo.svg +5 -0
- package/docs/assurance/README.md +28 -0
- package/docs/assurance/REVIEW-REQUEST.md +23 -0
- package/docs/assurance/TRUST-PLAN.md +31 -0
- package/docs/assurance/benchmark.md +148 -0
- package/docs/assurance/coverage-raw.txt +127 -0
- package/docs/assurance/coverage.md +34 -0
- package/docs/assurance/fuzz-results.json +130 -0
- package/docs/assurance/fuzzing.md +38 -0
- package/docs/assurance/internal-review.md +41 -0
- package/docs/assurance/npm-audit.json +22 -0
- package/docs/assurance/offline-verification.md +26 -0
- package/docs/assurance/sbom-full-dev.cdx.json +214 -0
- package/docs/assurance/sbom-production.cdx.json +61 -0
- package/docs/assurance/sbom-production.spdx.json +44 -0
- package/docs/assurance/supply-chain.md +42 -0
- package/docs/assurance/trademark-search.md +27 -0
- package/docs/compatibility.md +1 -1
- package/docs/gen-demo-svg.mjs +17 -0
- package/docs/gen-rules.mjs +6 -6
- package/docs/launch-kit.md +53 -0
- package/docs/quickstart.md +44 -38
- package/docs/releasing.md +16 -0
- package/docs/rules.md +2 -2
- package/docs/security-advisories.md +26 -0
- package/llms.txt +2 -0
- package/package.json +2 -2
package/dist/rules/infra.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isDockerfile, isK8s, isTerraform, isWorkflow, isYaml, lineRule } from "./util.js";
|
|
1
|
+
import { isDockerfile, isK8s, isTerraform, isWorkflow, isYaml, lineRule, lookBack } from "./util.js";
|
|
2
2
|
const wf = { version: "1.0.0", category: "cicd", agent: "PipelineGuard" };
|
|
3
3
|
const dk = { version: "1.0.0", category: "containers", agent: "ContainerGuard" };
|
|
4
4
|
const k8 = { version: "1.0.0", category: "containers", agent: "ContainerGuard" };
|
|
@@ -17,9 +17,9 @@ export const infraRules = [
|
|
|
17
17
|
falsePositives: "First-party `actions/*` references are lower risk; local `./` actions and Docker digests are skipped.",
|
|
18
18
|
verification: "Every `uses:` line for a non-local action ends in @<40 hex>.",
|
|
19
19
|
applies: isWorkflow,
|
|
20
|
-
check: (f) => lineRule(f, /^\s
|
|
20
|
+
check: (f) => lineRule(f, /^\s*(?:-\s*)?uses:\s*([^\s#]+)/, {
|
|
21
21
|
filter: (m) => {
|
|
22
|
-
const ref = m[1];
|
|
22
|
+
const ref = m[1].replace(/^['"]|['"]$/g, "");
|
|
23
23
|
if (ref.startsWith("./") || ref.startsWith("docker://"))
|
|
24
24
|
return false;
|
|
25
25
|
return !/@[0-9a-f]{40}$/.test(ref);
|
|
@@ -40,7 +40,7 @@ export const infraRules = [
|
|
|
40
40
|
verification: "Confirm no step after the checkout executes files from the PR head, or remove the head checkout.",
|
|
41
41
|
applies: isWorkflow,
|
|
42
42
|
check: (f) => {
|
|
43
|
-
if (
|
|
43
|
+
if (!/^[ \t]*pull_request_target[ \t]*:|\bon:[ \t]*\[?[^\n]*pull_request_target/m.test(f.text))
|
|
44
44
|
return [];
|
|
45
45
|
return lineRule(f, /ref:\s*\$\{\{\s*github\.(?:event\.pull_request\.head\.(?:sha|ref)|head_ref)\s*\}\}/);
|
|
46
46
|
}
|
|
@@ -118,6 +118,9 @@ export const infraRules = [
|
|
|
118
118
|
if (!froms.length)
|
|
119
119
|
return [];
|
|
120
120
|
const last = froms[froms.length - 1];
|
|
121
|
+
// Images published as non-root (for example distroless ":nonroot" tags) already default to an unprivileged user.
|
|
122
|
+
if (/nonroot|rootless/i.test(f.lines[last]))
|
|
123
|
+
return [];
|
|
121
124
|
const user = f.lines.slice(last).find((l) => /^\s*USER\s+(?!root\b|0\b)\S+/i.test(l));
|
|
122
125
|
return user ? [] : [{ line: last + 1, excerpt: f.lines[last] }];
|
|
123
126
|
}
|
|
@@ -168,7 +171,7 @@ export const infraRules = [
|
|
|
168
171
|
falsePositives: "Installers from a source you control and trust. Still no integrity verification.",
|
|
169
172
|
verification: "No `| sh` / `| bash` remains; a checksum verification step precedes execution.",
|
|
170
173
|
applies: (f) => isDockerfile(f) || f.ext === ".sh",
|
|
171
|
-
check: (f) => lineRule(f, /\b(?:curl|wget)\b[^|\n]*\|\s*(?:sudo\s+)?(?:ba|z)?sh\b/, { skipComments: true })
|
|
174
|
+
check: (f) => lineRule(f, /\b(?:curl|wget)\b[^|\n]*\|\s*(?:sudo\s+)?(?:ba|z)?sh\b/, { skipComments: true, filter: (_m, line) => !/\becho\s+["']/.test(line) })
|
|
172
175
|
},
|
|
173
176
|
{
|
|
174
177
|
...k8,
|
|
@@ -228,7 +231,15 @@ export const infraRules = [
|
|
|
228
231
|
falsePositives: "Intentionally public web ports (80/443) and egress rules. Review the port and direction.",
|
|
229
232
|
verification: "Ingress CIDRs are restricted or documented as intentionally public.",
|
|
230
233
|
applies: isTerraform,
|
|
231
|
-
check: (f) => lineRule(f, /["'](?:0\.0\.0\.0\/0|::\/0)["']/, {
|
|
234
|
+
check: (f) => lineRule(f, /["'](?:0\.0\.0\.0\/0|::\/0)["']/, {
|
|
235
|
+
skipComments: true,
|
|
236
|
+
filter: (_m, line, lineNo) => {
|
|
237
|
+
// Routes and egress rules are not internet-facing ingress.
|
|
238
|
+
if (/destination_(?:ipv6_)?cidr_block/.test(line))
|
|
239
|
+
return false;
|
|
240
|
+
return !(lookBack(f, lineNo, 6, /^\s*(?:route|egress)\s*\{/) || lookBack(f, lineNo, 6, /type\s*=\s*["']egress["']|egress_/));
|
|
241
|
+
}
|
|
242
|
+
})
|
|
232
243
|
},
|
|
233
244
|
{
|
|
234
245
|
...iac,
|
|
@@ -258,7 +269,10 @@ export const infraRules = [
|
|
|
258
269
|
falsePositives: "Deny statements and break-glass roles that are tightly controlled. Check Effect.",
|
|
259
270
|
verification: "Wildcard replaced with an explicit action list.",
|
|
260
271
|
applies: (f) => isTerraform(f) || f.ext === ".json" || isYaml(f),
|
|
261
|
-
check: (f) => lineRule(f, /["']?(?:Action|actions)["']?\s*[:=]\s*(?:\[\s*)?["']\*["']
|
|
272
|
+
check: (f) => lineRule(f, /["']?(?:Action|actions)["']?\s*[:=]\s*(?:\[\s*)?["']\*["']/, {
|
|
273
|
+
// A Deny statement with a wildcard is a guardrail, not a grant.
|
|
274
|
+
filter: (_m, _line, lineNo) => !lookBack(f, lineNo, 4, /\b[Ee]ffect["']?\s*[:=]\s*["']Deny["']/)
|
|
275
|
+
})
|
|
262
276
|
}
|
|
263
277
|
];
|
|
264
278
|
function risky(s) {
|
package/dist/rules/secrets.js
CHANGED
|
@@ -57,11 +57,13 @@ export const secretRules = [
|
|
|
57
57
|
status: "potential",
|
|
58
58
|
description: "A variable or key named like a password, secret, token or API key is assigned a non-placeholder string literal.",
|
|
59
59
|
falsePositives: "Test data, example config, i18n labels. Values that look like placeholders, environment lookups or templates are skipped.",
|
|
60
|
-
applies: (f) => !/\.(md|txt|lock)$/.test(f.name),
|
|
60
|
+
applies: (f) => !/\.(md|txt|lock)$/.test(f.name) && !/(^|\/)(i18n|locales?|lang|translations?)\//i.test(f.path),
|
|
61
61
|
check: (f) => lineRule(f, /(?:pass(?:word|wd)?|secret|api[_-]?key|auth[_-]?token|access[_-]?token|private[_-]?key|client[_-]?secret)["']?\s*[:=]\s*["']([^"'\s]{8,})["']/i, {
|
|
62
62
|
skipComments: true,
|
|
63
63
|
secretGroup: 1,
|
|
64
|
-
|
|
64
|
+
// Skip placeholders and variable references such as '$password' used in templates or SQL text.
|
|
65
|
+
// A real credential contains ASCII letters or digits; UI labels in other scripts do not.
|
|
66
|
+
filter: (m) => !isPlaceholder(m[1]) && !/^\$\{?\w+\}?$/.test(m[1]) && /[A-Za-z0-9]/.test(m[1])
|
|
65
67
|
})
|
|
66
68
|
},
|
|
67
69
|
{
|
|
@@ -84,9 +86,15 @@ export const secretRules = [
|
|
|
84
86
|
confidence: "medium",
|
|
85
87
|
status: "potential",
|
|
86
88
|
cwe: ["CWE-312", "CWE-798"],
|
|
87
|
-
description: "A `.env`-style file exists in the scanned tree. If it is tracked by git it exposes
|
|
88
|
-
falsePositives: "Files that are git-ignored and never committed. This scanner does not read git state in v0.1, so it cannot tell.",
|
|
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
91
|
applies: (f) => /^\.env(\..+)?$/.test(f.name) && !/\.(example|sample|template)$/.test(f.name),
|
|
90
|
-
check: (f) =>
|
|
92
|
+
check: (f) => {
|
|
93
|
+
const idx = f.lines.findIndex((l) => {
|
|
94
|
+
const m = /^\s*(?:export\s+)?([A-Za-z_][\w.]*)\s*=\s*["']?([^"'#\s]+)/.exec(l);
|
|
95
|
+
return !!m && /pass|secret|token|key|credential|private|auth/i.test(m[1]) && !isPlaceholder(m[2]) && !/^<.*>$/.test(m[2]);
|
|
96
|
+
});
|
|
97
|
+
return idx >= 0 ? [{ line: idx + 1, excerpt: "(file contents not shown)" }] : [];
|
|
98
|
+
}
|
|
91
99
|
}
|
|
92
100
|
];
|
package/dist/rules/util.js
CHANGED
|
@@ -7,7 +7,7 @@ export const isWorkflow = (f) => /^\.github\/workflows\/[^/]+\.ya?ml$/.test(f.pa
|
|
|
7
7
|
export const isDockerfile = (f) => /^dockerfile(\..+)?$/.test(f.name) || f.name.endsWith(".dockerfile");
|
|
8
8
|
export const isYaml = (f) => f.ext === ".yaml" || f.ext === ".yml";
|
|
9
9
|
export const isTerraform = (f) => f.ext === ".tf";
|
|
10
|
-
export const isK8s = (f) => isYaml(f) &&
|
|
10
|
+
export const isK8s = (f) => isYaml(f) && /^[ \t]*apiVersion:/m.test(f.text) && /^[ \t]*kind:[ \t]*(Pod|Deployment|StatefulSet|DaemonSet|Job|CronJob|ReplicaSet)\b/m.test(f.text);
|
|
11
11
|
/** True for a line that is only a comment in the common syntaxes we scan. */
|
|
12
12
|
export function isCommentLine(line) {
|
|
13
13
|
return /^\s*(\/\/|#|\*|\/\*|<!--)/.test(line);
|
|
@@ -16,6 +16,7 @@ export function isCommentLine(line) {
|
|
|
16
16
|
export function isPlaceholder(value) {
|
|
17
17
|
const v = value.trim();
|
|
18
18
|
return (v.length < 8 ||
|
|
19
|
+
/^\[?redacted\]?$/i.test(v) ||
|
|
19
20
|
/^(x+|\*+|\.+|<.*>|\$\{.*\}|\{\{.*\}\}|%.*%|your[-_ ]|example|changeme|change[-_]me|placeholder|dummy|sample|test|todo|password|secret|none|null|undefined|process\.env|os\.environ|env\()/i.test(v) ||
|
|
20
21
|
/(^|[^a-z])(example|placeholder|dummy|changeme|xxxx)/i.test(v));
|
|
21
22
|
}
|
|
@@ -31,7 +32,7 @@ export function lineRule(file, re, opts = {}) {
|
|
|
31
32
|
const m = g.exec(line);
|
|
32
33
|
if (!m)
|
|
33
34
|
return;
|
|
34
|
-
if (opts.filter && !opts.filter(m, line))
|
|
35
|
+
if (opts.filter && !opts.filter(m, line, i + 1))
|
|
35
36
|
return;
|
|
36
37
|
const hit = { line: i + 1, excerpt: line };
|
|
37
38
|
if (opts.secretGroup !== undefined) {
|
|
@@ -43,3 +44,33 @@ export function lineRule(file, re, opts = {}) {
|
|
|
43
44
|
});
|
|
44
45
|
return hits;
|
|
45
46
|
}
|
|
47
|
+
/** True when index `idx` of `line` is inside a single-, double- or backtick-quoted string. */
|
|
48
|
+
export function insideString(line, idx) {
|
|
49
|
+
let quote = "";
|
|
50
|
+
for (let i = 0; i < idx; i++) {
|
|
51
|
+
const c = line[i];
|
|
52
|
+
if (quote) {
|
|
53
|
+
if (c === "\\")
|
|
54
|
+
i++;
|
|
55
|
+
else if (c === quote)
|
|
56
|
+
quote = "";
|
|
57
|
+
}
|
|
58
|
+
else if (c === '"' || c === "'" || c === "`")
|
|
59
|
+
quote = c;
|
|
60
|
+
}
|
|
61
|
+
return quote !== "";
|
|
62
|
+
}
|
|
63
|
+
/** Line with the contents of string literals removed, to test identifiers only. */
|
|
64
|
+
export function stripStrings(line) {
|
|
65
|
+
return line.replace(/"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|`(?:[^`\\]|\\.)*`/g, '""');
|
|
66
|
+
}
|
|
67
|
+
/** Looks back up to `n` lines (inclusive of the hit line) for a pattern. */
|
|
68
|
+
export function lookBack(f, line, n, re) {
|
|
69
|
+
for (let i = Math.max(0, line - 1 - n); i <= line - 1; i++)
|
|
70
|
+
if (re.test(f.lines[i] ?? ""))
|
|
71
|
+
return true;
|
|
72
|
+
return false;
|
|
73
|
+
}
|
|
74
|
+
const TEST_PATH = /(^|\/)(tests?|__tests__|specs?|testdata|test_data|fixtures?|e2e|cypress|examples?|_archived|samples?|vendor|third[_-]?party|mocks?)(\/|$)|\.(test|spec)\.[cm]?[jt]sx?$|(^|\/)test_[^/]+\.py$|_test\.(go|py)$|\.min\.js$/i;
|
|
75
|
+
/** Paths where a matching construct is usually a test, demo, archived example or vendored code. */
|
|
76
|
+
export const isTestPath = (p) => TEST_PATH.test(p);
|
package/dist/scope.js
CHANGED
|
@@ -1,15 +1,36 @@
|
|
|
1
|
-
import { lstatSync, readdirSync,
|
|
2
|
-
import { join, basename, extname } from "node:path";
|
|
1
|
+
import { lstatSync, readdirSync, realpathSync, openSync, readSync, closeSync, fstatSync } from "node:fs";
|
|
2
|
+
import { join, basename, extname, relative, isAbsolute } from "node:path";
|
|
3
3
|
import { makeIgnoreMatcher } from "./policy.js";
|
|
4
|
-
|
|
4
|
+
/** True when `p` is `root` or lies beneath it (case-insensitive on Windows). */
|
|
5
|
+
export function isInside(root, p) {
|
|
6
|
+
const fix = (s) => (process.platform === "win32" ? s.toLowerCase() : s);
|
|
7
|
+
const rel = relative(fix(root), fix(p));
|
|
8
|
+
return rel === "" || (!rel.startsWith("..") && !isAbsolute(rel));
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Opens the file once and reads it through that descriptor. Defence against a time-of-check/time-of-use
|
|
12
|
+
* swap: if the path was replaced by a symlink after the earlier lstat, the descriptor refers to a
|
|
13
|
+
* different file, so its device/inode no longer match and the file is refused.
|
|
14
|
+
*/
|
|
15
|
+
function readChecked(abs, expected) {
|
|
5
16
|
const fd = openSync(abs, "r");
|
|
6
17
|
try {
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
18
|
+
const now = fstatSync(fd);
|
|
19
|
+
if (!now.isFile() || (expected.ino !== 0 && (now.ino !== expected.ino || now.dev !== expected.dev)))
|
|
20
|
+
return "swapped";
|
|
21
|
+
const buf = Buffer.alloc(now.size);
|
|
22
|
+
let off = 0;
|
|
23
|
+
while (off < buf.length) {
|
|
24
|
+
const n = readSync(fd, buf, off, buf.length - off, off);
|
|
25
|
+
if (n === 0)
|
|
26
|
+
break;
|
|
27
|
+
off += n;
|
|
28
|
+
}
|
|
29
|
+
const head = Math.min(off, 8192);
|
|
30
|
+
for (let i = 0; i < head; i++)
|
|
10
31
|
if (buf[i] === 0)
|
|
11
|
-
return
|
|
12
|
-
return
|
|
32
|
+
return "binary";
|
|
33
|
+
return buf.toString("utf8", 0, off);
|
|
13
34
|
}
|
|
14
35
|
finally {
|
|
15
36
|
closeSync(fd);
|
|
@@ -95,11 +116,16 @@ export function inventory(rootInput, policy) {
|
|
|
95
116
|
return;
|
|
96
117
|
}
|
|
97
118
|
try {
|
|
98
|
-
|
|
119
|
+
const got = readChecked(abs, st);
|
|
120
|
+
if (got === "swapped") {
|
|
121
|
+
stats.skippedSymlinks++;
|
|
122
|
+
continue;
|
|
123
|
+
}
|
|
124
|
+
if (got === "binary") {
|
|
99
125
|
stats.skippedBinary++;
|
|
100
126
|
continue;
|
|
101
127
|
}
|
|
102
|
-
const text =
|
|
128
|
+
const text = got;
|
|
103
129
|
files.push({
|
|
104
130
|
path: rel,
|
|
105
131
|
name: e.name.toLowerCase(),
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 880 653" width="880" role="img" aria-label="VigilSutra audit of the intentionally insecure demo project: 16 findings">
|
|
2
|
+
<title>vigilsutra audit examples/intentionally-insecure (real output)</title>
|
|
3
|
+
<rect width="880" height="653" rx="10" fill="#0d1117"/><rect width="880" height="34" rx="10" fill="#161b22"/>
|
|
4
|
+
<circle cx="20" cy="17" r="6" fill="#ff5f56"/><circle cx="40" cy="17" r="6" fill="#ffbd2e"/><circle cx="60" cy="17" r="6" fill="#27c93f"/>
|
|
5
|
+
<g font-family="ui-monospace,SFMono-Regular,Menlo,Consolas,monospace" font-size="12.5"><text x="22" y="62" fill="#56d364">$</text><text x="40" y="62" fill="#c9d1d9">vigilsutra audit examples/intentionally-insecure</text><text x="22" y="81" fill="#c9d1d9" xml:space="preserve">VigilSutra AI 0.1.0 - local read-only audit of "intentionally-insecure"</text><text x="22" y="100" fill="#c9d1d9" xml:space="preserve">Scanned 5 files (1200 bytes). Skipped: 0 ignored, 0 symlinks, 0 too large, 0 binary.</text><text x="22" y="119" fill="#c9d1d9" xml:space="preserve">Detected: docker, terraform, github-actions, kubernetes</text><text x="22" y="138" fill="#ff7b72" xml:space="preserve">HIGH VS-CICD-002 pull_request_target workflow checks out pull-request code</text><text x="22" y="157" fill="#c9d1d9" xml:space="preserve"> .github/workflows/ci.yml:10 [potential, confidence medium]</text><text x="22" y="176" fill="#c9d1d9" xml:space="preserve"> evidence: ref: ${{ github.event.pull_request.head.sha }}</text><text x="22" y="195" fill="#ff7b72" xml:space="preserve">HIGH VS-CICD-004 Untrusted GitHub context interpolated into a shell step</text><text x="22" y="214" fill="#c9d1d9" xml:space="preserve"> .github/workflows/ci.yml:11 [potential, confidence medium]</text><text x="22" y="233" fill="#c9d1d9" xml:space="preserve"> evidence: - run: echo "Title is ${{ github.event.pull_request.title }}"</text><text x="22" y="252" fill="#ff7b72" xml:space="preserve">HIGH VS-K8S-002 Pod shares host network, PID or IPC namespace</text><text x="22" y="271" fill="#c9d1d9" xml:space="preserve"> deployment.yaml:8 [confirmed, confidence high]</text><text x="22" y="290" fill="#c9d1d9" xml:space="preserve"> evidence: hostNetwork: true</text><text x="22" y="309" fill="#ff7b72" xml:space="preserve">HIGH VS-K8S-001 Kubernetes container runs privileged</text><text x="22" y="328" fill="#c9d1d9" xml:space="preserve"> deployment.yaml:13 [confirmed, confidence high]</text><text x="22" y="347" fill="#c9d1d9" xml:space="preserve"> evidence: privileged: true</text><text x="22" y="366" fill="#ff7b72" xml:space="preserve">HIGH VS-IAC-002 Public-read or public-write storage ACL</text><text x="22" y="385" fill="#c9d1d9" xml:space="preserve"> main.tf:9 [confirmed, confidence high]</text><text x="22" y="404" fill="#c9d1d9" xml:space="preserve"> evidence: acl = "public-read"</text><text x="22" y="423" fill="#ff7b72" xml:space="preserve">HIGH VS-CODE-002 Shell command built from a dynamic string</text><text x="22" y="442" fill="#c9d1d9" xml:space="preserve"> server.js:5 [potential, confidence medium]</text><text x="22" y="461" fill="#c9d1d9" xml:space="preserve"> evidence: exec(`ping -c 1 ${req.query.host}`, () => res.send("ok"));</text><text x="22" y="480" fill="#ff7b72" xml:space="preserve">HIGH VS-CODE-004 SQL query built with string concatenation or interpolation</text><text x="22" y="499" fill="#c9d1d9" xml:space="preserve"> server.js:6 [potential, confidence medium]</text><text x="22" y="518" fill="#c9d1d9" xml:space="preserve"> evidence: db.query("SELECT * FROM users WHERE id = " + req.query.id);</text><text x="22" y="537" fill="#ff7b72" xml:space="preserve">HIGH VS-CODE-001 Dynamic code execution (eval / new Function / exec)</text><text x="22" y="556" fill="#c9d1d9" xml:space="preserve"> server.js:7 [potential, confidence medium]</text><text x="22" y="575" fill="#c9d1d9" xml:space="preserve"> evidence: eval(req.body.expr);</text><text x="22" y="594" fill="#e3b341" xml:space="preserve">MEDIUM VS-CICD-003 Workflow grants write-all permissions</text><text x="22" y="613" fill="#c9d1d9" xml:space="preserve"> .github/workflows/ci.yml:3 [confirmed, confidence high]</text><text x="22" y="632" fill="#c9d1d9" xml:space="preserve"> evidence: permissions: write-all</text></g></svg>
|
|
@@ -0,0 +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).
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Request for independent review
|
|
2
|
+
|
|
3
|
+
VigilSutra has had **no independent review**. If you are a security engineer, you can help build (or break) trust in it.
|
|
4
|
+
|
|
5
|
+
## What to review
|
|
6
|
+
|
|
7
|
+
| Area | Where | Questions |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Scope safety | `src/scope.ts`, `src/policy.ts` | Can a hostile repository make the scan read outside the project, hang, or hide findings? |
|
|
10
|
+
| Redaction | `src/engine.ts`, `src/redact.ts`, `src/reporters/` | Can any secret value reach a report, fingerprint, console or SARIF? |
|
|
11
|
+
| Rules | `src/rules/` | Are the claims in each rule's description and false-positive text true? |
|
|
12
|
+
| Report safety | `src/reporters/index.ts` | HTML, Markdown and SARIF injection |
|
|
13
|
+
| Adapter | `src/adapters.ts`, `agents/*/SKILL.md` | Install/uninstall safety; could a skill be abused through a hostile repository? |
|
|
14
|
+
| Supply chain | `package.json`, `.github/workflows/` | Release process, pinning, permissions |
|
|
15
|
+
|
|
16
|
+
## How
|
|
17
|
+
|
|
18
|
+
1. Read [internal-review.md](internal-review.md) and [the threat model](../threat-model.md).
|
|
19
|
+
2. Run `npm ci && npm test` and the [benchmark](benchmark.md) workflow.
|
|
20
|
+
3. Open a **private** report for anything exploitable (see [SECURITY.md](../../SECURITY.md)), or a normal issue for false positives and documentation errors.
|
|
21
|
+
4. If you are willing to be named, say so. A short signed-off statement ("reviewed commit X, scope Y, findings Z") will be added to [security-advisories.md](../security-advisories.md) with your permission.
|
|
22
|
+
|
|
23
|
+
Labels in the benchmark were assigned by an AI assistant. Independent re-labeling of `benchmarks/labels-*.json` is equally welcome: open a pull request with your disagreements.
|
|
@@ -0,0 +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. Version 0.1.0 on npm has 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.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Real-world benchmark
|
|
2
|
+
|
|
3
|
+
> Generated by `node benchmarks/report.mjs`. Raw data is in `benchmarks/` (labels, comparison, versions). Re-run with `node benchmarks/run.mjs` or the manual **benchmark** workflow.
|
|
4
|
+
|
|
5
|
+
## What was measured
|
|
6
|
+
|
|
7
|
+
VigilSutra was run on **18 public repositories** (shallow clones at the commits below, read-only, nothing executed): 7 deliberately vulnerable projects and 11 mainstream projects. The first run used the released rules (v0.1.0). 240 findings were labeled in three samples, the false positives were studied, the rules were fixed, and the same commits were scanned again to check that real findings were kept.
|
|
8
|
+
|
|
9
|
+
### Labeling rubric
|
|
10
|
+
|
|
11
|
+
| Label | Meaning |
|
|
12
|
+
|---|---|
|
|
13
|
+
| TP | reviewing it would plausibly reveal a real weakness in the project's own code or configuration |
|
|
14
|
+
| TT | the construct is real but only in tests, fixtures, test data, archived examples or vendored/minified code |
|
|
15
|
+
| FP | the rule misread the code, or the construct is not a security issue in context |
|
|
16
|
+
|
|
17
|
+
> **Warning:** labels were assigned by the maintainer's AI assistant, not by an independent human reviewer. They are an honest first pass and are published in `benchmarks/labels-v0.1.0.json` so anyone can disagree and re-label. Three labels were corrected during regression checks (egress rules first read as ingress), which shows the first pass is imperfect.
|
|
18
|
+
|
|
19
|
+
### Sampling
|
|
20
|
+
|
|
21
|
+
Up to 8 findings per rule, spread round-robin across repositories in fingerprint order (deterministic, **not random**). High-volume rules are therefore under-represented, and the numbers below are **not** population estimates. Sample C was drawn from findings not in A or B, up to 3 per rule, after the last fix.
|
|
22
|
+
|
|
23
|
+
## Repositories
|
|
24
|
+
|
|
25
|
+
| Repository | Kind | Commit | Files | Size (MiB) | Scan time on CI (ms) | Findings now |
|
|
26
|
+
|---|---|---|---|---|---|---|
|
|
27
|
+
| juice-shop/juice-shop | vulnerable-by-design | `717f5ef` | 1172 | 13.6 | 424 | 221 |
|
|
28
|
+
| OWASP/NodeGoat | vulnerable-by-design | `c5cb68a` | 92 | 0.3 | 18 | 20 |
|
|
29
|
+
| appsecco/dvna | vulnerable-by-design | `9ba473a` | 126 | 0.8 | 14 | 3 |
|
|
30
|
+
| bridgecrewio/terragoat | vulnerable-by-design | `729f8da` | 66 | 0.5 | 18 | 26 |
|
|
31
|
+
| madhuakula/kubernetes-goat | vulnerable-by-design | `723a0db` | 243 | 1 | 45 | 36 |
|
|
32
|
+
| we45/Vulnerable-Flask-App | vulnerable-by-design | `b6a4f97` | 18 | 0.1 | 5 | 20 |
|
|
33
|
+
| digininja/DVWA | vulnerable-by-design | `a1978a2` | 233 | 1 | 26 | 20 |
|
|
34
|
+
| expressjs/express | mainstream | `1c6f1b0` | 216 | 0.7 | 44 | 1 |
|
|
35
|
+
| pallets/flask | mainstream | `49943b5` | 231 | 1.4 | 46 | 4 |
|
|
36
|
+
| psf/requests | mainstream | `3c7baaa` | 124 | 1.5 | 29 | 8 |
|
|
37
|
+
| docker/awesome-compose | mainstream | `30f4b7f` | 426 | 0.5 | 30 | 36 |
|
|
38
|
+
| actions/starter-workflows | mainstream | `e3c451d` | 503 | 1.4 | 37 | 14 |
|
|
39
|
+
| terraform-aws-modules/terraform-aws-vpc | mainstream | `b3abd6d` | 111 | 0.9 | 19 | 78 |
|
|
40
|
+
| kubernetes/examples | mainstream | `22934a0` | 453 | 0.8 | 35 | 33 |
|
|
41
|
+
| modelcontextprotocol/servers | mainstream | `194cc86` | 357 | 4 | 139 | 58 |
|
|
42
|
+
| fastify/fastify | mainstream | `5b9c009` | 392 | 2.9 | 125 | 22 |
|
|
43
|
+
| django/django | mainstream | `a05e16a` | 5635 | 34.9 | 1260 | 191 |
|
|
44
|
+
| prometheus/prometheus | mainstream | `ef78ff6` | 1707 | 17.6 | 353 | 23 |
|
|
45
|
+
|
|
46
|
+
Timing is from a GitHub-hosted Ubuntu runner. The largest repository (django, 5635 files) took 1260 ms. No crash, hang or truncation occurred on any repository.
|
|
47
|
+
|
|
48
|
+
## Results
|
|
49
|
+
|
|
50
|
+
| | v0.1.0 rules | After fixes |
|
|
51
|
+
|---|---|---|
|
|
52
|
+
| Total findings on the 18 repos | 1000 | 814 |
|
|
53
|
+
| Findings outside test, example and vendored paths | not tracked | 443 |
|
|
54
|
+
| Findings in test, example and vendored paths (confidence lowered) | not tracked | 371 |
|
|
55
|
+
|
|
56
|
+
### Three labeled samples
|
|
57
|
+
|
|
58
|
+
| Sample | Labeled | TP | TT | FP (share when labeled) | Still reported now (TP/TT/FP) | Role |
|
|
59
|
+
|---|---|---|---|---|---|---|
|
|
60
|
+
| A: released v0.1.0 rules | 140 | 65 | 50 | 25 (18%) | 64/42/2 | found the first false-positive classes; **rules were tuned on it** |
|
|
61
|
+
| B: drawn after round-1 fixes | 68 | 31 | 30 | 7 (10%) | 31/30/2 | found more classes; **rules were tuned on it** |
|
|
62
|
+
| C: drawn after all fixes | 32 | 18 | 14 | 0 (0%) | 18/14/0 | **never used for tuning**; the honest estimate |
|
|
63
|
+
|
|
64
|
+
Reading it: with the released rules the false-positive share in sample A was **18%**. After round-1 fixes it was **10%** in a fresh sample (B). After round-2 fixes, a third fresh sample (C) of 32 findings had **0 false positives**. With so few samples that does not mean zero: the 95% upper bound for 0 of 32 is about 9% (rule of three). Across the 18 repositories 443 of 814 findings sit outside test, example and vendored paths.
|
|
65
|
+
|
|
66
|
+
Of the labeled true positives in A and B, 1 are no longer reported (listed below). Sample A/B false positives still reported now: 4 (non-security uses of MD5 or SHA-1, and one `eval` of server-generated numbers, which a pattern cannot tell apart).
|
|
67
|
+
|
|
68
|
+
### Per rule (all 240 labeled findings, three samples combined)
|
|
69
|
+
|
|
70
|
+
| Rule | Findings v0.1.0 | Findings now | Labeled | TP | TT | FP | FP still reported |
|
|
71
|
+
|---|---|---|---|---|---|---|---|
|
|
72
|
+
| VS-CICD-001 | 193 | 185 | 16 | 15 | 0 | 1 | 0 |
|
|
73
|
+
| VS-CODE-001 | 32 | 27 | 16 | 7 | 6 | 3 | 1 |
|
|
74
|
+
| VS-CODE-002 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
|
|
75
|
+
| VS-CODE-003 | 98 | 29 | 16 | 4 | 12 | 0 | 0 |
|
|
76
|
+
| VS-CODE-004 | 35 | 35 | 16 | 9 | 7 | 0 | 0 |
|
|
77
|
+
| VS-CODE-005 | 17 | 16 | 16 | 0 | 15 | 1 | 0 |
|
|
78
|
+
| VS-CODE-006 | 19 | 16 | 16 | 3 | 9 | 4 | 3 |
|
|
79
|
+
| VS-CODE-007 | 27 | 19 | 16 | 7 | 5 | 4 | 0 |
|
|
80
|
+
| VS-DOCKER-001 | 75 | 74 | 16 | 12 | 3 | 1 | 0 |
|
|
81
|
+
| VS-DOCKER-002 | 10 | 10 | 10 | 6 | 4 | 0 | 0 |
|
|
82
|
+
| VS-DOCKER-003 | 4 | 3 | 4 | 2 | 1 | 1 | 0 |
|
|
83
|
+
| VS-IAC-001 | 106 | 75 | 16 | 9 | 1 | 6 | 0 |
|
|
84
|
+
| VS-IAC-002 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
|
|
85
|
+
| VS-IAC-003 | 2 | 1 | 2 | 1 | 0 | 1 | 0 |
|
|
86
|
+
| VS-K8S-001 | 12 | 12 | 12 | 6 | 6 | 0 | 0 |
|
|
87
|
+
| VS-K8S-002 | 15 | 15 | 15 | 7 | 8 | 0 | 0 |
|
|
88
|
+
| VS-K8S-003 | 2 | 2 | 2 | 2 | 0 | 0 | 0 |
|
|
89
|
+
| VS-PRIV-001 | 2 | 0 | 2 | 1 | 0 | 1 | 0 |
|
|
90
|
+
| VS-PROC-001 | 10 | 10 | 10 | 10 | 0 | 0 | 0 |
|
|
91
|
+
| VS-SECRET-001 | 1 | 1 | 1 | 1 | 0 | 0 | 0 |
|
|
92
|
+
| VS-SECRET-002 | 13 | 13 | 13 | 4 | 9 | 0 | 0 |
|
|
93
|
+
| VS-SECRET-004 | 318 | 269 | 16 | 6 | 7 | 3 | 0 |
|
|
94
|
+
| VS-SECRET-006 | 7 | 0 | 7 | 0 | 1 | 6 | 0 |
|
|
95
|
+
|
|
96
|
+
### True positives lost by the fixes
|
|
97
|
+
|
|
98
|
+
- `we45__Vulnerable-Flask-App|app/app.py|87|VS-PRIV-001`: the log call prints a decoded JWT inside a format string; the rule now only flags sensitive identifiers outside string literals. Accepted trade-off.
|
|
99
|
+
|
|
100
|
+
## What the fixes were
|
|
101
|
+
|
|
102
|
+
- Quoted local reusable workflows (`uses: './x.yml'`) were treated as third-party actions.
|
|
103
|
+
- `eval(`, `innerHTML=` and `document.write(` inside string literals, and `eval` of a constant string, were reported as calls.
|
|
104
|
+
- `jwt.decode(..., verify=False)` (token signature) was reported as TLS verification disabled.
|
|
105
|
+
- `hashlib.sha1(..., usedforsecurity=False)`, `pickle.loads(pickle.dumps(x))` round-trips, `echo` text containing `curl | sh`, route and egress rules, wildcard `Effect: Deny` statements and `password = '$variable'` templates were reported.
|
|
106
|
+
- `.env` files were reported even when they held only placeholders; a secret-named variable with a real-looking value is now required.
|
|
107
|
+
- Findings under test, example, archived and vendored paths are kept but marked `pathContext: test-or-example` with low confidence.
|
|
108
|
+
|
|
109
|
+
## Anecdotal known-issue spot checks (not a recall measurement)
|
|
110
|
+
|
|
111
|
+
On the deliberately vulnerable repositories VigilSutra reported, among others: command injection and `eval` of request data (NodeGoat, DVNA), SQL built by string interpolation (Juice Shop code-fix snippets), `yaml.load` on request data and MD5 password hashing (Vulnerable-Flask-App), a public-read-write bucket, a wildcard custom role and a hardcoded database password (TerraGoat), privileged containers and host namespaces (Kubernetes Goat), and a committed private key (NodeGoat). These are examples that were found, **not** a list of what was missed.
|
|
112
|
+
|
|
113
|
+
## Comparison with other open-source scanners
|
|
114
|
+
|
|
115
|
+
Same commits, same Linux CI run (gitleaks 8.30.1, semgrep 1.183.0). Unit: files with at least one finding, summed over the repositories.
|
|
116
|
+
|
|
117
|
+
### Secrets: VigilSutra vs Gitleaks
|
|
118
|
+
|
|
119
|
+
| | Files |
|
|
120
|
+
|---|---|
|
|
121
|
+
| Flagged by VigilSutra secret rules | 99 |
|
|
122
|
+
| Flagged by Gitleaks | 75 |
|
|
123
|
+
| Both | 35 |
|
|
124
|
+
| Only VigilSutra | 64 |
|
|
125
|
+
| Only Gitleaks | 40 |
|
|
126
|
+
|
|
127
|
+
Gitleaks found things VigilSutra does not, mainly generic API keys (30 files), JWTs and Kubernetes secrets, because VigilSutra has only six secret rules. VigilSutra's extra files mostly come from its broad hardcoded-credential rule (many are test files) and the `.env` rule. **Gitleaks is the better secrets scanner**, and it also scans git history, which VigilSutra does not. Use both.
|
|
128
|
+
|
|
129
|
+
### Code and configuration: VigilSutra vs Semgrep (`p/security-audit`)
|
|
130
|
+
|
|
131
|
+
| | Files |
|
|
132
|
+
|---|---|
|
|
133
|
+
| Flagged by VigilSutra (code, CI, container, IaC, agent rules) | 239 |
|
|
134
|
+
| Flagged by Semgrep | 179 (562 findings) |
|
|
135
|
+
| Both | 17 |
|
|
136
|
+
| Only VigilSutra | 222 |
|
|
137
|
+
| Only Semgrep | 162 |
|
|
138
|
+
|
|
139
|
+
The overlap is small because the tools look at different things. That Semgrep ruleset is dominated by framework-specific rules (the most frequent were custom-expression-as-sql, template-blocktranslate-no-escape, extends-custom-expression), while VigilSutra's findings are mostly CI workflows, Dockerfiles, Kubernetes and Terraform. They complement each other; **VigilSutra does not replace Semgrep** for code analysis. Trivy and CodeQL were not compared.
|
|
140
|
+
|
|
141
|
+
## Not measured
|
|
142
|
+
|
|
143
|
+
- Recall against a labeled ground truth, on any repository.
|
|
144
|
+
- The false-positive rate of high-volume rules at population level (the sample is stratified, not random).
|
|
145
|
+
- Independent (human) labels.
|
|
146
|
+
- Comparison with Trivy or CodeQL.
|
|
147
|
+
- Languages VigilSutra has no rules for (Java, Go, PHP and C# code get only secret, CI and config rules).
|
|
148
|
+
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
✔ no rule throws on adversarial, malformed or random input (377.8261ms)
|
|
2
|
+
✔ ReDoS guard: each rule handles 1,000 adversarial 1,990-character lines quickly (26177.0091ms)
|
|
3
|
+
✔ lines above 2,000 characters are skipped by line rules rather than scanned (0.9168ms)
|
|
4
|
+
✔ malformed Unicode, NUL bytes and huge single lines do not crash a full audit (83.1693ms)
|
|
5
|
+
✔ policy parser survives deep, huge and hostile input without hanging (47.8608ms)
|
|
6
|
+
✔ JSON baseline and previous-result inputs that are hostile are rejected, not trusted (6841.1173ms)
|
|
7
|
+
✔ preload really blocks and records network, DNS and subprocess attempts (self-check) (779.9545ms)
|
|
8
|
+
✔ every offline command runs to completion with the network and subprocesses blocked (13349.6825ms)
|
|
9
|
+
✔ every rule has metadata and unique id (2.7892ms)
|
|
10
|
+
✔ VS-SECRET-001: vulnerable fixture flagged, clean fixture not (38.2638ms)
|
|
11
|
+
✔ VS-SECRET-002: vulnerable fixture flagged, clean fixture not (33.9911ms)
|
|
12
|
+
✔ VS-SECRET-003: vulnerable fixture flagged, clean fixture not (44.9974ms)
|
|
13
|
+
✔ VS-SECRET-004: vulnerable fixture flagged, clean fixture not (43.4831ms)
|
|
14
|
+
✔ VS-SECRET-005: vulnerable fixture flagged, clean fixture not (53.308ms)
|
|
15
|
+
✔ VS-SECRET-006: vulnerable fixture flagged, clean fixture not (53.7492ms)
|
|
16
|
+
✔ VS-SECRET-006: vulnerable fixture flagged, clean fixture not (35.1251ms)
|
|
17
|
+
✔ VS-CICD-001: vulnerable fixture flagged, clean fixture not (62.2842ms)
|
|
18
|
+
✔ VS-CICD-002: vulnerable fixture flagged, clean fixture not (47.2792ms)
|
|
19
|
+
✔ VS-CICD-003: vulnerable fixture flagged, clean fixture not (42.4921ms)
|
|
20
|
+
✔ VS-CICD-004: vulnerable fixture flagged, clean fixture not (40.8719ms)
|
|
21
|
+
✔ VS-DOCKER-001: vulnerable fixture flagged, clean fixture not (28.4402ms)
|
|
22
|
+
✔ VS-DOCKER-002: vulnerable fixture flagged, clean fixture not (45.7507ms)
|
|
23
|
+
✔ VS-DOCKER-003: vulnerable fixture flagged, clean fixture not (45.7238ms)
|
|
24
|
+
✔ VS-K8S-001: vulnerable fixture flagged, clean fixture not (41.9957ms)
|
|
25
|
+
✔ VS-K8S-002: vulnerable fixture flagged, clean fixture not (42.0682ms)
|
|
26
|
+
✔ VS-K8S-003: vulnerable fixture flagged, clean fixture not (57.1514ms)
|
|
27
|
+
✔ VS-IAC-001: vulnerable fixture flagged, clean fixture not (32.4774ms)
|
|
28
|
+
✔ VS-IAC-002: vulnerable fixture flagged, clean fixture not (27.3414ms)
|
|
29
|
+
✔ VS-IAC-003: vulnerable fixture flagged, clean fixture not (34.8101ms)
|
|
30
|
+
✔ VS-CODE-001: vulnerable fixture flagged, clean fixture not (78.4681ms)
|
|
31
|
+
✔ VS-CODE-002: vulnerable fixture flagged, clean fixture not (30.0228ms)
|
|
32
|
+
✔ VS-CODE-003: vulnerable fixture flagged, clean fixture not (35.4438ms)
|
|
33
|
+
✔ VS-CODE-004: vulnerable fixture flagged, clean fixture not (44.2037ms)
|
|
34
|
+
✔ VS-CODE-005: vulnerable fixture flagged, clean fixture not (56.0302ms)
|
|
35
|
+
✔ VS-CODE-006: vulnerable fixture flagged, clean fixture not (51.105ms)
|
|
36
|
+
✔ VS-CODE-007: vulnerable fixture flagged, clean fixture not (38.1171ms)
|
|
37
|
+
✔ VS-AGENT-001: vulnerable fixture flagged, clean fixture not (36.6574ms)
|
|
38
|
+
✔ VS-AGENT-002: vulnerable fixture flagged, clean fixture not (46.8111ms)
|
|
39
|
+
✔ VS-AGENT-003: vulnerable fixture flagged, clean fixture not (43.9599ms)
|
|
40
|
+
✔ VS-PRIV-001: vulnerable fixture flagged, clean fixture not (67.3408ms)
|
|
41
|
+
✔ VS-PRIV-002: vulnerable fixture flagged, clean fixture not (62.3239ms)
|
|
42
|
+
✔ VS-PROC-001 fires without SECURITY.md and not with it (34.4246ms)
|
|
43
|
+
✔ secrets never appear in any report format (29.8334ms)
|
|
44
|
+
✔ fingerprints and ordering are deterministic across scans (30.7857ms)
|
|
45
|
+
✔ fingerprint survives line shifts (34.8053ms)
|
|
46
|
+
﹣ symlinks are not followed outside the root (14.6457ms) # cannot create symlinks on this system
|
|
47
|
+
✔ paths with spaces and non-ASCII characters work (23.2082ms)
|
|
48
|
+
✔ CRLF files report correct line numbers (10.0719ms)
|
|
49
|
+
✔ size limit and binary files are skipped and counted (21.8001ms)
|
|
50
|
+
✔ default ignores skip node_modules at any depth but not .env (56.1022ms)
|
|
51
|
+
✔ HTML report escapes untrusted content (27.4176ms)
|
|
52
|
+
✔ malicious repo instructions do not change scan scope or behavior (126.7471ms)
|
|
53
|
+
✔ SARIF output has the required 2.1.0 structure (10.4406ms)
|
|
54
|
+
✔ JSON result matches the published schema's required keys (13.6363ms)
|
|
55
|
+
✔ source never imports network modules (offline guarantee) (3.5476ms)
|
|
56
|
+
✔ scan does not modify the target project (21.1899ms)
|
|
57
|
+
✔ policy parser rejects unknown keys and bad values (1.775ms)
|
|
58
|
+
✔ CLI: exit codes, fail-on, formats and output file (8622.3041ms)
|
|
59
|
+
✔ CLI: failOn from .vigilsutra.yml applies when --fail-on is absent (2067.2818ms)
|
|
60
|
+
✔ CLI: rules list, explain, doctor, help (4289.9163ms)
|
|
61
|
+
✔ baseline suppresses accepted findings; verify reports changes (2360.5497ms)
|
|
62
|
+
✔ init creates policy once and never overwrites (1844.577ms)
|
|
63
|
+
✔ adapters: claude install is previewable, non-destructive, and reversible (2822.2128ms)
|
|
64
|
+
✔ every shipped SKILL.md has valid frontmatter and a registry entry (3.7678ms)
|
|
65
|
+
✔ false-positive regression: VS-CICD-001 does not fire on "jobs:\n b:\n uses: './.github/workflows/c.y (14.382ms)
|
|
66
|
+
✔ false-positive regression: VS-CODE-001 does not fire on "var B = eval(\"require('buffer').Buffer\");" (8.7207ms)
|
|
67
|
+
✔ false-positive regression: VS-CODE-001 does not fire on "var x = 'javascript:eval(document.body.innerHTM (11.7166ms)
|
|
68
|
+
✔ false-positive regression: VS-CODE-005 does not fire on "decoded = jwt.decode(token, verify = False)" (11.1974ms)
|
|
69
|
+
✔ false-positive regression: VS-CODE-006 does not fire on "return hashlib.sha1(x, usedforsecurity=False).h (11.8087ms)
|
|
70
|
+
✔ false-positive regression: VS-CODE-007 does not fire on "var s = `<script>document.write(\"x\")</script> (10.4874ms)
|
|
71
|
+
✔ false-positive regression: VS-CODE-003 does not fire on "restored = pickle.loads(pickle.dumps(obj))" (12.01ms)
|
|
72
|
+
✔ false-positive regression: VS-DOCKER-003 does not fire on "FROM a:1\nRUN echo \"curl -sSL https://x.invali (13.3178ms)
|
|
73
|
+
✔ false-positive regression: VS-IAC-001 does not fire on "resource \"aws_route\" \"r\" {\n destination_c (12.1602ms)
|
|
74
|
+
✔ false-positive regression: VS-IAC-001 does not fire on "resource \"aws_route_table\" \"t\" {\n route { (12.9423ms)
|
|
75
|
+
✔ false-positive regression: VS-IAC-003 does not fire on "statement {\n effect = \"Deny\"\n actions (17.0426ms)
|
|
76
|
+
✔ false-positive regression: VS-PRIV-001 does not fire on "logger.warn('Failed to record chat token usage (18.8786ms)
|
|
77
|
+
✔ false-positive regression: VS-SECRET-004 does not fire on "<pre>WHERE password = '$password'</pre>" (14.7444ms)
|
|
78
|
+
✔ false-positive regression: VS-DOCKER-001 does not fire on "FROM gcr.io/distroless/static-debian13:nonroot- (22.3626ms)
|
|
79
|
+
✔ false-positive regression: VS-CODE-007 does not fire on "box.innerHTML = \"\";" (13.1234ms)
|
|
80
|
+
✔ false-positive regression: VS-CODE-007 does not fire on "<span dangerouslySetInnerHTML={{ __html: saniti (15.0662ms)
|
|
81
|
+
✔ false-positive regression: VS-SECRET-004 does not fire on "{ \"NEW_PASSWORD\": \"Abc12345xyz\" }" (24.0844ms)
|
|
82
|
+
✔ false-positive regression: VS-SECRET-004 does not fire on "{ \"MANDATORY_NEW_PASSWORD\": \"請提供新的密碼.\" }" (13.8063ms)
|
|
83
|
+
✔ true positives next to the false-positive cases are still reported (27.0358ms)
|
|
84
|
+
✔ IAC-001 uses the real line: an egress block is skipped even when an identical ingress line appears earlier (30.8811ms)
|
|
85
|
+
✔ findings in test, example or vendored paths stay visible but get low confidence (22.3542ms)
|
|
86
|
+
✔ review: adapter uninstall refuses manifest entries outside .claude/skills/<name>/SKILL.md (825.4176ms)
|
|
87
|
+
✔ review: a project policy that narrows scope is disclosed, and --no-policy ignores it (2194.7709ms)
|
|
88
|
+
✔ review: SARIF file locations are percent-encoded URIs (15.4656ms)
|
|
89
|
+
✔ review: Markdown report cannot be broken out of a code span by a file name (17.6694ms)
|
|
90
|
+
✔ review: terminal control characters in paths and excerpts are neutralized in text output (14.7803ms)
|
|
91
|
+
✔ review: one rule matching thousands of lines in a file is capped and disclosed (34.2875ms)
|
|
92
|
+
✔ review: a directory junction pointing outside the project is not followed (20.1547ms)
|
|
93
|
+
✔ review: isInside rejects siblings that merely share a name prefix (1.2088ms)
|
|
94
|
+
✔ repo self-audit finds no high-or-above issues (84.6137ms)
|
|
95
|
+
ℹ tests 94
|
|
96
|
+
ℹ suites 0
|
|
97
|
+
ℹ pass 93
|
|
98
|
+
ℹ fail 0
|
|
99
|
+
ℹ cancelled 0
|
|
100
|
+
ℹ skipped 1
|
|
101
|
+
ℹ todo 0
|
|
102
|
+
ℹ duration_ms 34325.1053
|
|
103
|
+
ℹ start of coverage report
|
|
104
|
+
ℹ ----------------------------------------------------------------------------------------------
|
|
105
|
+
ℹ file | line % | branch % | funcs % | uncovered lines
|
|
106
|
+
ℹ ----------------------------------------------------------------------------------------------
|
|
107
|
+
ℹ dist | | | |
|
|
108
|
+
ℹ adapters.js | 97.33 | 72.22 | 100.00 | 69-70
|
|
109
|
+
ℹ cli.js | 98.02 | 62.79 | 100.00 | 91-93 242-243
|
|
110
|
+
ℹ engine.js | 99.12 | 91.58 | 95.24 | 225-226
|
|
111
|
+
ℹ policy.js | 100.00 | 98.25 | 100.00 |
|
|
112
|
+
ℹ redact.js | 100.00 | 71.43 | 100.00 |
|
|
113
|
+
ℹ reporters | | | |
|
|
114
|
+
ℹ index.js | 100.00 | 92.00 | 100.00 |
|
|
115
|
+
ℹ rules | | | |
|
|
116
|
+
ℹ agents-privacy.js | 100.00 | 100.00 | 93.33 |
|
|
117
|
+
ℹ code.js | 100.00 | 100.00 | 100.00 |
|
|
118
|
+
ℹ index.js | 100.00 | 100.00 | 100.00 |
|
|
119
|
+
ℹ infra.js | 100.00 | 98.33 | 100.00 |
|
|
120
|
+
ℹ secrets.js | 100.00 | 100.00 | 100.00 |
|
|
121
|
+
ℹ util.js | 100.00 | 96.08 | 100.00 |
|
|
122
|
+
ℹ scope.js | 86.99 | 71.74 | 100.00 | 68-70 76-79 87-89 114-117 121-123 140-141
|
|
123
|
+
ℹ types.js | 100.00 | 100.00 | 100.00 |
|
|
124
|
+
ℹ ----------------------------------------------------------------------------------------------
|
|
125
|
+
ℹ all files | 98.36 | 89.60 | 98.82 |
|
|
126
|
+
ℹ ----------------------------------------------------------------------------------------------
|
|
127
|
+
ℹ end of coverage report
|