torusguard 1.4.0 โ 2.1.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/.torusguard/.manifest.json +50 -28
- package/.torusguard/auth.json +5 -0
- package/.torusguard/rules/container/TG-CONT-001-root-user-execution.md +50 -0
- package/.torusguard/rules/container/TG-CONT-002-docker-socket-mount.md +47 -0
- package/.torusguard/rules/container/TG-CONT-003-privileged-container-mode.md +53 -0
- package/.torusguard/rules/container/TG-CONT-004-build-arg-secret-exposure.md +43 -0
- package/.torusguard/rules/git/TG-GIT-001-historical-secret-in-git-commit.md +44 -0
- package/.torusguard/rules/git/TG-GIT-002-plaintext-credentials-in-git-config.md +41 -0
- package/.torusguard/rules/git/TG-GIT-003-sensitive-tracked-file-gitignore-breach.md +40 -0
- package/.torusguard/rules/rag/TG-RAG-001-untrusted-rag-context-injection.md +72 -0
- package/.torusguard/rules/rag/TG-RAG-002-autonomous-llm-tool-unsandboxed-call.md +51 -0
- package/.torusguard/rules/rag/TG-RAG-003-unpartitioned-vector-tenant-lookup.md +51 -0
- package/.torusguard/rules/redos/TG-REDOS-001-catastrophic-exponential-backtracking.md +46 -0
- package/.torusguard/rules/redos/TG-REDOS-002-unbounded-nested-quantifier.md +43 -0
- package/.torusguard/rules_catalog.json +338 -518
- package/.torusguard/scripts/__pycache__/apply_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/audit_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/harden_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/html_reporter.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/manifest_builder.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/recipes_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/report_sync.cpython-314.pyc +0 -0
- package/.torusguard/scripts/manifest_builder.py +1 -1
- package/.torusguard/skills/torusguard/SKILL.md +69 -24
- package/.torusguard/skills/torusguard/bootstrap.py +57 -24
- package/.torusguard/skills/torusguard-ai-guard/SKILL.md +95 -0
- package/.torusguard/skills/torusguard-apply/SKILL.md +60 -34
- package/.torusguard/skills/torusguard-audit/SKILL.md +73 -24
- package/.torusguard/skills/torusguard-authorize/SKILL.md +48 -6
- package/.torusguard/skills/torusguard-container/SKILL.md +94 -0
- package/.torusguard/skills/torusguard-exploit-check/SKILL.md +50 -6
- package/.torusguard/skills/torusguard-full/SKILL.md +62 -19
- package/.torusguard/skills/torusguard-git-mine/SKILL.md +92 -0
- package/.torusguard/skills/torusguard-harden/SKILL.md +81 -50
- package/.torusguard/skills/torusguard-init/SKILL.md +61 -14
- package/.torusguard/skills/torusguard-ocr-scan/SKILL.md +94 -0
- package/.torusguard/skills/torusguard-recheck/SKILL.md +71 -18
- package/.torusguard/skills/torusguard-redos/SKILL.md +91 -0
- package/.torusguard/skills/torusguard-report/SKILL.md +50 -9
- package/.torusguard/skills/torusguard-status/SKILL.md +63 -10
- package/.torusguard/skills/torusguard-verify/SKILL.md +52 -10
- package/.torusguard/skills/torusguard-web-validate/SKILL.md +53 -8
- package/.torusguard/snapshots/20260921-182638/go.mod.bak +11 -0
- package/.torusguard/snapshots/20260921-185213/file.go.bak +5 -0
- package/.torusguard/workflows/ai-guard.md +31 -0
- package/.torusguard/workflows/apply.md +32 -55
- package/.torusguard/workflows/audit.md +28 -46
- package/.torusguard/workflows/authorize.md +27 -50
- package/.torusguard/workflows/container.md +29 -0
- package/.torusguard/workflows/exploit-check.md +28 -50
- package/.torusguard/workflows/git-mine.md +25 -0
- package/.torusguard/workflows/harden.md +29 -48
- package/.torusguard/workflows/init.md +27 -50
- package/.torusguard/workflows/memory.md +18 -23
- package/.torusguard/workflows/ocr-scan.md +25 -0
- package/.torusguard/workflows/recheck.md +28 -46
- package/.torusguard/workflows/redos.md +27 -0
- package/.torusguard/workflows/report.md +33 -52
- package/.torusguard/workflows/status.md +31 -52
- package/.torusguard/workflows/verify.md +29 -49
- package/.torusguard/workflows/web-validate.md +22 -45
- package/README.md +336 -386
- package/package.json +1 -1
- package/skills/torusguard/SKILL.md +71 -24
- package/skills/torusguard/__pycache__/bootstrap.cpython-314.pyc +0 -0
- package/skills/torusguard/bootstrap.py +60 -71
- package/skills/torusguard/payload/.manifest.json +50 -28
- package/skills/torusguard/payload/TORUSGUARD.md +145 -145
- package/skills/torusguard/payload/agents/auditor.md +41 -41
- package/skills/torusguard/payload/agents/profiler.md +49 -49
- package/skills/torusguard/payload/agents/remediator.md +41 -41
- package/skills/torusguard/payload/agents/reviewer.md +39 -39
- package/skills/torusguard/payload/agents/validator.md +46 -46
- package/skills/torusguard/payload/config/scope.json +24 -24
- package/skills/torusguard/payload/references/csharp-security.md +41 -41
- package/skills/torusguard/payload/references/go-security.md +41 -41
- package/skills/torusguard/payload/references/java-security.md +40 -40
- package/skills/torusguard/payload/references/polyglot-security-matrix.md +25 -25
- package/skills/torusguard/payload/references/rust-security.md +40 -40
- package/skills/torusguard/payload/rules/container/TG-CONT-001-root-user-execution.md +50 -0
- package/skills/torusguard/payload/rules/container/TG-CONT-002-docker-socket-mount.md +47 -0
- package/skills/torusguard/payload/rules/container/TG-CONT-003-privileged-container-mode.md +53 -0
- package/skills/torusguard/payload/rules/container/TG-CONT-004-build-arg-secret-exposure.md +43 -0
- package/skills/torusguard/payload/rules/custom/.gitkeep +1 -1
- package/skills/torusguard/payload/rules/custom/README.md +30 -30
- package/skills/torusguard/payload/rules/git/TG-GIT-001-historical-secret-in-git-commit.md +44 -0
- package/skills/torusguard/payload/rules/git/TG-GIT-002-plaintext-credentials-in-git-config.md +41 -0
- package/skills/torusguard/payload/rules/git/TG-GIT-003-sensitive-tracked-file-gitignore-breach.md +40 -0
- package/skills/torusguard/payload/rules/rag/TG-RAG-001-untrusted-rag-context-injection.md +72 -0
- package/skills/torusguard/payload/rules/rag/TG-RAG-002-autonomous-llm-tool-unsandboxed-call.md +51 -0
- package/skills/torusguard/payload/rules/rag/TG-RAG-003-unpartitioned-vector-tenant-lookup.md +51 -0
- package/skills/torusguard/payload/rules/redos/TG-REDOS-001-catastrophic-exponential-backtracking.md +46 -0
- package/skills/torusguard/payload/rules/redos/TG-REDOS-002-unbounded-nested-quantifier.md +43 -0
- package/skills/torusguard/payload/rules_catalog.json +338 -518
- package/skills/torusguard/payload/scripts/__pycache__/term_ui.cpython-314.pyc +0 -0
- package/skills/torusguard/payload/scripts/manifest_builder.py +1 -1
- package/skills/torusguard/payload/scripts/rules_sync.py +321 -321
- package/skills/torusguard/payload/scripts/safety_gate.py +64 -64
- package/skills/torusguard/payload/skills/torusguard/SKILL.md +69 -24
- package/skills/torusguard/payload/skills/torusguard/bootstrap.py +57 -24
- package/skills/torusguard/payload/skills/torusguard-ai-guard/SKILL.md +95 -0
- package/skills/torusguard/payload/skills/torusguard-apply/SKILL.md +60 -34
- package/skills/torusguard/payload/skills/torusguard-audit/SKILL.md +73 -24
- package/skills/torusguard/payload/skills/torusguard-authorize/SKILL.md +48 -6
- package/skills/torusguard/payload/skills/torusguard-container/SKILL.md +94 -0
- package/skills/torusguard/payload/skills/torusguard-exploit-check/SKILL.md +50 -6
- package/skills/torusguard/payload/skills/torusguard-full/SKILL.md +62 -19
- package/skills/torusguard/payload/skills/torusguard-git-mine/SKILL.md +92 -0
- package/skills/torusguard/payload/skills/torusguard-harden/SKILL.md +81 -50
- package/skills/torusguard/payload/skills/torusguard-init/SKILL.md +61 -14
- package/skills/torusguard/payload/skills/torusguard-ocr-scan/SKILL.md +94 -0
- package/skills/torusguard/payload/skills/torusguard-recheck/SKILL.md +71 -18
- package/skills/torusguard/payload/skills/torusguard-redos/SKILL.md +91 -0
- package/skills/torusguard/payload/skills/torusguard-report/SKILL.md +50 -9
- package/skills/torusguard/payload/skills/torusguard-status/SKILL.md +63 -10
- package/skills/torusguard/payload/skills/torusguard-verify/SKILL.md +52 -10
- package/skills/torusguard/payload/skills/torusguard-web-validate/SKILL.md +53 -8
- package/skills/torusguard/payload/templates/audit-report.template.md +54 -54
- package/skills/torusguard/payload/templates/authorization.template.md +34 -34
- package/skills/torusguard/payload/templates/finding-card.template.md +32 -32
- package/skills/torusguard/payload/templates/remediation-bundle.template.md +35 -35
- package/skills/torusguard/payload/workflows/ai-guard.md +31 -0
- package/skills/torusguard/payload/workflows/apply.md +31 -62
- package/skills/torusguard/payload/workflows/audit.md +27 -51
- package/skills/torusguard/payload/workflows/authorize.md +27 -50
- package/skills/torusguard/payload/workflows/container.md +29 -0
- package/skills/torusguard/payload/workflows/exploit-check.md +28 -50
- package/skills/torusguard/payload/workflows/git-mine.md +25 -0
- package/skills/torusguard/payload/workflows/harden.md +28 -52
- package/skills/torusguard/payload/workflows/init.md +27 -56
- package/skills/torusguard/payload/workflows/memory.md +18 -23
- package/skills/torusguard/payload/workflows/ocr-scan.md +25 -0
- package/skills/torusguard/payload/workflows/recheck.md +28 -46
- package/skills/torusguard/payload/workflows/redos.md +27 -0
- package/skills/torusguard/payload/workflows/report.md +39 -62
- package/skills/torusguard/payload/workflows/status.md +31 -55
- package/skills/torusguard/payload/workflows/verify.md +29 -49
- package/skills/torusguard/payload/workflows/web-validate.md +22 -45
- package/skills/torusguard/references/csharp-security.md +41 -0
- package/skills/torusguard/references/go-security.md +41 -0
- package/skills/torusguard/references/java-security.md +40 -0
- package/skills/torusguard/references/polyglot-security-matrix.md +25 -0
- package/skills/torusguard/references/rust-security.md +40 -0
- package/skills/torusguard-ai-guard/SKILL.md +95 -0
- package/skills/torusguard-apply/SKILL.md +60 -34
- package/skills/torusguard-audit/SKILL.md +73 -24
- package/skills/torusguard-authorize/SKILL.md +48 -6
- package/skills/torusguard-container/SKILL.md +94 -0
- package/skills/torusguard-exploit-check/SKILL.md +50 -6
- package/skills/torusguard-full/SKILL.md +62 -19
- package/skills/torusguard-git-mine/SKILL.md +92 -0
- package/skills/torusguard-harden/SKILL.md +81 -50
- package/skills/torusguard-init/SKILL.md +61 -14
- package/skills/torusguard-ocr-scan/SKILL.md +94 -0
- package/skills/torusguard-recheck/SKILL.md +71 -18
- package/skills/torusguard-redos/SKILL.md +91 -0
- package/skills/torusguard-report/SKILL.md +50 -9
- package/skills/torusguard-status/SKILL.md +63 -10
- package/skills/torusguard-verify/SKILL.md +52 -10
- package/skills/torusguard-web-validate/SKILL.md +53 -8
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# /torusguard-ocr-scan โ Multi-Modal OCR Secret Scanning
|
|
2
|
+
|
|
3
|
+
$ARGUMENTS
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Objective
|
|
8
|
+
Detect optical leaks of private API keys, AWS credentials, database URIs, GitHub personal access tokens, and private certificates embedded inside visual artifacts (`.png`, `.jpg`, `.jpeg`, `.webp`, `.bmp`, `.tiff`) up to 10MB using Tesseract OCR and deterministic regex signatures.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Tri-Mode Parity
|
|
13
|
+
- **Mode A (Terminal CLI):** `torusguard ocr-scan <target>`
|
|
14
|
+
- **Mode B (AI Chat Slash Command):** `/torusguard ocr-scan <target>`
|
|
15
|
+
- **Mode C (Native MCP Tool):** `torusguard_ocr_scan`
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Execution Steps
|
|
20
|
+
|
|
21
|
+
1. **Verify Target:** Check target image or directory exists on disk.
|
|
22
|
+
2. **Inspect File Size:** Reject images exceeding 10MB (`DefaultMaxImageSize`) to preserve DoS resilience.
|
|
23
|
+
3. **Execute OCR Extraction:** Run Tesseract optical text analysis via Go scanner or MCP tool.
|
|
24
|
+
4. **Pattern Match Secrets:** Evaluate optical text against `TG-SEC-001` through `TG-SEC-007` signatures.
|
|
25
|
+
5. **Redact & Report:** Emit sanitized finding cards and synchronize into `security_report.md`.
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Targeted differential AST re-scan, fix closure verification, and regression state machine transitions.
|
|
3
|
-
tools: Read, Grep, Glob, Bash, Write
|
|
4
|
-
version:
|
|
3
|
+
tools: Read, Grep, Glob, Bash, Write, run_command
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
agent: reviewer
|
|
6
6
|
lifecycle-phase: Phase 6 (Targeted Recheck & Verification)
|
|
7
7
|
required-skills:
|
|
8
8
|
- torusguard-recheck
|
|
9
9
|
scripts-binding:
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
- .torusguard/scripts/finding_scorer.py
|
|
10
|
+
- internal/recheck/recheck.go
|
|
11
|
+
- cmd/torusguard/main.go
|
|
12
|
+
- cmd/torusguard/mcp.go
|
|
14
13
|
---
|
|
15
14
|
|
|
16
15
|
# /torusguard recheck โ Targeted Differential Recheck & Regression Audit
|
|
@@ -20,31 +19,28 @@ $ARGUMENTS
|
|
|
20
19
|
---
|
|
21
20
|
|
|
22
21
|
## Objective
|
|
23
|
-
Targeted differential AST re-scan, fix closure verification, and regression state transitions.
|
|
22
|
+
Targeted differential AST re-scan, fix closure verification, and regression state machine transitions across modified files.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Tri-Mode Execution
|
|
27
|
+
|
|
28
|
+
| Mode | Command / Tool | Execution Method |
|
|
29
|
+
| :--- | :--- | :--- |
|
|
30
|
+
| **Mode A: Terminal CLI** | `torusguard recheck` | Terminal execution of differential AST scanner. |
|
|
31
|
+
| **Mode B: AI Chat Slash** | `/torusguard recheck` | Conversational differential review and regression verification. |
|
|
32
|
+
| **Mode C: Native MCP Tool** | `torusguard_recheck` | Agent tool call with `{"target": "."}` returning diff assertions. |
|
|
24
33
|
|
|
25
34
|
---
|
|
26
35
|
|
|
27
36
|
## Mandatory Pre-Flight Context Inspection
|
|
28
37
|
|
|
29
38
|
Inspect applied patch history and target file scope before re-checking:
|
|
30
|
-
1. **Applied Patch Record:**
|
|
39
|
+
1. **Applied Patch Record:** Inspect git status or diff for modified files.
|
|
31
40
|
2. **Scope Limitation:** Restrict differential scan strictly to modified files to conserve token budget.
|
|
32
|
-
3. **Rollback Availability:** Confirm `.bak` snapshot exists in
|
|
41
|
+
3. **Rollback Availability:** Confirm `.bak` snapshot exists in `.torusguard/snapshots/` in case regression is detected.
|
|
33
42
|
4. **4-State Transition Engine:** Prepare to transition findings to `Fixed`, `Partially Fixed`, `Not Fixed`, or `Regression`.
|
|
34
43
|
5. **Fresh Syntax Validation:** Ensure no compiler or syntax errors exist before re-evaluating rules.
|
|
35
|
-
6. **AST Consistency:** Ensure imported dependencies on modified lines resolve correctly.
|
|
36
|
-
|
|
37
|
-
---
|
|
38
|
-
|
|
39
|
-
## When to Use /torusguard recheck
|
|
40
|
-
|
|
41
|
-
| Trigger Scenario | Recommended Action |
|
|
42
|
-
| :--- | :--- |
|
|
43
|
-
| Immediately after applying a remediation patch | Run `/torusguard recheck` |
|
|
44
|
-
| Verifying that a specific finding is eliminated | Run `/torusguard recheck` |
|
|
45
|
-
| Checking whether a patch introduced new security flaws | Run `/torusguard recheck` |
|
|
46
|
-
| Whole repository baseline audit | Run `/torusguard audit` |
|
|
47
|
-
| Generating final signed release report | Run `/torusguard report` |
|
|
48
44
|
|
|
49
45
|
---
|
|
50
46
|
|
|
@@ -52,32 +48,19 @@ Inspect applied patch history and target file scope before re-checking:
|
|
|
52
48
|
- Verified fix closures transition findings in `security_report.md` to `RESOLVED ๐ข`.
|
|
53
49
|
- Regressions transition findings to `REGRESSED โ`.
|
|
54
50
|
|
|
55
|
-
## Execution Steps
|
|
56
|
-
|
|
57
|
-
1. **Identify Modified Files:** Extract list of altered files from latest apply step.
|
|
58
|
-
2. **Execute Differential AST Scan:** Re-run active security rules exclusively against modified files.
|
|
59
|
-
3. **Evaluate Finding Status:**
|
|
60
|
-
- If original vulnerable AST pattern is absent and no new sink appears: transition to `Fixed`.
|
|
61
|
-
- If new security rule triggers on altered lines: classify as `Regression`.
|
|
62
|
-
4. **Update Finding State:** Record verified resolution status into `findings.json`.
|
|
63
|
-
5. **Emit Recheck Report:** Write `recheck-report.md` into the active run folder.
|
|
64
|
-
|
|
65
|
-
---
|
|
66
|
-
|
|
67
|
-
## Failure Recovery
|
|
68
|
-
|
|
69
|
-
- **Finding Still Present (`Not Fixed`):** Review patch diff; the remediation did not neutralize the AST sink.
|
|
70
|
-
- **New Vulnerability Detected (`Regression`):** Alert operator; prompt to revert from `.bak` snapshot.
|
|
71
|
-
- **File Not Found:** Verify file path matches git repository layout.
|
|
72
|
-
- **Halt Trigger:** Abort if diff shows changes outside approved patch scope.
|
|
73
|
-
|
|
74
51
|
---
|
|
75
52
|
|
|
76
|
-
##
|
|
53
|
+
## Execution Steps
|
|
77
54
|
|
|
78
|
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
55
|
+
1. **Trigger Recheck:**
|
|
56
|
+
- **Mode A (CLI):** Run `torusguard recheck`.
|
|
57
|
+
- **Mode B (Chat):** Review modified files and re-scan AST sinks.
|
|
58
|
+
- **Mode C (MCP):** Call `torusguard_recheck`.
|
|
59
|
+
2. **Evaluate Finding Status:**
|
|
60
|
+
- If original vulnerable pattern is absent and no new sink appears: transition to `โ [Confirmed Fixed]`.
|
|
61
|
+
- If new security rule triggers on altered lines: classify as `โ [Regressed]`.
|
|
62
|
+
3. **Update Finding State:** Update `security_report.md`.
|
|
63
|
+
4. **Recommend Posture Report:** Advise running `torusguard report --html`.
|
|
81
64
|
|
|
82
65
|
---
|
|
83
66
|
|
|
@@ -89,7 +72,6 @@ Inspect applied patch history and target file scope before re-checking:
|
|
|
89
72
|
- **Target Finding:** `TG-XXX-HASH`
|
|
90
73
|
- **Result:** [FIXED / REGRESSION / PARTIAL]
|
|
91
74
|
- **Regressions Introduced:** 0
|
|
92
|
-
- **Report:** `.torusguard/runs/<run_id>/recheck-report.md`
|
|
93
75
|
- **Status:** VERIFIED โ ready for `/torusguard report`
|
|
94
76
|
```
|
|
95
77
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# /torusguard-redos โ Regular Expression Complexity Scanner
|
|
2
|
+
|
|
3
|
+
$ARGUMENTS
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Objective
|
|
8
|
+
Detect and remediate catastrophic exponential ($O(2^n)$) and polynomial backtracking regular expressions in web applications to prevent availability and thread starvation DoS attacks.
|
|
9
|
+
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Tri-Mode Parity
|
|
13
|
+
- **Mode A (Terminal CLI):** `torusguard redos [target]`
|
|
14
|
+
- **Mode B (AI Chat Slash Command):** `/torusguard redos [target]`
|
|
15
|
+
- **Mode C (Native MCP Tool):** `torusguard_redos`
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Execution Steps
|
|
20
|
+
|
|
21
|
+
1. **Locate Regex Definitions:** Walk source tree to find regex literals and constructor calls (`RegExp`, `re.compile`, `regexp.MustCompile`).
|
|
22
|
+
2. **Analyze Backtracking Complexity:**
|
|
23
|
+
- Detect nested quantifiers (`(x+)+`, `(x*)*`) causing $O(2^n)$ exponential blowup (`TG-REDOS-001`).
|
|
24
|
+
- Detect overlapping alternations with outer repetition causing polynomial blowup (`TG-REDOS-002`).
|
|
25
|
+
3. **Audit Input Length Guardrails:** Check if untrusted inputs evaluated against regexes are bounded in character length.
|
|
26
|
+
4. **Formulate Safe Remediation:** Refactor vulnerable regexes into linear deterministic expressions, anchor tokens, or parser logic.
|
|
27
|
+
5. **Synchronize Report:** Log all ReDoS findings in `security_report.md`.
|
|
@@ -1,105 +1,82 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: Executive posture reporting,
|
|
3
|
-
tools: Read, Grep, Glob, Bash, Write
|
|
4
|
-
version: 2.
|
|
2
|
+
description: Executive posture reporting, cluster analysis, signed compliance audit, and OASIS SARIF v2.1.0 structured export.
|
|
3
|
+
tools: Read, Grep, Glob, Bash, Write, run_command
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
agent: reviewer
|
|
6
6
|
lifecycle-phase: Phase 7 (Reporting & SARIF Export)
|
|
7
7
|
required-skills:
|
|
8
8
|
- torusguard-report
|
|
9
9
|
scripts-binding:
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
-
|
|
14
|
-
- .torusguard/scripts/term_ui.py
|
|
10
|
+
- internal/report/html.go
|
|
11
|
+
- internal/report/sarif.go
|
|
12
|
+
- cmd/torusguard/main.go
|
|
13
|
+
- cmd/torusguard/mcp.go
|
|
15
14
|
---
|
|
16
15
|
|
|
17
|
-
# /torusguard report โ Unified Security Posture Report & SARIF
|
|
16
|
+
# /torusguard report โ Unified Security Posture Report & SARIF Export
|
|
18
17
|
|
|
19
18
|
$ARGUMENTS
|
|
20
19
|
|
|
21
20
|
---
|
|
22
21
|
|
|
23
22
|
## Objective
|
|
24
|
-
|
|
23
|
+
Executive posture reporting, cluster analysis, signed compliance audit, and OASIS SARIF v2.1.0 export.
|
|
25
24
|
|
|
26
25
|
---
|
|
27
26
|
|
|
28
|
-
##
|
|
27
|
+
## Tri-Mode Execution
|
|
29
28
|
|
|
30
|
-
|
|
|
31
|
-
| :--- | :--- | :--- |
|
|
32
|
-
| **
|
|
33
|
-
| **
|
|
34
|
-
| **
|
|
35
|
-
| **Custom Path** | `npx torusguard report --html --out <path>` | `/torusguard report --out <path>` | Specified path + latest run mirror |
|
|
36
|
-
| **Monorepo Subproject** | `npx torusguard report --target <dir> --html` | `/torusguard report --target <dir>` | `<dir>/report.html` |
|
|
29
|
+
| Mode | Command / Tool | Execution Method |
|
|
30
|
+
| :--- | :--- | :--- |
|
|
31
|
+
| **Mode A: Terminal CLI** | `torusguard report --html [--sarif]` | Shell compilation of HTML dashboard and SARIF log. |
|
|
32
|
+
| **Mode B: AI Chat Slash** | `/torusguard report` | Executive summary generation and posture calculation. |
|
|
33
|
+
| **Mode C: Native MCP Tool** | `torusguard://security_report` | Agent reads resource payload directly from living report. |
|
|
37
34
|
|
|
38
35
|
---
|
|
39
36
|
|
|
40
37
|
## Mandatory Pre-Flight Context Inspection
|
|
41
38
|
|
|
42
39
|
Inspect run records and reporting parameters before generating release artifacts:
|
|
43
|
-
1. **
|
|
44
|
-
2. **
|
|
45
|
-
3. **
|
|
46
|
-
4. **
|
|
47
|
-
5. **Zero
|
|
48
|
-
6. **Secret Masking:** Ensure zero unredacted authorization tokens or API keys appear in report text.
|
|
40
|
+
1. **Living Report State:** Ensure `security_report.md` exists and reflects latest findings.
|
|
41
|
+
2. **SARIF v2.1.0 Schema:** Validate output structure against official OASIS SARIF standard.
|
|
42
|
+
3. **Multi-Analysis Category:** Tag static findings under category `torusguard/static` to prevent CI collision.
|
|
43
|
+
4. **Secret Masking:** Ensure zero unredacted authorization tokens or API keys appear in report.
|
|
44
|
+
5. **Zero-CDN Guarantee:** Ensure HTML report contains zero external CDN script dependencies.
|
|
49
45
|
|
|
50
46
|
---
|
|
51
47
|
|
|
52
|
-
##
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
1. **Safe Defenses vs Harmed Exposure:** Complete Defended Invariants inventory across all 74 rules in 18 architectural families. Clean codebases earn 100/100 (74 Defended, 0 Harmed).
|
|
56
|
-
2. **Directory Attack Surface Heatmap:** Visual directory tree of exposure risk. Clicking any directory card filters the findings table to that specific folder.
|
|
57
|
-
3. **Golden Recipe Explorer:** Distilled, verified fix patterns with before/after code templates and one-click clipboard copying.
|
|
58
|
-
4. **Prescriptive Next Best Defenses:** Stack-aware security recommendations with copyable `npx torusguard harden` commands.
|
|
59
|
-
5. **Client-Side Exporters:** Zero-network buttons to download OASIS SARIF v2.1.0 and CSV records directly from browser memory.
|
|
60
|
-
6. **Multi-Agent AI Prompt Presets:** One-click prompts tailored for Cursor (`.cursorrules`), Claude Code (`CLAUDE.md`), Antigravity, and GitHub Copilot.
|
|
61
|
-
7. **Print & PDF Styling:** Built-in high-contrast `@media print` layout for boardroom and compliance distribution.
|
|
48
|
+
## Living Report Invariant
|
|
49
|
+
- Executive posture reports incorporate health scoring and metrics from `security_report.md`.
|
|
50
|
+
- Emits visual dark-mode HTML (`--html`) and OASIS SARIF v2.1.0 (`--sarif`).
|
|
62
51
|
|
|
63
52
|
---
|
|
64
53
|
|
|
65
54
|
## Execution Steps
|
|
66
55
|
|
|
67
|
-
1. **
|
|
68
|
-
-
|
|
69
|
-
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
- **For HTML:**
|
|
76
|
-
```bash
|
|
77
|
-
python .torusguard/scripts/html_reporter.py [--out <path>] [--root <target>]
|
|
78
|
-
```
|
|
79
|
-
3. **Synchronize Dual Ledger:**
|
|
80
|
-
- Verify `security_report.md` matches `report.html` findings and posture score.
|
|
81
|
-
4. **Emit 75-Column Visual Summary Card:**
|
|
82
|
-
- Present markdown output card with direct clickable links to both `report.html` and `security_report.md`.
|
|
56
|
+
1. **Trigger Report Generation:**
|
|
57
|
+
- **Mode A (CLI):** Run `torusguard report --html --sarif`.
|
|
58
|
+
- **Mode B (Chat):** Calculate posture score from `security_report.md` and present summary card.
|
|
59
|
+
- **Mode C (MCP):** Query resource `torusguard://security_report`.
|
|
60
|
+
2. **Compile Visual HTML:** Generate zero-dependency dark-mode HTML dashboard at `report.html`.
|
|
61
|
+
3. **Export SARIF v2.1.0:** Produce schema-compliant SARIF log for CI/CD pipelines.
|
|
62
|
+
4. **Sign Off Ledger:** Confirm artifacts are persisted to disk.
|
|
83
63
|
|
|
84
64
|
---
|
|
85
65
|
|
|
86
66
|
## Output Card Format
|
|
87
67
|
|
|
88
68
|
```markdown
|
|
89
|
-
###
|
|
90
|
-
- **Posture Score:**
|
|
91
|
-
- **Invariants
|
|
92
|
-
- **
|
|
93
|
-
- **
|
|
94
|
-
- **
|
|
95
|
-
- **Status:** COMPLETE โ dual-ledger synchronized
|
|
69
|
+
### ๐ TorusGuard Security Posture Report
|
|
70
|
+
- **Posture Score:** 100/100 (OPTIMAL DEFENSE)
|
|
71
|
+
- **Total Invariants:** 74 Defended across 18 families
|
|
72
|
+
- **HTML Dashboard:** `report.html`
|
|
73
|
+
- **SARIF v2.1.0 Export:** `results.sarif`
|
|
74
|
+
- **Living Ledger:** `security_report.md`
|
|
96
75
|
```
|
|
97
76
|
|
|
98
77
|
---
|
|
99
78
|
|
|
100
|
-
##
|
|
79
|
+
## Next Steps
|
|
101
80
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
- **Missing SARIF Input:** Auto-discovers findings from the latest audit run in `.torusguard/runs/`.
|
|
105
|
-
- **Clean Workspace:** Emits 100/100 posture score with all 74 defended invariants listed.
|
|
81
|
+
1. Upload `results.sarif` to GitHub Code Scanning via `.github/workflows/`.
|
|
82
|
+
2. Open `report.html` in browser for visual audit presentation.
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Read-only diagnostic overview of workspace security posture, active configuration, rules catalog, and run history.
|
|
3
|
-
tools: Read, Grep, Glob, Bash
|
|
4
|
-
version:
|
|
3
|
+
tools: Read, Grep, Glob, Bash, Write, run_command
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
agent: reviewer
|
|
6
6
|
lifecycle-phase: System / Diagnostics
|
|
7
7
|
required-skills:
|
|
8
8
|
- torusguard-status
|
|
9
9
|
scripts-binding:
|
|
10
|
-
-
|
|
11
|
-
-
|
|
10
|
+
- cmd/torusguard/main.go
|
|
11
|
+
- cmd/torusguard/mcp.go
|
|
12
|
+
- internal/workspace/workspace.go
|
|
12
13
|
---
|
|
13
14
|
|
|
14
15
|
# /torusguard status โ Workspace Security Posture & Diagnostic Overview
|
|
@@ -18,33 +19,27 @@ $ARGUMENTS
|
|
|
18
19
|
---
|
|
19
20
|
|
|
20
21
|
## Objective
|
|
21
|
-
Read-only diagnostic overview of workspace security posture, active configuration, and run history.
|
|
22
|
-
|
|
23
|
-
Supported CLI flags:
|
|
24
|
-
- `npx torusguard status [--target <dir>]` : Diagnostic check on specified project directory
|
|
22
|
+
Read-only diagnostic overview of workspace security posture, active configuration, and run history across 74 canonical security rules and 18 families.
|
|
25
23
|
|
|
26
24
|
---
|
|
27
25
|
|
|
28
|
-
##
|
|
26
|
+
## Tri-Mode Execution
|
|
29
27
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
5. **Read-Only Invariant:** Ensure command performs zero file modifications or disk mutations.
|
|
28
|
+
| Mode | Command / Tool | Execution Method |
|
|
29
|
+
| :--- | :--- | :--- |
|
|
30
|
+
| **Mode A: Terminal CLI** | `torusguard status [--json]` | Terminal execution of 75-column diagnostic cards. |
|
|
31
|
+
| **Mode B: AI Chat Slash** | `/torusguard status` | Conversational diagnostic inspection of active config and ledger. |
|
|
32
|
+
| **Mode C: Native MCP Tool** | `torusguard_status` | Agent tool call with `{"target": "."}` returning posture JSON/string. |
|
|
36
33
|
|
|
37
34
|
---
|
|
38
35
|
|
|
39
|
-
##
|
|
36
|
+
## Mandatory Pre-Flight Context Inspection
|
|
40
37
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
| Initializing workspace for the first time | Run `/torusguard init` |
|
|
47
|
-
| Executing full security scan | Run `/torusguard audit` |
|
|
38
|
+
Inspect workspace state and configuration records prior to status display:
|
|
39
|
+
1. **Config State (`.torusguard/config/torusguard.json`):** Confirm workspace initialization and read detected stack.
|
|
40
|
+
2. **Active Rules Directory (`.torusguard/rules/active/`):** Count active rule files (74 canonical rules).
|
|
41
|
+
3. **Living Report (`security_report.md`):** Read current open vs resolved findings.
|
|
42
|
+
4. **Read-Only Invariant:** Ensure command performs zero file modifications or disk mutations.
|
|
48
43
|
|
|
49
44
|
---
|
|
50
45
|
|
|
@@ -52,33 +47,16 @@ Inspect workspace state and configuration records prior to status display:
|
|
|
52
47
|
- Reads current health score and status breakdown directly from `security_report.md`.
|
|
53
48
|
- Displays 18 rule families and 74 rules in standardized 75-column terminal cards.
|
|
54
49
|
|
|
55
|
-
## Execution Steps
|
|
56
|
-
|
|
57
|
-
1. **Read Configuration:** Load `.torusguard/config/torusguard.json`; extract stack, version, and enabled rule count.
|
|
58
|
-
2. **Enumerate Active Rules:** Count rule files physically present in `.torusguard/rules/active/`.
|
|
59
|
-
3. **Inspect Run History:**
|
|
60
|
-
```bash
|
|
61
|
-
python .torusguard/scripts/run_manager.py list
|
|
62
|
-
```
|
|
63
|
-
4. **Evaluate Scope Expiry:** Parse `.torusguard/config/scope.json`; report if TTL is valid or expired.
|
|
64
|
-
5. **Print Status Overview:** Render complete workspace diagnostic overview card.
|
|
65
|
-
|
|
66
50
|
---
|
|
67
51
|
|
|
68
|
-
##
|
|
69
|
-
|
|
70
|
-
- **Uninitialized Workspace:** If config is missing, prompt user to execute `/torusguard init`.
|
|
71
|
-
- **Zero Runs Found:** Display clean status card noting no historical audit runs exist yet.
|
|
72
|
-
- **Corrupt Config File:** Report parsing error and recommend re-running `/torusguard init`.
|
|
73
|
-
- **Halt Trigger:** Abort command if read access to `.torusguard/` is denied.
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## Hallucination Guard
|
|
52
|
+
## Execution Steps
|
|
78
53
|
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
54
|
+
1. **Trigger Status Check:**
|
|
55
|
+
- **Mode A (CLI):** Run `torusguard status`.
|
|
56
|
+
- **Mode B (Chat):** Read `torusguard.json` and `security_report.md`.
|
|
57
|
+
- **Mode C (MCP):** Call `torusguard_status`.
|
|
58
|
+
2. **Evaluate Posture:** Report detected stack, active invariants, and living findings ledger.
|
|
59
|
+
3. **Recommend Next Actions:** Direct user to audit or remediation as needed.
|
|
82
60
|
|
|
83
61
|
---
|
|
84
62
|
|
|
@@ -86,13 +64,11 @@ Inspect workspace state and configuration records prior to status display:
|
|
|
86
64
|
|
|
87
65
|
```markdown
|
|
88
66
|
### ๐ก๏ธ TorusGuard Workspace Status
|
|
89
|
-
- **Version:**
|
|
90
|
-
- **Framework Detected:** [Stack
|
|
91
|
-
- **Active Rules:**
|
|
92
|
-
- **
|
|
93
|
-
- **
|
|
94
|
-
- **Scope Status:** [Authorized (TTL Active) / Expired / Unconfigured]
|
|
95
|
-
- **Health Posture:** [GOOD / ACTION NEEDED]
|
|
67
|
+
- **Version:** v2.0.0
|
|
68
|
+
- **Framework Detected:** [Stack]
|
|
69
|
+
- **Active Rules:** 74 canonical rules active across 18 families
|
|
70
|
+
- **Living Report:** `security_report.md`
|
|
71
|
+
- **Health Posture:** [OPTIMAL DEFENSE / ACTION NEEDED]
|
|
96
72
|
```
|
|
97
73
|
|
|
98
74
|
---
|
|
@@ -100,4 +76,4 @@ Inspect workspace state and configuration records prior to status display:
|
|
|
100
76
|
## Next Steps
|
|
101
77
|
|
|
102
78
|
1. Run `/torusguard audit` to scan codebase for security vulnerabilities.
|
|
103
|
-
2. Run `/torusguard
|
|
79
|
+
2. Run `/torusguard report --html` to view interactive dashboard.
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: Evidence sufficiency verification, live disk line match audit, and finding score refinement.
|
|
3
|
-
tools: Read, Grep, Glob, Bash, Write
|
|
4
|
-
version:
|
|
3
|
+
tools: Read, Grep, Glob, Bash, Write, run_command
|
|
4
|
+
version: 2.0.0
|
|
5
5
|
agent: validator
|
|
6
6
|
lifecycle-phase: Phase 3a (Evidence Verification)
|
|
7
7
|
required-skills:
|
|
8
8
|
- torusguard-verify
|
|
9
9
|
scripts-binding:
|
|
10
|
-
-
|
|
11
|
-
-
|
|
10
|
+
- internal/validate/validate.go
|
|
11
|
+
- cmd/torusguard/main.go
|
|
12
|
+
- cmd/torusguard/mcp.go
|
|
12
13
|
---
|
|
13
14
|
|
|
14
15
|
# /torusguard verify โ Evidence Verification & Score Refinement
|
|
@@ -22,26 +23,22 @@ Evidence sufficiency verification, live disk line match audit, and finding score
|
|
|
22
23
|
|
|
23
24
|
---
|
|
24
25
|
|
|
25
|
-
##
|
|
26
|
+
## Tri-Mode Execution
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
5. **Role Boundary:** Enforce validator role; do not apply code modifications during verification.
|
|
28
|
+
| Mode | Command / Tool | Execution Method |
|
|
29
|
+
| :--- | :--- | :--- |
|
|
30
|
+
| **Mode A: Terminal CLI** | `torusguard verify` | Terminal audit of living security report and evidence presence. |
|
|
31
|
+
| **Mode B: AI Chat Slash** | `/torusguard verify` | Live code line inspection, taint flow audit, and false-positive filtering. |
|
|
32
|
+
| **Mode C: Native MCP Tool** | `torusguard_verify` | Agent tool call with `{"target": "."}` returning line audit proofs. |
|
|
33
33
|
|
|
34
34
|
---
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## Mandatory Pre-Flight Context Inspection
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
| No audit run executed yet | Run `/torusguard audit` first |
|
|
43
|
-
| Running live network requests against endpoints | Run `/torusguard web-validate` |
|
|
44
|
-
| Generating patch after verification | Run `/torusguard harden` |
|
|
38
|
+
Inspect finding records and evidence integrity before verification:
|
|
39
|
+
1. **Living Report (`security_report.md`):** Confirm report exists at workspace root.
|
|
40
|
+
2. **Live File Drift:** Assert cited source files have not been edited or relocated on disk.
|
|
41
|
+
3. **Role Boundary:** Enforce validator role; do not apply code modifications during verification.
|
|
45
42
|
|
|
46
43
|
---
|
|
47
44
|
|
|
@@ -49,34 +46,18 @@ Inspect finding records and evidence integrity before verification:
|
|
|
49
46
|
- Confirmed evidence sufficiency transitions findings in `security_report.md` to `VERIFIED ๐ `.
|
|
50
47
|
- False positives transition to `FALSE POSITIVE โช`.
|
|
51
48
|
|
|
49
|
+
---
|
|
50
|
+
|
|
52
51
|
## Execution Steps
|
|
53
52
|
|
|
54
|
-
1. **
|
|
53
|
+
1. **Trigger Verification:**
|
|
54
|
+
- **Mode A (CLI):** Run `torusguard verify`.
|
|
55
|
+
- **Mode B (Chat):** Read cited lines via `view_file` and verify source-to-sink flow.
|
|
56
|
+
- **Mode C (MCP):** Call `torusguard_verify`.
|
|
55
57
|
2. **Live Disk Line Match:** Read current code at cited line ranges; verify AST snippet matches.
|
|
56
58
|
3. **Audit Evidence Sufficiency:** Assess whether taint path is unbroken and caller context is exposed.
|
|
57
|
-
4. **
|
|
58
|
-
|
|
59
|
-
python .torusguard/scripts/finding_scorer.py --run <run_dir> --verify
|
|
60
|
-
```
|
|
61
|
-
5. **Classify Status:** Assign verified state (`Confirmed`, `Plausible`, or `False Positive / Disputed`).
|
|
62
|
-
6. **Emit Verification Ledger:** Write `verified-evidence.md` into the active run folder.
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## Failure Recovery
|
|
67
|
-
|
|
68
|
-
- **Missing Run Folder:** Run `/torusguard audit` first to produce a valid run baseline.
|
|
69
|
-
- **Line Drift Detected:** Flag line mismatch; scan nearby lines (ยฑ25) for relocated AST sink.
|
|
70
|
-
- **Malformed Finding JSON:** Repair JSON structure using finding schema before scoring.
|
|
71
|
-
- **Halt Trigger:** Abort if cited files are completely deleted from disk.
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## Hallucination Guard
|
|
76
|
-
|
|
77
|
-
- โ Never confirm a finding if the cited sink has already been sanitized by middleware.
|
|
78
|
-
- โ Never bump confidence score without documenting unbroken taint source-to-sink flow.
|
|
79
|
-
- โ
Always anchor line matches to live disk reads using `view_file`.
|
|
59
|
+
4. **Classify Status:** Assign verified state (`Confirmed`, `Plausible`, or `False Positive`).
|
|
60
|
+
5. **Update Living Ledger:** Update statuses in `security_report.md`.
|
|
80
61
|
|
|
81
62
|
---
|
|
82
63
|
|
|
@@ -84,17 +65,16 @@ Inspect finding records and evidence integrity before verification:
|
|
|
84
65
|
|
|
85
66
|
```markdown
|
|
86
67
|
### ๐งช TorusGuard Evidence Verification
|
|
87
|
-
- **
|
|
68
|
+
- **Report File:** `security_report.md`
|
|
88
69
|
- **Findings Evaluated:** [Count] findings
|
|
89
70
|
- **Confirmed Real:** [Count] verified flaws
|
|
90
|
-
- **
|
|
91
|
-
- **
|
|
92
|
-
- **Ledger:** `.torusguard/runs/<run_id>/verified-evidence.md`
|
|
71
|
+
- **False Positives Filtered:** [Count]
|
|
72
|
+
- **Status:** Evidence verified on disk
|
|
93
73
|
```
|
|
94
74
|
|
|
95
75
|
---
|
|
96
76
|
|
|
97
77
|
## Next Steps
|
|
98
78
|
|
|
99
|
-
1. Run `/torusguard
|
|
100
|
-
2. Run `/torusguard
|
|
79
|
+
1. Run `/torusguard harden` to build surgical patch bundles for verified flaws.
|
|
80
|
+
2. Run `/torusguard web-validate` if live endpoint probing is required.
|