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.
@@ -1,41 +1,41 @@
1
- # Internal security review
2
-
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
-
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.
6
-
7
- ## Findings and fixes
8
-
9
- | ID | Severity | Finding | Fix | Test |
10
- |---|---|---|---|---|
11
- | IR-1 | medium | **Adapter uninstall trusted its manifest.** The check used a string prefix, so a manifest listing a sibling such as `.claude/skills-evil/x/SKILL.md` would pass and be deleted. The manifest lives in the project and can be edited by anyone with write access. | Entries must resolve to exactly `.claude/skills/<name>/SKILL.md` (path-relative check, no `..`, no absolute paths) | `review: adapter uninstall refuses manifest entries outside ...` |
12
- | IR-2 | medium | **A hostile project can silence the scan.** The project's own `.vigilsutra.yml` can ignore every file or disable rules, so auditing someone else's repository could report "clean". | Reports now state when scope was narrowed by a policy (`scope.policy`, a limitation line). New `--policy <file>` uses a trusted policy and `--no-policy` ignores the project's | `review: a project policy that narrows scope is disclosed ...` |
13
- | IR-3 | low | **Time-of-check/time-of-use symlink swap.** A path could be replaced by a symlink between `lstat` and the read, so the read would follow it out of the project. | Each file is opened once; the descriptor's device and inode must match the earlier `lstat`, otherwise the file is refused. Also halves file opens | `review: isInside ...`, junction test; a race itself is not simulated |
14
- | IR-4 | medium | **Invalid SARIF for unusual paths.** File URIs were not percent-encoded, so paths with spaces, `#` or `%` produce invalid locations in code-scanning tools. | Each path segment is `encodeURIComponent`-encoded | `review: SARIF file locations are percent-encoded URIs` |
15
- | IR-5 | low | **Markdown injection through file names.** A backtick in a file name closed the inline code span in the Markdown report. | Backticks and line breaks replaced in code spans | `review: Markdown report cannot be broken out ...` |
16
- | IR-6 | low | **Terminal escape injection.** ANSI escapes or bidi controls in file names or excerpts reached the terminal. | Control characters neutralized in excerpts and in the text report | `review: terminal control characters ... are neutralized` |
17
- | IR-7 | low | **Unbounded output.** One rule matching every line of a 1 MiB file could create hundreds of thousands of findings. | Cap of 200 findings per rule per file; the cut is disclosed in `limitations` and `scope.cappedFindings` | `review: one rule matching thousands of lines ... is capped` |
18
- | IR-8 | medium | **Two quadratic regular expressions** (found by the fuzz tests): `^\s*-?\s*uses:` on whitespace-only lines and multi-line `\s*` that spans newlines in YAML detection. One crafted 2 MB file took 4 seconds. | Anchored patterns without overlapping quantifiers; `[ \t]*` for same-line whitespace | `ReDoS guard: each rule handles 1,000 adversarial 1,990-character lines quickly` |
19
- | IR-9 | low | **Wrong line used by look-back filters.** Rules located the matched line with `indexOf(line)`, which returns the first identical line in the file, so a later egress block was judged by an earlier ingress block. Found by the holdout benchmark. | Filters receive the real line number | `IAC-001 uses the real line ...` |
20
-
21
- | IR-10 | low | **Check-then-write races in `init` and the adapter** (reported by GitHub CodeQL, an independent static analyzer, after it was added to CI). `existsSync` followed by a write could overwrite a file created in between. | `init` creates with the exclusive `wx` flag; adapter installs use `COPYFILE_EXCL` for new files and treat "already exists" as skip | `init creates policy once and never overwrites`, `adapters: claude install is previewable, non-destructive ...` |
22
-
23
- All ten were fixed and each has a test (IR-10 reuses existing no-overwrite tests). The test suite grew from 56 to 94 tests as a result of this work. CodeQL's other alerts were a regular expression it judged unanchored (rewritten), a documentation-generator escaping bug (fixed, it would have mis-rendered pipe characters in `docs/rules.md`) and a race in a test helper (dismissed: test code).
24
-
25
- ## Checked and found acceptable
26
-
27
- - No `child_process`, network, `eval` or dynamic `import()` in `src/` (static test and runtime test with blocked network and subprocess APIs).
28
- - `--out` writes where the user asks; nothing else is written by `audit`, `verify`, `explain`, `rules` or `doctor`.
29
- - HTML report: every untrusted value passes through one escaper; strict CSP; tested with hostile names and code.
30
- - Fingerprints never include secret values; secret spans from all rules on a line are removed from every finding that quotes the line.
31
- - Policy and baseline parsers reject malformed and hostile input with exit code 2 (tested with 1 MB lines, 50,000 list items, NUL and lone surrogates).
32
-
33
- ## Residual risks (not fixed)
34
-
35
- 1. Pattern rules are evadable by obfuscation and produce false positives (measured in [benchmark.md](benchmark.md)).
36
- 2. The time limit is checked between files, so a stalled filesystem read is not interrupted.
37
- 3. Regular-expression safety is evidenced by fuzzing with 16 adversarial shapes, not by a formal proof.
38
- 4. The TOCTOU defence is not tested with a real race; it relies on the descriptor's device and inode, which some filesystems report as zero (the check is skipped there).
39
- 5. Windows long paths (over 260 characters) were not tested.
40
- 6. The Claude adapter copies skill text; a malicious or compromised copy of this package could ship hostile skill instructions. Install from the official npm package or repository and review `agents/*/SKILL.md`.
41
- 7. No third-party has reviewed any of this.
1
+ # Internal security review
2
+
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
+
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.
6
+
7
+ ## Findings and fixes
8
+
9
+ | ID | Severity | Finding | Fix | Test |
10
+ |---|---|---|---|---|
11
+ | IR-1 | medium | **Adapter uninstall trusted its manifest.** The check used a string prefix, so a manifest listing a sibling such as `.claude/skills-evil/x/SKILL.md` would pass and be deleted. The manifest lives in the project and can be edited by anyone with write access. | Entries must resolve to exactly `.claude/skills/<name>/SKILL.md` (path-relative check, no `..`, no absolute paths) | `review: adapter uninstall refuses manifest entries outside ...` |
12
+ | IR-2 | medium | **A hostile project can silence the scan.** The project's own `.vigilsutra.yml` can ignore every file or disable rules, so auditing someone else's repository could report "clean". | Reports now state when scope was narrowed by a policy (`scope.policy`, a limitation line). New `--policy <file>` uses a trusted policy and `--no-policy` ignores the project's | `review: a project policy that narrows scope is disclosed ...` |
13
+ | IR-3 | low | **Time-of-check/time-of-use symlink swap.** A path could be replaced by a symlink between `lstat` and the read, so the read would follow it out of the project. | Each file is opened once; the descriptor's device and inode must match the earlier `lstat`, otherwise the file is refused. Also halves file opens | `review: isInside ...`, junction test; a race itself is not simulated |
14
+ | IR-4 | medium | **Invalid SARIF for unusual paths.** File URIs were not percent-encoded, so paths with spaces, `#` or `%` produce invalid locations in code-scanning tools. | Each path segment is `encodeURIComponent`-encoded | `review: SARIF file locations are percent-encoded URIs` |
15
+ | IR-5 | low | **Markdown injection through file names.** A backtick in a file name closed the inline code span in the Markdown report. | Backticks and line breaks replaced in code spans | `review: Markdown report cannot be broken out ...` |
16
+ | IR-6 | low | **Terminal escape injection.** ANSI escapes or bidi controls in file names or excerpts reached the terminal. | Control characters neutralized in excerpts and in the text report | `review: terminal control characters ... are neutralized` |
17
+ | IR-7 | low | **Unbounded output.** One rule matching every line of a 1 MiB file could create hundreds of thousands of findings. | Cap of 200 findings per rule per file; the cut is disclosed in `limitations` and `scope.cappedFindings` | `review: one rule matching thousands of lines ... is capped` |
18
+ | IR-8 | medium | **Two quadratic regular expressions** (found by the fuzz tests): `^\s*-?\s*uses:` on whitespace-only lines and multi-line `\s*` that spans newlines in YAML detection. One crafted 2 MB file took 4 seconds. | Anchored patterns without overlapping quantifiers; `[ \t]*` for same-line whitespace | `ReDoS guard: each rule handles 1,000 adversarial 1,990-character lines quickly` |
19
+ | IR-9 | low | **Wrong line used by look-back filters.** Rules located the matched line with `indexOf(line)`, which returns the first identical line in the file, so a later egress block was judged by an earlier ingress block. Found by the holdout benchmark. | Filters receive the real line number | `IAC-001 uses the real line ...` |
20
+
21
+ | IR-10 | low | **Check-then-write races in `init` and the adapter** (reported by GitHub CodeQL, an independent static analyzer, after it was added to CI). `existsSync` followed by a write could overwrite a file created in between. | `init` creates with the exclusive `wx` flag; adapter installs use `COPYFILE_EXCL` for new files and treat "already exists" as skip | `init creates policy once and never overwrites`, `adapters: claude install is previewable, non-destructive ...` |
22
+
23
+ All ten were fixed and each has a test (IR-10 reuses existing no-overwrite tests). The test suite grew from 56 to 94 tests as a result of this work. CodeQL's other alerts were a regular expression it judged unanchored (rewritten), a documentation-generator escaping bug (fixed, it would have mis-rendered pipe characters in `docs/rules.md`) and a race in a test helper (dismissed: test code).
24
+
25
+ ## Checked and found acceptable
26
+
27
+ - No `child_process`, network, `eval` or dynamic `import()` in `src/` (static test and runtime test with blocked network and subprocess APIs).
28
+ - `--out` writes where the user asks; nothing else is written by `audit`, `verify`, `explain`, `rules` or `doctor`.
29
+ - HTML report: every untrusted value passes through one escaper; strict CSP; tested with hostile names and code.
30
+ - Fingerprints never include secret values; secret spans from all rules on a line are removed from every finding that quotes the line.
31
+ - Policy and baseline parsers reject malformed and hostile input with exit code 2 (tested with 1 MB lines, 50,000 list items, NUL and lone surrogates).
32
+
33
+ ## Residual risks (not fixed)
34
+
35
+ 1. Pattern rules are evadable by obfuscation and produce false positives (measured in [benchmark.md](benchmark.md)).
36
+ 2. The time limit is checked between files, so a stalled filesystem read is not interrupted.
37
+ 3. Regular-expression safety is evidenced by fuzzing with 16 adversarial shapes, not by a formal proof.
38
+ 4. The TOCTOU defence is not tested with a real race; it relies on the descriptor's device and inode, which some filesystems report as zero (the check is skipped there).
39
+ 5. Windows long paths (over 260 characters) were not tested.
40
+ 6. The Claude adapter copies skill text; a malicious or compromised copy of this package could ship hostile skill instructions. Install from the official npm package or repository and review `agents/*/SKILL.md`.
41
+ 7. No third-party has reviewed any of this.
@@ -1,42 +1,42 @@
1
- # Supply chain: dependencies, licenses, SBOM
2
-
3
- Date 2026-11-01. Package `vigilsutra@0.1.0`.
4
-
5
- ## Runtime dependencies: none
6
-
7
- `package.json` has no `dependencies`. Installing `vigilsutra` from npm installs one package: itself. The CycloneDX 1.5 SBOM for production contains **0 components** ([sbom-production.cdx.json](sbom-production.cdx.json)); an SPDX version is in [sbom-production.spdx.json](sbom-production.spdx.json).
8
-
9
- ## Development dependencies (build and test only, never shipped)
10
-
11
- | Package | Version | License |
12
- |---|---|---|
13
- | typescript | 7.0.2 (latest; native compiler, platform binary via `@typescript/typescript-<platform>`, Apache-2.0) | Apache-2.0 |
14
- | @types/node | 22.20.5 (typed against Node 22 on purpose: Node 20 is end-of-life but still supported, so the types must not expose newer-only APIs) | MIT |
15
- | undici-types (via @types/node) | 6.21.0 | MIT |
16
-
17
- Full dev SBOM: [sbom-full-dev.cdx.json](sbom-full-dev.cdx.json). All licenses are compatible with Apache-2.0 distribution.
18
-
19
- ## Known vulnerabilities
20
-
21
- `npm audit` on 2026-11-01 reported **0** vulnerabilities (info 0, low 0, moderate 0, high 0, critical 0) across 3 dev dependencies ([npm-audit.json](npm-audit.json)). An audit is a point-in-time check against the npm advisory database.
22
-
23
- ## Build and release integrity
24
-
25
- | Control | State |
26
- |---|---|
27
- | Lockfile committed, `npm ci` in CI | yes |
28
- | GitHub Actions pinned to commit SHAs | yes, all workflows |
29
- | Dependabot for Actions and npm | enabled |
30
- | Workflow permissions | `contents: read` by default; `id-token: write` and `security-events: write` only where needed |
31
- | OpenSSF Scorecard workflow | added; first result pending |
32
- | npm provenance (attestation linking the package to this repository and workflow) | **workflow written, not yet exercised.** Requires the owner to configure Trusted Publishing on npmjs.com; see [releasing.md](../releasing.md). Versions 0.1.0 and 0.1.1 were uploaded by hand and have no provenance |
33
- | Reproducible builds | not verified |
34
- | Package contents | 44 files in `dist`, `agents`, `adapters`, `policies`, `schemas`, `docs`, `templates` and top-level docs; no source maps, no tests |
35
-
36
- ## Reproduce
37
-
38
- ```bash
39
- npm ci && npm audit
40
- npm sbom --sbom-format cyclonedx --omit dev
41
- npm pack --dry-run
42
- ```
1
+ # Supply chain: dependencies, licenses, SBOM
2
+
3
+ Date 2026-11-01. Package `vigilsutra@0.1.0`.
4
+
5
+ ## Runtime dependencies: none
6
+
7
+ `package.json` has no `dependencies`. Installing `vigilsutra` from npm installs one package: itself. The CycloneDX 1.5 SBOM for production contains **0 components** ([sbom-production.cdx.json](sbom-production.cdx.json)); an SPDX version is in [sbom-production.spdx.json](sbom-production.spdx.json).
8
+
9
+ ## Development dependencies (build and test only, never shipped)
10
+
11
+ | Package | Version | License |
12
+ |---|---|---|
13
+ | typescript | 7.0.2 (latest; native compiler, platform binary via `@typescript/typescript-<platform>`, Apache-2.0) | Apache-2.0 |
14
+ | @types/node | 22.20.5 (typed against Node 22 on purpose: Node 20 is end-of-life but still supported, so the types must not expose newer-only APIs) | MIT |
15
+ | undici-types (via @types/node) | 6.21.0 | MIT |
16
+
17
+ Full dev SBOM: [sbom-full-dev.cdx.json](sbom-full-dev.cdx.json). All licenses are compatible with Apache-2.0 distribution.
18
+
19
+ ## Known vulnerabilities
20
+
21
+ `npm audit` on 2026-11-01 reported **0** vulnerabilities (info 0, low 0, moderate 0, high 0, critical 0) across 3 dev dependencies ([npm-audit.json](npm-audit.json)). An audit is a point-in-time check against the npm advisory database.
22
+
23
+ ## Build and release integrity
24
+
25
+ | Control | State |
26
+ |---|---|
27
+ | Lockfile committed, `npm ci` in CI | yes |
28
+ | GitHub Actions pinned to commit SHAs | yes, all workflows |
29
+ | Dependabot for Actions and npm | enabled |
30
+ | Workflow permissions | `contents: read` by default; `id-token: write` and `security-events: write` only where needed |
31
+ | OpenSSF Scorecard workflow | added; first result pending |
32
+ | npm provenance (attestation linking the package to this repository and workflow) | **workflow written, not yet exercised.** Requires the owner to configure Trusted Publishing on npmjs.com; see [releasing.md](../releasing.md). Versions 0.1.0 and 0.1.1 were uploaded by hand and have no provenance |
33
+ | Reproducible builds | not verified |
34
+ | Package contents | 44 files in `dist`, `agents`, `adapters`, `policies`, `schemas`, `docs`, `templates` and top-level docs; no source maps, no tests |
35
+
36
+ ## Reproduce
37
+
38
+ ```bash
39
+ npm ci && npm audit
40
+ npm sbom --sbom-format cyclonedx --omit dev
41
+ npm pack --dry-run
42
+ ```
@@ -1,14 +1,15 @@
1
- # Compatibility matrix
2
-
3
- Last verified: 2026-10-31 on the build in this repository.
4
-
5
- | Environment | Status | Evidence |
6
- |---|---|---|
7
- | Windows 11, Node 24.15, PowerShell and Git Bash | Tested | `npm test` run locally; the symlink test is skipped when symlink creation is not permitted |
8
- | Ubuntu, macOS, Windows on Node 20, 22, 24 and 26 (GitHub Actions) | Tested: all 12 jobs passed on commit `867132e` (Node 26.13 is the current LTS; Node 27 is only an alpha and is not tested) | `.github/workflows/test.yml` |
9
- | Paths with spaces and non-ASCII characters | Tested on Windows | unit test |
10
- | Claude Code skills adapter | File install and uninstall tested; invocation inside Claude Code not automated-tested | `adapters install claude` |
11
- | Cursor, Codex, Gemini CLI, Copilot, Windsurf, Kiro, Cline | Not implemented. Generic mode: run the CLI and share its JSON or Markdown report | Planned, unverified |
12
- | Docker image | Not published | Planned |
13
-
14
- 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.
1
+ # Compatibility matrix
2
+
3
+ Last verified: 2026-11-06 on the build in this repository.
4
+
5
+ | Environment | Status | Evidence |
6
+ |---|---|---|
7
+ | Windows 11, Node 24.15, PowerShell and Git Bash | Tested | `npm test` on 2026-11-06: 102 passed, 1 skipped (symlink creation not permitted; the directory-junction case does run) |
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
+ | 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
+ | Paths with spaces and non-ASCII characters | Tested on Windows | unit test |
11
+ | Claude Code skills adapter | File install and uninstall tested; invocation inside Claude Code not automated-tested | `adapters install claude` |
12
+ | Cursor, Codex, Gemini CLI, Copilot, Windsurf, Kiro, Cline | Not implemented. Generic mode: run the CLI and share its JSON or Markdown report | Planned, unverified |
13
+ | Docker image | Not published | Planned |
14
+
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.
@@ -1,6 +1,6 @@
1
- import { ALL_RULES, RULES_VERSION } from "../dist/rules/index.js";
2
- const o = [`# Rules (version ${RULES_VERSION})`, "", "Generated from the rule definitions by `node docs/gen-rules.mjs > docs/rules.md`. CWE ids are orientation only; no standards control mapping is asserted (mapping unverified).", "", "| ID | Title | Severity | Confidence | Status | Specialist | CWE |", "|---|---|---|---|---|---|---|"];
3
- for (const r of ALL_RULES) o.push(`| ${r.id} | ${r.title.split("|").join("\\|")} | ${r.severity} | ${r.confidence} | ${r.status} | ${r.agent} | ${(r.cwe ?? []).join(", ")} |`);
4
- o.push("", "## Details", "");
5
- for (const r of ALL_RULES) o.push(`### ${r.id}: ${r.title}`, "", r.description, "", `- **Fix:** ${r.remediation}`, `- **Verify:** ${r.verification}`, `- **False positives:** ${r.falsePositives}`, "");
6
- process.stdout.write(o.join("\n"));
1
+ import { ALL_RULES, RULES_VERSION } from "../dist/rules/index.js";
2
+ const o = [`# Rules (version ${RULES_VERSION})`, "", "Generated from the rule definitions by `node docs/gen-rules.mjs > docs/rules.md`. CWE ids are orientation only; no standards control mapping is asserted (mapping unverified).", "", "| ID | Title | Severity | Confidence | Status | Specialist | CWE |", "|---|---|---|---|---|---|---|"];
3
+ for (const r of ALL_RULES) o.push(`| ${r.id} | ${r.title.split("|").join("\\|")} | ${r.severity} | ${r.confidence} | ${r.status} | ${r.agent} | ${(r.cwe ?? []).join(", ")} |`);
4
+ o.push("", "## Details", "");
5
+ for (const r of ALL_RULES) o.push(`### ${r.id}: ${r.title}`, "", r.description, "", `- **Fix:** ${r.remediation}`, `- **Verify:** ${r.verification}`, `- **False positives:** ${r.falsePositives}`, "");
6
+ process.stdout.write(o.join("\n"));
@@ -1,50 +1,51 @@
1
- # Quickstart
2
-
3
- Prerequisite: Node.js 20 or newer. No API key, account or network access is needed to scan.
4
-
5
- ## Windows PowerShell
6
- ```powershell
7
- git clone https://github.com/shahvatsalofficial/vigilsutra.git
8
- cd vigilsutra
9
- npm install; npm run build
10
- node dist\cli.js audit examples\intentionally-insecure
11
- node dist\cli.js audit "C:\path with spaces\my-project" --format markdown --out report.md
12
- ```
13
-
14
- ## macOS / Linux
15
- ```bash
16
- git clone https://github.com/shahvatsalofficial/vigilsutra.git && cd vigilsutra
17
- npm install && npm run build
18
- node dist/cli.js audit examples/intentionally-insecure
19
- ```
20
-
21
- ## From npm
22
- ```bash
23
- npx vigilsutra audit .
24
- npm install -g vigilsutra
25
- ```
26
-
27
- ## Global `vigilsutra` command (from a clone)
28
- ```bash
29
- npm link # from the cloned repo; remove with: npm unlink -g vigilsutra
30
- vigilsutra doctor
31
- ```
32
-
33
- ## Docker
34
- No official image is published yet (planned). To run in a container yourself, mount the project read-only with networking disabled:
35
-
36
- ```bash
37
- docker run --rm --network none -v "$PWD":/work:ro -v /path/to/vigilsutra:/vs:ro -w /work node:22 node /vs/dist/cli.js audit .
38
- ```
39
-
40
- ## Get a readable report
41
- ```bash
42
- vigilsutra report . # writes ./vigilsutra-report/report.html, report.md, results.json, results.sarif
43
- ```
44
- 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
-
46
- ## Next steps
47
- 1. `vigilsutra init` to create `.vigilsutra.yml`.
48
- 2. `vigilsutra audit . --format sarif --out vigilsutra.sarif` for code scanning.
49
- 3. `vigilsutra baseline --out .vigilsutra-baseline.json` to accept current findings, then pass `--baseline` in CI to fail only on new ones.
50
- 4. After fixing, run `vigilsutra verify --previous vigilsutra-results.json`.
1
+ # Quickstart
2
+
3
+ Prerequisite: Node.js 20 or newer. No API key, account or network access is needed to scan.
4
+
5
+ ## Windows PowerShell
6
+ ```powershell
7
+ git clone https://github.com/shahvatsalofficial/vigilsutra.git
8
+ cd vigilsutra
9
+ npm install; npm run build
10
+ node dist\cli.js audit examples\intentionally-insecure
11
+ node dist\cli.js audit "C:\path with spaces\my-project" --format markdown --out report.md
12
+ ```
13
+
14
+ ## macOS / Linux
15
+ ```bash
16
+ git clone https://github.com/shahvatsalofficial/vigilsutra.git && cd vigilsutra
17
+ npm install && npm run build
18
+ node dist/cli.js audit examples/intentionally-insecure
19
+ ```
20
+
21
+ ## From npm
22
+ ```bash
23
+ npx vigilsutra audit .
24
+ npm install -g vigilsutra
25
+ ```
26
+
27
+ ## Global `vigilsutra` command (from a clone)
28
+ ```bash
29
+ npm link # from the cloned repo; remove with: npm unlink -g vigilsutra
30
+ vigilsutra doctor
31
+ ```
32
+
33
+ ## Docker
34
+ No official image is published yet (planned). To run in a container yourself, mount the project read-only with networking disabled:
35
+
36
+ ```bash
37
+ docker run --rm --network none -v "$PWD":/work:ro -v /path/to/vigilsutra:/vs:ro -w /work node:22 node /vs/dist/cli.js audit .
38
+ ```
39
+
40
+ ## Get a readable report
41
+ ```bash
42
+ vigilsutra audit . # writes ./vigilsutra-report/report.html and report.md (also JSON and SARIF)
43
+ vigilsutra report . # same files
44
+ ```
45
+ 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.
46
+
47
+ ## Next steps
48
+ 1. `vigilsutra init` to create `.vigilsutra.yml`.
49
+ 2. `vigilsutra audit . --format sarif --out vigilsutra.sarif` for code scanning.
50
+ 3. `vigilsutra baseline --out .vigilsutra-baseline.json` to accept current findings, then pass `--baseline` in CI to fail only on new ones.
51
+ 4. After fixing, run `vigilsutra verify --previous vigilsutra-results.json`.
package/docs/rules.md CHANGED
@@ -9,7 +9,7 @@ Generated from the rule definitions by `node docs/gen-rules.mjs > docs/rules.md`
9
9
  | VS-SECRET-003 | GitHub token in source | high | high | confirmed | SecretWatch | CWE-798 |
