vigilsutra 0.2.2 → 0.4.0
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 +26 -0
- package/README.md +34 -28
- package/advisories/db.json.gz +0 -0
- package/agents/agents-registry.json +14 -2
- package/agents/agentshield/SKILL.md +12 -0
- package/agents/apishield/SKILL.md +12 -0
- package/agents/codeguard/SKILL.md +1 -1
- package/agents/compliancemap/SKILL.md +12 -0
- package/agents/datashield/SKILL.md +12 -0
- package/agents/identityguard/SKILL.md +12 -0
- package/agents/mobileshield/SKILL.md +12 -0
- package/agents/pipelineguard/SKILL.md +12 -0
- package/agents/remedy/SKILL.md +12 -0
- package/agents/riskrank/SKILL.md +12 -0
- package/agents/secretwatch/SKILL.md +1 -1
- package/agents/supplywatch/SKILL.md +12 -0
- package/agents/threatmap/SKILL.md +12 -0
- package/agents/webshield/SKILL.md +12 -0
- package/dist/adapters.js +35 -19
- package/dist/advisories.js +83 -0
- package/dist/cli.js +101 -30
- package/dist/components.js +116 -0
- package/dist/engine.js +99 -13
- package/dist/fix.js +85 -0
- package/dist/git-index.js +17 -6
- package/dist/git-objects.js +558 -0
- package/dist/policy.js +21 -2
- package/dist/redact.js +7 -1
- package/dist/rules/code.js +23 -6
- package/dist/rules/index.js +3 -2
- package/dist/rules/secrets.js +72 -0
- package/dist/rules/supply.js +103 -0
- package/dist/rules/util.js +29 -16
- package/dist/scope.js +3 -4
- package/dist/taint.js +83 -0
- package/docs/agent-contract.md +1 -1
- package/docs/assurance/benchmark.md +2 -0
- package/docs/assurance/coverage-raw.txt +151 -111
- package/docs/assurance/coverage.md +26 -18
- package/docs/assurance/fuzzing.md +1 -1
- package/docs/assurance/internal-review.md +3 -1
- package/docs/ci-cd.md +13 -4
- package/docs/compatibility.md +4 -4
- package/docs/index.html +75 -0
- package/docs/quickstart.md +5 -3
- package/docs/rules.md +92 -2
- package/docs/security-model.md +1 -1
- package/llms.txt +2 -2
- package/package.json +3 -2
- package/policies/safe-default.yaml +3 -0
- package/templates/pre-commit +7 -0
|
@@ -1,127 +1,167 @@
|
|
|
1
|
-
✔ no rule throws on adversarial, malformed or random input (
|
|
2
|
-
✔ ReDoS guard: each rule handles 1,000 adversarial 1,990-character lines quickly (
|
|
3
|
-
✔ lines above 2,000 characters are
|
|
4
|
-
✔ malformed Unicode, NUL bytes and huge single lines do not crash a full audit (
|
|
5
|
-
✔ policy parser survives deep, huge and hostile input without hanging (
|
|
6
|
-
✔ JSON baseline and previous-result inputs that are hostile are rejected, not trusted (
|
|
7
|
-
✔ preload really blocks and records network, DNS and subprocess attempts (self-check) (
|
|
8
|
-
✔ every offline command runs to completion with the network and subprocesses blocked (
|
|
9
|
-
✔ every rule has metadata and unique id (
|
|
10
|
-
✔ VS-SECRET-001: vulnerable fixture flagged, clean fixture not (
|
|
11
|
-
✔ VS-SECRET-002: vulnerable fixture flagged, clean fixture not (
|
|
12
|
-
✔ VS-SECRET-003: vulnerable fixture flagged, clean fixture not (
|
|
13
|
-
✔ VS-SECRET-004: vulnerable fixture flagged, clean fixture not (
|
|
14
|
-
✔ VS-SECRET-005: vulnerable fixture flagged, clean fixture not (
|
|
15
|
-
✔ VS-SECRET-006: vulnerable fixture flagged, clean fixture not (
|
|
16
|
-
✔ VS-SECRET-006: vulnerable fixture flagged, clean fixture not (
|
|
17
|
-
✔ VS-
|
|
18
|
-
✔ VS-
|
|
19
|
-
✔ VS-
|
|
20
|
-
✔ VS-
|
|
21
|
-
✔ VS-
|
|
22
|
-
✔ VS-
|
|
23
|
-
✔ VS-
|
|
24
|
-
✔ VS-
|
|
25
|
-
✔ VS-
|
|
26
|
-
✔ VS-
|
|
27
|
-
✔ VS-
|
|
28
|
-
✔ VS-
|
|
29
|
-
✔ VS-
|
|
30
|
-
✔ VS-
|
|
31
|
-
✔ VS-
|
|
32
|
-
✔ VS-
|
|
33
|
-
✔ VS-
|
|
34
|
-
✔ VS-
|
|
35
|
-
✔ VS-
|
|
36
|
-
✔ VS-
|
|
37
|
-
✔ VS-
|
|
38
|
-
✔ VS-
|
|
39
|
-
✔ VS-
|
|
40
|
-
✔ VS-
|
|
41
|
-
✔ VS-
|
|
42
|
-
✔ VS-
|
|
43
|
-
✔
|
|
44
|
-
✔
|
|
45
|
-
✔
|
|
46
|
-
|
|
47
|
-
✔
|
|
48
|
-
✔
|
|
49
|
-
✔
|
|
50
|
-
✔
|
|
51
|
-
✔
|
|
52
|
-
✔
|
|
53
|
-
✔
|
|
54
|
-
✔
|
|
55
|
-
|
|
56
|
-
✔
|
|
57
|
-
✔
|
|
58
|
-
✔
|
|
59
|
-
✔
|
|
60
|
-
✔
|
|
61
|
-
✔
|
|
62
|
-
✔
|
|
63
|
-
✔
|
|
64
|
-
✔
|
|
65
|
-
✔
|
|
66
|
-
✔
|
|
67
|
-
✔
|
|
68
|
-
✔
|
|
69
|
-
✔
|
|
70
|
-
✔
|
|
71
|
-
✔
|
|
72
|
-
✔
|
|
73
|
-
✔
|
|
74
|
-
✔
|
|
75
|
-
✔
|
|
76
|
-
✔
|
|
77
|
-
✔
|
|
78
|
-
✔
|
|
79
|
-
✔ false-positive regression: VS-
|
|
80
|
-
✔ false-positive regression: VS-CODE-
|
|
81
|
-
✔ false-positive regression: VS-
|
|
82
|
-
✔ false-positive regression: VS-
|
|
83
|
-
✔
|
|
84
|
-
✔
|
|
85
|
-
✔
|
|
86
|
-
✔
|
|
87
|
-
✔
|
|
88
|
-
✔
|
|
89
|
-
✔
|
|
90
|
-
✔
|
|
91
|
-
✔
|
|
92
|
-
✔
|
|
93
|
-
✔
|
|
94
|
-
✔
|
|
95
|
-
|
|
1
|
+
✔ no rule throws on adversarial, malformed or random input (1457.3043ms)
|
|
2
|
+
✔ ReDoS guard: each rule handles 1,000 adversarial 1,990-character lines quickly (32218.5051ms)
|
|
3
|
+
✔ lines above 2,000 characters are scanned in overlapping windows (0.8425ms)
|
|
4
|
+
✔ malformed Unicode, NUL bytes and huge single lines do not crash a full audit (1524.773ms)
|
|
5
|
+
✔ policy parser survives deep, huge and hostile input without hanging (50.2663ms)
|
|
6
|
+
✔ JSON baseline and previous-result inputs that are hostile are rejected, not trusted (11922.9665ms)
|
|
7
|
+
✔ preload really blocks and records network, DNS and subprocess attempts (self-check) (2656.1915ms)
|
|
8
|
+
✔ every offline command runs to completion with the network and subprocesses blocked (29407.2861ms)
|
|
9
|
+
✔ every rule has metadata and unique id (10.1245ms)
|
|
10
|
+
✔ VS-SECRET-001: vulnerable fixture flagged, clean fixture not (2353.841ms)
|
|
11
|
+
✔ VS-SECRET-002: vulnerable fixture flagged, clean fixture not (128.5047ms)
|
|
12
|
+
✔ VS-SECRET-003: vulnerable fixture flagged, clean fixture not (111.7656ms)
|
|
13
|
+
✔ VS-SECRET-004: vulnerable fixture flagged, clean fixture not (107.0781ms)
|
|
14
|
+
✔ VS-SECRET-005: vulnerable fixture flagged, clean fixture not (122.3065ms)
|
|
15
|
+
✔ VS-SECRET-006: vulnerable fixture flagged, clean fixture not (161.3351ms)
|
|
16
|
+
✔ VS-SECRET-006: vulnerable fixture flagged, clean fixture not (521.5499ms)
|
|
17
|
+
✔ VS-SECRET-007: vulnerable fixture flagged, clean fixture not (185.4456ms)
|
|
18
|
+
✔ VS-SECRET-008: vulnerable fixture flagged, clean fixture not (338.7842ms)
|
|
19
|
+
✔ VS-SECRET-009: vulnerable fixture flagged, clean fixture not (251.9717ms)
|
|
20
|
+
✔ VS-SECRET-010: vulnerable fixture flagged, clean fixture not (353.6017ms)
|
|
21
|
+
✔ VS-SECRET-011: vulnerable fixture flagged, clean fixture not (159.9535ms)
|
|
22
|
+
✔ VS-SECRET-012: vulnerable fixture flagged, clean fixture not (173.595ms)
|
|
23
|
+
✔ VS-SUPPLY-001: vulnerable fixture flagged, clean fixture not (248.2241ms)
|
|
24
|
+
✔ VS-SUPPLY-002: vulnerable fixture flagged, clean fixture not (311.6379ms)
|
|
25
|
+
✔ VS-SUPPLY-003: vulnerable fixture flagged, clean fixture not (172.9427ms)
|
|
26
|
+
✔ VS-CICD-001: vulnerable fixture flagged, clean fixture not (174.734ms)
|
|
27
|
+
✔ VS-CICD-002: vulnerable fixture flagged, clean fixture not (147.6272ms)
|
|
28
|
+
✔ VS-CICD-003: vulnerable fixture flagged, clean fixture not (205.5235ms)
|
|
29
|
+
✔ VS-CICD-004: vulnerable fixture flagged, clean fixture not (194.575ms)
|
|
30
|
+
✔ VS-DOCKER-001: vulnerable fixture flagged, clean fixture not (163.1081ms)
|
|
31
|
+
✔ VS-DOCKER-002: vulnerable fixture flagged, clean fixture not (68.5674ms)
|
|
32
|
+
✔ VS-DOCKER-003: vulnerable fixture flagged, clean fixture not (111.7892ms)
|
|
33
|
+
✔ VS-K8S-001: vulnerable fixture flagged, clean fixture not (113.3156ms)
|
|
34
|
+
✔ VS-K8S-002: vulnerable fixture flagged, clean fixture not (100.6308ms)
|
|
35
|
+
✔ VS-K8S-003: vulnerable fixture flagged, clean fixture not (84.4264ms)
|
|
36
|
+
✔ VS-IAC-001: vulnerable fixture flagged, clean fixture not (259.5638ms)
|
|
37
|
+
✔ VS-IAC-002: vulnerable fixture flagged, clean fixture not (71.4632ms)
|
|
38
|
+
✔ VS-IAC-003: vulnerable fixture flagged, clean fixture not (68.9838ms)
|
|
39
|
+
✔ VS-CODE-001: vulnerable fixture flagged, clean fixture not (150.0242ms)
|
|
40
|
+
✔ VS-CODE-002: vulnerable fixture flagged, clean fixture not (172.1781ms)
|
|
41
|
+
✔ VS-CODE-003: vulnerable fixture flagged, clean fixture not (80.5836ms)
|
|
42
|
+
✔ VS-CODE-004: vulnerable fixture flagged, clean fixture not (87.9986ms)
|
|
43
|
+
✔ VS-CODE-005: vulnerable fixture flagged, clean fixture not (86.823ms)
|
|
44
|
+
✔ VS-CODE-006: vulnerable fixture flagged, clean fixture not (80.3705ms)
|
|
45
|
+
✔ VS-CODE-007: vulnerable fixture flagged, clean fixture not (77.058ms)
|
|
46
|
+
✔ VS-AGENT-001: vulnerable fixture flagged, clean fixture not (75.4914ms)
|
|
47
|
+
✔ VS-AGENT-002: vulnerable fixture flagged, clean fixture not (69.2873ms)
|
|
48
|
+
✔ VS-AGENT-003: vulnerable fixture flagged, clean fixture not (97.3075ms)
|
|
49
|
+
✔ VS-PRIV-001: vulnerable fixture flagged, clean fixture not (74.2385ms)
|
|
50
|
+
✔ VS-PRIV-002: vulnerable fixture flagged, clean fixture not (145.8424ms)
|
|
51
|
+
✔ VS-PROC-001 fires without SECURITY.md and not with it (41.5402ms)
|
|
52
|
+
✔ secrets never appear in any report format (64.5849ms)
|
|
53
|
+
✔ fingerprints and ordering are deterministic across scans (305.1846ms)
|
|
54
|
+
✔ fingerprint survives line shifts (79.1872ms)
|
|
55
|
+
﹣ symlinks are not followed outside the root (73.9786ms) # cannot create symlinks on this system
|
|
56
|
+
✔ paths with spaces and non-ASCII characters work (38.4641ms)
|
|
57
|
+
✔ CRLF files report correct line numbers (35.7142ms)
|
|
58
|
+
✔ size limit and binary files are skipped and counted (54.194ms)
|
|
59
|
+
✔ default ignores skip node_modules at any depth but not .env (222.3906ms)
|
|
60
|
+
✔ untracked .env is not read; a git-tracked .env is a finding (298.38ms)
|
|
61
|
+
✔ tracked .env with only placeholders is not VS-SECRET-006 (42.3509ms)
|
|
62
|
+
✔ tracked .env.example is not VS-SECRET-006 (38.1345ms)
|
|
63
|
+
✔ v4 index round-trips tracked paths (0.857ms)
|
|
64
|
+
✔ this repository does not track an environment file (4.0666ms)
|
|
65
|
+
✔ HTML report escapes untrusted content (51.819ms)
|
|
66
|
+
✔ malicious repo instructions do not change scan scope or behavior (36.6367ms)
|
|
67
|
+
✔ SARIF output has the required 2.1.0 structure (58.0922ms)
|
|
68
|
+
✔ JSON result matches the published schema's required keys (49.5595ms)
|
|
69
|
+
✔ source never imports network modules (offline guarantee) (8.0488ms)
|
|
70
|
+
✔ scan does not modify the target project (32.0245ms)
|
|
71
|
+
✔ policy parser rejects unknown keys and bad values (2.274ms)
|
|
72
|
+
✔ CLI: exit codes, fail-on, formats and output file (18448.9335ms)
|
|
73
|
+
✔ CLI: failOn from .vigilsutra.yml applies when --fail-on is absent (5179.3736ms)
|
|
74
|
+
✔ CLI: rules list, explain, doctor, help (3195.6368ms)
|
|
75
|
+
✔ baseline suppresses accepted findings; verify reports changes (4872.7353ms)
|
|
76
|
+
✔ init creates policy once and never overwrites (1325.359ms)
|
|
77
|
+
✔ adapters: claude install is previewable, non-destructive, and reversible (3844.6456ms)
|
|
78
|
+
✔ every shipped SKILL.md has valid frontmatter and a registry entry (8.7373ms)
|
|
79
|
+
✔ false-positive regression: VS-CICD-001 does not fire on "jobs:\n b:\n uses: './.github/workflows/c.y (20.3654ms)
|
|
80
|
+
✔ false-positive regression: VS-CODE-001 does not fire on "var B = eval(\"require('buffer').Buffer\");" (14.0782ms)
|
|
81
|
+
✔ false-positive regression: VS-CODE-001 does not fire on "var x = 'javascript:eval(document.body.innerHTM (11.7507ms)
|
|
82
|
+
✔ false-positive regression: VS-CODE-005 does not fire on "decoded = jwt.decode(token, verify = False)" (11.0753ms)
|
|
83
|
+
✔ false-positive regression: VS-CODE-006 does not fire on "return hashlib.sha1(x, usedforsecurity=False).h (11.2278ms)
|
|
84
|
+
✔ false-positive regression: VS-CODE-007 does not fire on "var s = `<script>document.write(\"x\")</script> (11.1746ms)
|
|
85
|
+
✔ false-positive regression: VS-CODE-003 does not fire on "restored = pickle.loads(pickle.dumps(obj))" (12.2474ms)
|
|
86
|
+
✔ false-positive regression: VS-DOCKER-003 does not fire on "FROM a:1\nRUN echo \"curl -sSL https://x.invali (12.2617ms)
|
|
87
|
+
✔ false-positive regression: VS-IAC-001 does not fire on "resource \"aws_route\" \"r\" {\n destination_c (11.6707ms)
|
|
88
|
+
✔ false-positive regression: VS-IAC-001 does not fire on "resource \"aws_route_table\" \"t\" {\n route { (12.5025ms)
|
|
89
|
+
✔ false-positive regression: VS-IAC-003 does not fire on "statement {\n effect = \"Deny\"\n actions (13.2824ms)
|
|
90
|
+
✔ false-positive regression: VS-PRIV-001 does not fire on "logger.warn('Failed to record chat token usage (17.3946ms)
|
|
91
|
+
✔ false-positive regression: VS-SECRET-004 does not fire on "<pre>WHERE password = '$password'</pre>" (17.8992ms)
|
|
92
|
+
✔ false-positive regression: VS-DOCKER-001 does not fire on "FROM gcr.io/distroless/static-debian13:nonroot- (18.4661ms)
|
|
93
|
+
✔ false-positive regression: VS-CODE-007 does not fire on "box.innerHTML = \"\";" (20.1676ms)
|
|
94
|
+
✔ false-positive regression: VS-CODE-007 does not fire on "<span dangerouslySetInnerHTML={{ __html: saniti (17.0774ms)
|
|
95
|
+
✔ false-positive regression: VS-SECRET-004 does not fire on "{ \"NEW_PASSWORD\": \"Abc12345xyz\" }" (20.6345ms)
|
|
96
|
+
✔ false-positive regression: VS-SECRET-004 does not fire on "{ \"MANDATORY_NEW_PASSWORD\": \"請提供新的密碼.\" }" (15.9452ms)
|
|
97
|
+
✔ true positives next to the false-positive cases are still reported (21.673ms)
|
|
98
|
+
✔ IAC-001 uses the real line: an egress block is skipped even when an identical ingress line appears earlier (20.8446ms)
|
|
99
|
+
✔ findings in test, example or vendored paths stay visible but get low confidence (27.8592ms)
|
|
100
|
+
✔ review: adapter uninstall refuses manifest entries outside .claude/skills/<name>/SKILL.md (750.0154ms)
|
|
101
|
+
✔ review: a project policy that narrows scope is disclosed, and --no-policy ignores it (5175.0215ms)
|
|
102
|
+
✔ review: SARIF file locations are percent-encoded URIs (5.9385ms)
|
|
103
|
+
✔ review: Markdown report cannot be broken out of a code span by a file name (5.3799ms)
|
|
104
|
+
✔ review: terminal control characters in paths and excerpts are neutralized in text output (6.0296ms)
|
|
105
|
+
✔ review: one rule matching thousands of lines in a file is capped and disclosed (16.6104ms)
|
|
106
|
+
✔ review: a directory junction pointing outside the project is not followed (11.1073ms)
|
|
107
|
+
✔ review: isInside rejects siblings that merely share a name prefix (0.5932ms)
|
|
108
|
+
✔ report command writes Markdown, HTML, JSON and SARIF plus a .gitignore, without secrets (1565.2243ms)
|
|
109
|
+
✔ audit writes report.md and report.html even when not a terminal (6200.6273ms)
|
|
110
|
+
✔ a vigilsutra-report folder inside the project is never scanned again (1518.4933ms)
|
|
111
|
+
✔ Markdown and HTML reports give a plain-language summary and handle an empty result (12.2352ms)
|
|
112
|
+
✔ sameIdentity refuses a size change when inode is 0 (0.1877ms)
|
|
113
|
+
✔ a token past 2,000 characters on one line is still found and redacted (8.3094ms)
|
|
114
|
+
✔ VS-CODE-001 raises confidence only for a same-file request assignment (10.7799ms)
|
|
115
|
+
✔ an active waiver hides one path and an expired waiver does not (9.1749ms)
|
|
116
|
+
✔ git history still reports a secret deleted from the worktree, including after git gc (2989.2021ms)
|
|
117
|
+
✔ --since scans files that differ from that revision (1300.8239ms)
|
|
118
|
+
✔ --staged reads the index when the worktree no longer has the secret (832.6853ms)
|
|
119
|
+
✔ cursor adapter copies skills and init --hook refuses to overwrite (3871.1451ms)
|
|
120
|
+
✔ repo self-audit finds no high-or-above issues (237.418ms)
|
|
121
|
+
✔ a request-like name is tracked across a relative import (29.3165ms)
|
|
122
|
+
✔ advisory snapshot matches a lockfile version and skips a fixed one (32.1431ms)
|
|
123
|
+
✔ sbom lists pinned components and fix --apply rewrites a safe line only (1421.7376ms)
|
|
124
|
+
✔ shipped advisory database matches lodash 4.17.15 (688.3436ms)
|
|
125
|
+
✔ SHA-256 git history reports a removed secret (3005.6622ms)
|
|
126
|
+
✔ a secret older than 200 commits is still read (1923.7862ms)
|
|
127
|
+
ℹ tests 126
|
|
96
128
|
ℹ suites 0
|
|
97
|
-
ℹ pass
|
|
129
|
+
ℹ pass 125
|
|
98
130
|
ℹ fail 0
|
|
99
131
|
ℹ cancelled 0
|
|
100
132
|
ℹ skipped 1
|
|
101
133
|
ℹ todo 0
|
|
102
|
-
ℹ duration_ms
|
|
134
|
+
ℹ duration_ms 83562.0061
|
|
103
135
|
ℹ start of coverage report
|
|
104
|
-
ℹ
|
|
136
|
+
ℹ -------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
105
137
|
ℹ file | line % | branch % | funcs % | uncovered lines
|
|
106
|
-
ℹ
|
|
138
|
+
ℹ -------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
107
139
|
ℹ dist | | | |
|
|
108
|
-
ℹ adapters.js |
|
|
109
|
-
ℹ
|
|
110
|
-
ℹ
|
|
111
|
-
ℹ
|
|
140
|
+
ℹ adapters.js | 86.92 | 68.18 | 60.00 | 39-40 53-58 75-76 98-99 106-107
|
|
141
|
+
ℹ advisories.js | 97.59 | 74.51 | 100.00 | 35-36
|
|
142
|
+
ℹ cli.js | 93.58 | 52.73 | 100.00 | 130-132 211-221 227-229 296-297 313-314 347-348
|
|
143
|
+
ℹ components.js | 98.28 | 92.68 | 100.00 | 16-17
|
|
144
|
+
ℹ engine.js | 99.36 | 93.13 | 96.15 | 312-313
|
|
145
|
+
ℹ fix.js | 97.65 | 61.90 | 100.00 | 42-43
|
|
146
|
+
ℹ git-index.js | 88.05 | 51.52 | 100.00 | 70-83 86-88 105-106 137-138 147-148 166-167 244-247 286-291
|
|
147
|
+
ℹ git-objects.js | 89.61 | 65.75 | 93.33 | 37-48 51-52 60-61 94 143 197-198 207-212 251-259 279 311-315 335 419-421 429-431 496-497 529-530 553-558
|
|
148
|
+
ℹ policy.js | 100.00 | 91.30 | 100.00 |
|
|
112
149
|
ℹ redact.js | 100.00 | 71.43 | 100.00 |
|
|
113
150
|
ℹ reporters | | | |
|
|
114
|
-
ℹ index.js | 100.00 |
|
|
151
|
+
ℹ index.js | 100.00 | 93.33 | 100.00 |
|
|
152
|
+
ℹ rich.js | 99.41 | 89.61 | 100.00 | 17
|
|
115
153
|
ℹ rules | | | |
|
|
116
154
|
ℹ agents-privacy.js | 100.00 | 100.00 | 93.33 |
|
|
117
|
-
ℹ code.js | 100.00 |
|
|
155
|
+
ℹ code.js | 100.00 | 96.88 | 100.00 |
|
|
118
156
|
ℹ index.js | 100.00 | 100.00 | 100.00 |
|
|
119
|
-
ℹ infra.js | 100.00 | 98.
|
|
157
|
+
ℹ infra.js | 100.00 | 98.44 | 100.00 |
|
|
120
158
|
ℹ secrets.js | 100.00 | 100.00 | 100.00 |
|
|
121
|
-
ℹ
|
|
122
|
-
ℹ
|
|
159
|
+
ℹ supply.js | 96.12 | 84.38 | 92.86 | 60-61 93-94
|
|
160
|
+
ℹ util.js | 100.00 | 96.36 | 100.00 |
|
|
161
|
+
ℹ scope.js | 87.58 | 72.34 | 100.00 | 69-71 77-80 88-90 121-124 128-130 147-148
|
|
162
|
+
ℹ taint.js | 100.00 | 89.13 | 90.00 |
|
|
123
163
|
ℹ types.js | 100.00 | 100.00 | 100.00 |
|
|
124
|
-
ℹ
|
|
125
|
-
ℹ all files |
|
|
126
|
-
ℹ
|
|
164
|
+
ℹ -------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
165
|
+
ℹ all files | 95.38 | 79.88 | 96.14 |
|
|
166
|
+
ℹ -------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
127
167
|
ℹ end of coverage report
|
|
@@ -1,29 +1,37 @@
|
|
|
1
1
|
# Test coverage
|
|
2
2
|
|
|
3
|
-
Measured with Node's built-in coverage (`node --test --experimental-test-coverage`) over the compiled `dist/` of the whole suite, including code reached through the CLI subprocess tests. Raw output: [coverage-raw.txt](coverage-raw.txt). Date 2026-11-
|
|
3
|
+
Measured with Node's built-in coverage (`node --test --experimental-test-coverage`) over the compiled `dist/` of the whole suite, including code reached through the CLI subprocess tests. Raw output: [coverage-raw.txt](coverage-raw.txt). Date 2026-11-07, Windows 11, Node 24.15.
|
|
4
4
|
|
|
5
5
|
| Metric | Value |
|
|
6
6
|
|---|---|
|
|
7
|
-
| Tests |
|
|
8
|
-
| Line coverage | **
|
|
9
|
-
| Branch coverage | **
|
|
10
|
-
| Function coverage | **
|
|
11
|
-
|
|
12
|
-
| File | Lines | Branches |
|
|
13
|
-
|
|
14
|
-
| `engine.js` | 99.
|
|
15
|
-
| `policy.js` | 100 % |
|
|
16
|
-
| `
|
|
17
|
-
| `rules
|
|
18
|
-
| `
|
|
19
|
-
| `
|
|
20
|
-
| `
|
|
7
|
+
| Tests | 126 (125 passed, 0 failed, 1 skipped) |
|
|
8
|
+
| Line coverage | **95.38 %** |
|
|
9
|
+
| Branch coverage | **79.88 %** |
|
|
10
|
+
| Function coverage | **96.14 %** |
|
|
11
|
+
|
|
12
|
+
| File | Lines | Branches |
|
|
13
|
+
|---|---|---|
|
|
14
|
+
| `engine.js` | 99.36 % | 93.13 % |
|
|
15
|
+
| `policy.js` | 100 % | 91.30 % |
|
|
16
|
+
| `rules/secrets.js`, `rules/code.js`, `rules/infra.js` | 100 % | 96 to 100 % |
|
|
17
|
+
| `rules/supply.js` | 96.12 % | 84.38 % |
|
|
18
|
+
| `advisories.js` | 97.59 % | 74.51 % |
|
|
19
|
+
| `components.js` | 98.28 % | 92.68 % |
|
|
20
|
+
| `taint.js` | 100 % | 89.13 % |
|
|
21
|
+
| `fix.js` | 97.65 % | 61.90 % |
|
|
22
|
+
| `cli.js` | 93.58 % | 52.73 % |
|
|
23
|
+
| `adapters.js` | 86.92 % | 68.18 % |
|
|
24
|
+
| `git-index.js` | 88.05 % | 51.52 % |
|
|
25
|
+
| `git-objects.js` | 89.61 % | 65.75 % |
|
|
26
|
+
| `scope.js` | 87.58 % | 72.34 % |
|
|
27
|
+
|
|
28
|
+
The 2026-11-01 run reported 98.36 % lines and 89.60 % branches on 94 tests. The 0.3.0 run reported 95.24 % lines. This table is the 0.4.0 run. Uncovered lines are still the hard-to-trigger ones: a corrupt pack, a missing advisory file, a scan root outside the work tree, and file symlinks.
|
|
21
29
|
|
|
22
30
|
## How to read this
|
|
23
31
|
|
|
24
|
-
- Coverage shows which code ran, not that it is correct.
|
|
25
|
-
- `scope.js`
|
|
26
|
-
- No minimum threshold is enforced in CI
|
|
32
|
+
- Coverage shows which code ran, not that it is correct.
|
|
33
|
+
- `git-objects.js` and `scope.js` are the safety-critical modules with the lowest coverage. Uncovered lines are the hard-to-trigger ones: a corrupt pack, a scan root outside the work tree, a stuck clock, and file symlinks (the junction case is tested on Windows; file symlinks need privileges that were not available, so that test skipped).
|
|
34
|
+
- No minimum threshold is enforced in CI.
|
|
27
35
|
- No mutation testing has been done.
|
|
28
36
|
|
|
29
37
|
## Reproduce
|
|
@@ -5,7 +5,7 @@ Tests: `test/fuzz.test.mjs` (run by `npm test`). Raw timings: [fuzz-results.json
|
|
|
5
5
|
## What is tested
|
|
6
6
|
|
|
7
7
|
1. **No rule throws** on 40 rounds of generated input: 60 lines each of 1 to 2,400 characters, drawn from 22 shapes (long runs of one character, near-matches of each rule's pattern, quote and backtick storms, random tokens including NUL, lone surrogates, right-to-left controls and CJK), against 12 file kinds (Dockerfile, JS, Python, workflow, Kubernetes YAML, Terraform, agent file, MCP JSON, `.env`, PEM, shell, JSON).
|
|
8
|
-
2. **ReDoS guard**: every rule is given files of 1,000 adversarial lines of 1,990 characters (16 shapes) and must finish in under 1,500 ms per file. Lines over 2,000 characters are
|
|
8
|
+
2. **ReDoS guard**: every rule is given files of 1,000 adversarial lines of 1,990 characters (16 shapes) and must finish in under 1,500 ms per file. Lines over 2,000 characters are scanned in overlapping windows.
|
|
9
9
|
3. **Whole-audit robustness**: malformed UTF-8, lone surrogates, NUL bytes and a 900 KB single line.
|
|
10
10
|
4. **Parser robustness**: the policy parser with 1 MB values, 50,000 list items, 100,000 colons, NUL and surrogate floods; baseline and previous-result inputs that are `{`, `[]`, `null`, wrong types or a 100 KB number must be rejected with exit code 2.
|
|
11
11
|
|
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
> **Warning:** this review was done by the project's maintainer working with an AI assistant. It is **not independent**. It exists so that known weaknesses are fixed and visible, and so an outside reviewer has a starting point. See [REVIEW-REQUEST.md](REVIEW-REQUEST.md) for how to ask for an independent review.
|
|
4
4
|
|
|
5
|
-
Date: 2026-11-01. Scope: all of `src/` (about 1,900 lines), the CLI contract, report writers, the Claude adapter, the GitHub workflows and the fuzz/benchmark data. Method: manual read-through against the threat model, adversarial tests, fuzzing, and a run over 18 public repositories.
|
|
5
|
+
Date: 2026-11-01. Scope: all of `src/` at that date (about 1,900 lines), the CLI contract, report writers, the Claude adapter, the GitHub workflows and the fuzz/benchmark data. Method: manual read-through against the threat model, adversarial tests, fuzzing, and a run over 18 public repositories.
|
|
6
|
+
|
|
7
|
+
0.3.0 (2026-11-07) changed two residuals from this review: lines over 2,000 characters are scanned in windows, and an inode of 0 is checked with size and mtime. 0.4.0 added SHA-256 history, an advisory snapshot, a bounded name tracker, SBOM export, and `vigilsutra fix`. This page is the 2026-11-01 review, not a new one, and it was not an independent human review.
|
|
6
8
|
|
|
7
9
|
## Findings and fixes
|
|
8
10
|
|
package/docs/ci-cd.md
CHANGED
|
@@ -1,18 +1,27 @@
|
|
|
1
1
|
# CI/CD usage
|
|
2
2
|
|
|
3
|
+
Pin every action to a commit SHA. A floating tag such as `@v4` is what `VS-CICD-001` reports.
|
|
4
|
+
|
|
3
5
|
```yaml
|
|
4
6
|
permissions:
|
|
5
7
|
contents: read
|
|
6
8
|
security-events: write # only to upload SARIF
|
|
7
9
|
steps:
|
|
8
|
-
- uses: actions/checkout@
|
|
9
|
-
-
|
|
10
|
-
|
|
10
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
11
|
+
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
|
12
|
+
with:
|
|
13
|
+
node-version: 22
|
|
14
|
+
- run: npx --yes vigilsutra@0.4.0 audit . --format sarif --out vigilsutra.sarif --fail-on high --no-report
|
|
15
|
+
- uses: github/codeql-action/upload-sarif@9b3254085494b55a0f7c4c2b3d2d52cc712ce370 # v4.39.1
|
|
11
16
|
if: always()
|
|
12
17
|
with:
|
|
13
18
|
sarif_file: vigilsutra.sarif
|
|
14
19
|
```
|
|
15
20
|
|
|
16
|
-
|
|
21
|
+
This repository also ships `action.yml`. After a release tag exists, a job can call `uses: shahvatsalofficial/vigilsutra@v0.4.0` instead of `npx`. The action runs `npm ci` inside the action directory, then writes `vigilsutra.sarif`.
|
|
22
|
+
|
|
23
|
+
- Use `--since <base-sha>` on a pull request when you want the gate to look at the change, not the whole tree. That mode does not read older history.
|
|
24
|
+
- Use `--baseline .vigilsutra-baseline.json` to fail only on new fingerprints.
|
|
25
|
+
- Use `--no-history` when the job should not read `.git/objects`.
|
|
17
26
|
- Reports may contain paths and redacted excerpts: keep artifact retention short and do not publish them for private repos.
|
|
18
27
|
- Do not audit untrusted forks with elevated tokens. VigilSutra does not execute scanned code, but the workflow around it might.
|
package/docs/compatibility.md
CHANGED
|
@@ -4,12 +4,12 @@ Last verified: 2026-11-06 on the build in this repository.
|
|
|
4
4
|
|
|
5
5
|
| Environment | Status | Evidence |
|
|
6
6
|
|---|---|---|
|
|
7
|
-
| Windows 11, Node 24.15, PowerShell and Git Bash | Tested | `npm test` on 2026-11-
|
|
7
|
+
| Windows 11, Node 24.15, PowerShell and Git Bash | Tested | `npm test` on 2026-11-07: 119 passed, 1 skipped (symlink creation not permitted; the directory-junction case does run) |
|
|
8
8
|
| Ubuntu and Windows on Node 20, 22, 24 and 26 (GitHub Actions) | Required CI. Node 27 is only an alpha and is not tested | `.github/workflows/test.yml` |
|
|
9
9
|
| macOS | Not in required CI. On 2026-11-04, `macos-latest` jobs for Node 22 and 26 stayed queued and were cancelled with zero steps (runs 41882166871, 41885847962, 41886196642), which failed the workflow before any test ran. No Mac was available to re-run the suite locally. The program is plain Node with no native addon; path matching follows `core.ignorecase` | `.github/workflows/test.yml` |
|
|
10
10
|
| Paths with spaces and non-ASCII characters | Tested on Windows | unit test |
|
|
11
|
-
| Claude Code
|
|
12
|
-
|
|
|
13
|
-
| Docker image |
|
|
11
|
+
| Claude Code, Cursor, Codex, Gemini CLI, Copilot | File copy tested (`adapters install <name>`). Invocation inside each IDE is not automated-tested | `src/adapters.ts` |
|
|
12
|
+
| Windsurf, Kiro, Cline | Not implemented. Run the CLI and share its JSON or Markdown report | No adapter |
|
|
13
|
+
| Docker image | `Dockerfile` is in the repo and copies the advisory snapshot. It was not built on the 2026-11-07 Windows machine because `docker` was not installed. Nothing is pushed to a registry | `docker build -t vigilsutra .` |
|
|
14
14
|
|
|
15
15
|
The CLI works in any editor or CI that can launch a process. Native skill use requires an IDE that supports the Agent Skills format.
|
package/docs/index.html
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>VigilSutra AI — offline security audit</title>
|
|
7
|
+
<meta name="description" content="Offline, read-only security and privacy auditor. 42 rules, redacted reports, advisory snapshot, no telemetry. Apache-2.0.">
|
|
8
|
+
<link rel="canonical" href="https://shahvatsalofficial.github.io/vigilsutra/">
|
|
9
|
+
<meta name="color-scheme" content="light dark">
|
|
10
|
+
<meta name="author" content="Vatsal Shah">
|
|
11
|
+
<style>
|
|
12
|
+
:root { color-scheme: light dark; --bg: #f6f4ef; --fg: #1c1915; --muted: #5c564c; --line: #ddd6c8; --card: #fffdf8; }
|
|
13
|
+
@media (prefers-color-scheme: dark) {
|
|
14
|
+
:root { --bg: #16140f; --fg: #f3efe6; --muted: #b7b0a4; --line: #3a342c; --card: #211e18; }
|
|
15
|
+
}
|
|
16
|
+
body { margin: 0; font: 17px/1.5 Georgia, "Iowan Old Style", serif; background: var(--bg); color: var(--fg); }
|
|
17
|
+
header, main { max-width: 760px; margin: 0 auto; padding: 32px 20px; }
|
|
18
|
+
header { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; border-bottom: 1px solid var(--line); }
|
|
19
|
+
a { color: inherit; }
|
|
20
|
+
h1 { font-size: 34px; line-height: 1.15; margin: 0 0 12px; }
|
|
21
|
+
.lede { font-size: 19px; }
|
|
22
|
+
.muted { color: var(--muted); }
|
|
23
|
+
ul { padding-left: 1.2em; }
|
|
24
|
+
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
|
|
25
|
+
@media (max-width: 640px) { .grid { grid-template-columns: 1fr; } }
|
|
26
|
+
article { border: 1px solid var(--line); background: var(--card); padding: 14px 16px; }
|
|
27
|
+
article h2 { margin: 0 0 6px; font-size: 18px; }
|
|
28
|
+
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.92em; }
|
|
29
|
+
footer { max-width: 760px; margin: 0 auto; padding: 8px 20px 40px; color: var(--muted); }
|
|
30
|
+
</style>
|
|
31
|
+
</head>
|
|
32
|
+
<body>
|
|
33
|
+
<header>
|
|
34
|
+
<strong>VigilSutra AI</strong>
|
|
35
|
+
<nav class="muted"><a href="https://github.com/shahvatsalofficial/vigilsutra">GitHub</a> · <a href="https://www.npmjs.com/package/vigilsutra">npm</a></nav>
|
|
36
|
+
</header>
|
|
37
|
+
<main>
|
|
38
|
+
<p class="muted">v0.4.0 · Apache-2.0 · by Vatsal Shah</p>
|
|
39
|
+
<h1>Inspect the repo. Keep the secrets out of the report.</h1>
|
|
40
|
+
<p class="lede">An offline, read-only auditor for source, CI, containers, Kubernetes, Terraform, and AI-agent setup. No account. No telemetry. The CLI never calls the network.</p>
|
|
41
|
+
<p><code>npx vigilsutra@0.4.0 audit .</code></p>
|
|
42
|
+
<p class="muted">That writes <code>vigilsutra-report/report.html</code> and <code>report.md</code>. Open the HTML file in a browser.</p>
|
|
43
|
+
<div class="grid">
|
|
44
|
+
<article>
|
|
45
|
+
<h2>What a scan does</h2>
|
|
46
|
+
<ul>
|
|
47
|
+
<li>42 rules, each with a bad and a clean test.</li>
|
|
48
|
+
<li>Reads git history (SHA-1 or SHA-256) until the time limit, without running <code>git</code>.</li>
|
|
49
|
+
<li>Redacts token-shaped text in text, JSON, Markdown, SARIF, and HTML.</li>
|
|
50
|
+
<li>Leaves an untracked <code>.env</code> unread when a git index exists.</li>
|
|
51
|
+
</ul>
|
|
52
|
+
</article>
|
|
53
|
+
<article>
|
|
54
|
+
<h2>What a scan does not do</h2>
|
|
55
|
+
<ul>
|
|
56
|
+
<li>Advisory matches use a snapshot from 2026-11-07, not a live feed.</li>
|
|
57
|
+
<li>Name tracking stops at object fields, dynamic imports, and function returns.</li>
|
|
58
|
+
<li>No mobile, runtime, or compliance verdict.</li>
|
|
59
|
+
<li>A clean report is not proof the project is secure.</li>
|
|
60
|
+
</ul>
|
|
61
|
+
</article>
|
|
62
|
+
</div>
|
|
63
|
+
<h2>Use it</h2>
|
|
64
|
+
<ul>
|
|
65
|
+
<li><code>vigilsutra audit . --fail-on high</code> for a CI gate.</li>
|
|
66
|
+
<li><code>vigilsutra audit . --since <rev></code> for the files that differ.</li>
|
|
67
|
+
<li><code>vigilsutra sbom .</code> for a CycloneDX file. <code>vigilsutra fix .</code> shows edits; <code>--apply</code> writes them.</li>
|
|
68
|
+
<li><code>vigilsutra init --hook</code> to scan the git index before commit.</li>
|
|
69
|
+
<li><code>vigilsutra adapters install cursor</code> (also claude, codex, gemini, copilot). File copy is tested. The IDE is not.</li>
|
|
70
|
+
</ul>
|
|
71
|
+
<p>Handbook and rule list stay in the repository: <a href="https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/rules.md">docs/rules.md</a>, <a href="https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/quickstart.md">quickstart</a>, <a href="https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/security-model.md">security model</a>.</p>
|
|
72
|
+
</main>
|
|
73
|
+
<footer>This page is static. It does not load remote scripts, fonts, or images. GitHub Pages serves it after the Pages workflow runs.</footer>
|
|
74
|
+
</body>
|
|
75
|
+
</html>
|
package/docs/quickstart.md
CHANGED
|
@@ -31,15 +31,17 @@ vigilsutra doctor
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
## Docker
|
|
34
|
-
|
|
34
|
+
The repository contains a `Dockerfile`. It is not pushed to a registry. The 2026-11-07 Windows check did not build it: `docker` was not on that machine. On a machine with Docker:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
docker
|
|
37
|
+
docker build -t vigilsutra .
|
|
38
|
+
docker run --rm --network none -v "$PWD:/scan:ro" vigilsutra audit /scan
|
|
38
39
|
```
|
|
39
40
|
|
|
40
41
|
## Get a readable report
|
|
41
42
|
```bash
|
|
42
|
-
vigilsutra
|
|
43
|
+
vigilsutra audit . # writes ./vigilsutra-report/report.html and report.md (also JSON and SARIF)
|
|
44
|
+
vigilsutra report . # same files
|
|
43
45
|
```
|
|
44
46
|
Open `report.html` in a browser, or `report.md` in any Markdown viewer. The folder has its own `.gitignore`; reports contain file paths and redacted excerpts, so do not publish them for private projects.
|
|
45
47
|
|