10
10
  | VS-SECRET-004 | Hardcoded credential assigned to a secret-named variable | medium | medium | potential | SecretWatch | CWE-798 |
11
11
  | VS-SECRET-005 | Slack token in source | high | high | confirmed | SecretWatch | CWE-798 |
12
- | VS-SECRET-006 | Environment file present in scanned tree | medium | medium | potential | SecretWatch | CWE-312, CWE-798 |
12
+ | VS-SECRET-006 | Tracked environment file with a secret value | medium | medium | potential | SecretWatch | CWE-312, CWE-798 |
13
13
  | VS-CICD-001 | GitHub Action not pinned to a commit SHA | low | high | potential | PipelineGuard | CWE-829 |
14
14
  | VS-CICD-002 | pull_request_target workflow checks out pull-request code | high | medium | potential | PipelineGuard | CWE-829, CWE-94 |
15
15
  | VS-CICD-003 | Workflow grants write-all permissions | medium | high | confirmed | PipelineGuard | CWE-250, CWE-732 |
@@ -79,13 +79,13 @@ A string matching a Slack token format (xox?-…) is committed.
79
79
  - **Verify:** Re-run `vigilsutra audit` after removing the value; then confirm the credential was rotated at the issuer and review git history for earlier exposure.
80
80
  - **False positives:** Revoked or fake tokens in tests.
81
81
 
82
- ### VS-SECRET-006: Environment file present in scanned tree
82
+ ### VS-SECRET-006: Tracked environment file with a secret value
83
83
 
84
- 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.
84
+ 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.
85
85
 
86
86
  - **Fix:** Treat the credential as compromised: revoke or rotate it at the issuer first, then remove it from the repository and load it from an environment variable or secret manager. Deleting it from the latest commit does not remove it from git history.
87
87
  - **Verify:** Re-run `vigilsutra audit` after removing the value; then confirm the credential was rotated at the issuer and review git history for earlier exposure.
88
- - **False positives:** 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.
88
+ - **False positives:** 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.
89
89
 
90
90
  ### VS-CICD-001: GitHub Action not pinned to a commit SHA
91
91
 
@@ -1,26 +1,26 @@
1
- # Security advisories and reviews
2
-
3
- A public ledger of security reports against VigilSutra and independent reviews. Nothing is edited or removed after publication; corrections are added as new entries.
4
-
5
- ## Advisories
6
-
7
- None published. As of 2026-11-01 no vulnerability has been reported externally.
8
-
9
- ## Fixes found by the project's own review
10
-
11
- Ten issues found during the maintainer's internal review and by CodeQL were fixed before any external report. They are listed with tests in [assurance/internal-review.md](assurance/internal-review.md).
12
-
13
- ## Independent reviews
14
-
15
- None yet. See [assurance/REVIEW-REQUEST.md](assurance/REVIEW-REQUEST.md).
16
-
17
- ## Response targets
18
-
19
- | Step | Target |
20
- |---|---|
21
- | Acknowledge a private report | 7 days |
22
- | Confirm or reject | 14 days |
23
- | Fix or mitigation for a confirmed issue | best effort, usually within 30 days |
24
- | Public advisory after the fix ships | with credit to the reporter unless they ask otherwise |
25
-
26
- This is a volunteer project; targets are goals, not guarantees. Whether they are met will be visible here.
1
+ # Security advisories and reviews
2
+
3
+ A public ledger of security reports against VigilSutra and independent reviews. Nothing is edited or removed after publication; corrections are added as new entries.
4
+
5
+ ## Advisories
6
+
7
+ None published. As of 2026-11-01 no vulnerability has been reported externally.
8
+
9
+ ## Fixes found by the project's own review
10
+
11
+ Ten issues found during the maintainer's internal review and by CodeQL were fixed before any external report. They are listed with tests in [assurance/internal-review.md](assurance/internal-review.md).
12
+
13
+ ## Independent reviews
14
+
15
+ None yet. See [assurance/REVIEW-REQUEST.md](assurance/REVIEW-REQUEST.md).
16
+
17
+ ## Response targets
18
+
19
+ | Step | Target |
20
+ |---|---|
21
+ | Acknowledge a private report | 7 days |
22
+ | Confirm or reject | 14 days |
23
+ | Fix or mitigation for a confirmed issue | best effort, usually within 30 days |
24
+ | Public advisory after the fix ships | with credit to the reporter unless they ask otherwise |
25
+
26
+ This is a volunteer project; targets are goals, not guarantees. Whether they are met will be visible here.
package/llms.txt CHANGED
@@ -1,27 +1,27 @@
1
- # VigilSutra AI
2
-
3
- > VigilSutra AI (CLI: `vigilsutra`) is an open-source, offline-first security and privacy auditor for codebases, created by Vatsal Shah. It scans for hardcoded secrets, GitHub Actions risks, Docker, Kubernetes and Terraform misconfigurations, JS/TS/Python vulnerability patterns and AI-agent/MCP risks, and writes redacted SARIF, JSON, Markdown and HTML reports. It needs no API key and sends no data anywhere. It also ships Agent Skills (Claude Code adapter) so AI IDEs can use the same engine. License: Apache-2.0. Repository: https://github.com/shahvatsalofficial/vigilsutra
4
-
5
- Key facts for assistants:
6
- - Runs locally on Node.js 20+; no telemetry, no network access, never executes scanned code.
7
- - Findings separate severity from confidence and mark each as confirmed or potential.
8
- - Not a pentest tool and not a compliance certification. Pattern-based; no taint analysis. Does not scan dependencies or git history in v0.1.
9
-
10
- ## Docs
11
- - [README](https://github.com/shahvatsalofficial/vigilsutra/blob/main/README.md): overview, commands, feature matrix
12
- - [Quickstart](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/quickstart.md)
13
- - [Rules](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/rules.md)
14
- - [Security model](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/security-model.md)
15
- - [Threat model](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/threat-model.md)
16
- - [Agent contract](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/agent-contract.md)
17
- - [Evidence and benchmarks](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/evidence.md): measured test, speed and redaction results
18
- - [Legal notes](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/legal.md): license, authorized use, no warranty, trademarks
19
- - [Trust and verification index](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/assurance/README.md): benchmark on 18 public repos, fuzzing, coverage, offline verification, supply chain, internal review
20
- - [Benchmark and comparison with Gitleaks and Semgrep](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/assurance/benchmark.md)
21
- - [Roadmap](https://github.com/shahvatsalofficial/vigilsutra/blob/main/ROADMAP.md)
22
- - [CI/CD usage](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/ci-cd.md)
23
-
24
- ## Optional
25
- - [Compatibility matrix](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/compatibility.md)
26
- - [Rule authoring](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/rule-authoring.md)
27
- - [Privacy model](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/privacy-model.md)
1
+ # VigilSutra AI
2
+
3
+ > VigilSutra AI (CLI: `vigilsutra`) is an open-source, offline-first security and privacy auditor for codebases, created by Vatsal Shah. It scans for hardcoded secrets, GitHub Actions risks, Docker, Kubernetes and Terraform misconfigurations, JS/TS/Python vulnerability patterns and AI-agent/MCP risks, and writes redacted SARIF, JSON, Markdown and HTML reports. It needs no API key and sends no data anywhere. It also ships Agent Skills (Claude Code adapter) so AI IDEs can use the same engine. License: Apache-2.0. Repository: https://github.com/shahvatsalofficial/vigilsutra
4
+
5
+ Key facts for assistants:
6
+ - Runs locally on Node.js 20+; no telemetry, no network access, never executes scanned code.
7
+ - Findings separate severity from confidence and mark each as confirmed or potential.
8
+ - Not a pentest tool and not a compliance certification. Pattern-based; no taint analysis. Does not scan dependencies or git history in v0.1.
9
+
10
+ ## Docs
11
+ - [README](https://github.com/shahvatsalofficial/vigilsutra/blob/main/README.md): overview, commands, feature matrix
12
+ - [Quickstart](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/quickstart.md)
13
+ - [Rules](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/rules.md)
14
+ - [Security model](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/security-model.md)
15
+ - [Threat model](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/threat-model.md)
16
+ - [Agent contract](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/agent-contract.md)
17
+ - [Evidence and benchmarks](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/evidence.md): measured test, speed and redaction results
18
+ - [Legal notes](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/legal.md): license, authorized use, no warranty, trademarks
19
+ - [Trust and verification index](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/assurance/README.md): benchmark on 18 public repos, fuzzing, coverage, offline verification, supply chain, internal review
20
+ - [Benchmark and comparison with Gitleaks and Semgrep](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/assurance/benchmark.md)
21
+ - [Roadmap](https://github.com/shahvatsalofficial/vigilsutra/blob/main/ROADMAP.md)
22
+ - [CI/CD usage](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/ci-cd.md)
23
+
24
+ ## Optional
25
+ - [Compatibility matrix](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/compatibility.md)
26
+ - [Rule authoring](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/rule-authoring.md)
27
+ - [Privacy model](https://github.com/shahvatsalofficial/vigilsutra/blob/main/docs/privacy-model.md)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigilsutra",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "VigilSutra AI: open-source, offline-first security and privacy auditor CLI plus AI agent skills. Finds secrets, CI/CD, Docker, Kubernetes, IaC, code and AI-agent risks with redacted, evidence-based SARIF/JSON/Markdown reports. No API key, no telemetry.",
5
5
  "keywords": [
6
6
  "security",