torusguard 2.1.0 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.torusguard/.manifest.json +47 -5
- package/.torusguard/core/__init__.py +146 -0
- package/.torusguard/core/agent_roles.py +104 -0
- package/.torusguard/core/ast_walker.py +283 -0
- package/.torusguard/core/authorization.py +218 -0
- package/.torusguard/core/browser_verifier.py +128 -0
- package/.torusguard/core/bundle.py +141 -0
- package/.torusguard/core/call_graph.py +184 -0
- package/.torusguard/core/clustering.py +275 -0
- package/.torusguard/core/confidence.py +120 -0
- package/.torusguard/core/cross_file_taint.py +101 -0
- package/.torusguard/core/exploit_checker.py +317 -0
- package/.torusguard/core/formatter.py +351 -0
- package/.torusguard/core/governance.py +210 -0
- package/.torusguard/core/identity.py +104 -0
- package/.torusguard/core/import_resolver.py +91 -0
- package/.torusguard/core/incremental.py +102 -0
- package/.torusguard/core/lifecycle.py +137 -0
- package/.torusguard/core/models.py +425 -0
- package/.torusguard/core/parallel.py +56 -0
- package/.torusguard/core/parser.py +202 -0
- package/.torusguard/core/rechecker.py +107 -0
- package/.torusguard/core/replay_trace.py +178 -0
- package/.torusguard/core/rules_registry.py +131 -0
- package/.torusguard/core/run_folder.py +60 -0
- package/.torusguard/core/run_manager.py +163 -0
- package/.torusguard/core/runtime_evidence.py +175 -0
- package/.torusguard/core/runtime_validator.py +246 -0
- package/.torusguard/core/safety_gate.py +139 -0
- package/.torusguard/core/sarif.py +189 -0
- package/.torusguard/core/stack_profiler.py +184 -0
- package/.torusguard/core/symbol_table.py +91 -0
- package/.torusguard/core/taint.py +133 -0
- package/.torusguard/core/taint_graph.py +235 -0
- package/.torusguard/core/taint_rules.py +268 -0
- package/.torusguard/core/v070_reporter.py +102 -0
- package/.torusguard/core/v070_workflow.py +339 -0
- package/.torusguard/core/v6_reporter.py +180 -0
- package/.torusguard/core/v6_workflow.py +221 -0
- package/.torusguard/core/watcher.py +58 -0
- package/.torusguard/rules/TG-INPUT-007-unvalidated-redirect.md +53 -0
- package/.torusguard/rules/TG-INPUT-008-insecure-deserialization.md +52 -0
- package/.torusguard/scripts/__pycache__/audit_runner.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/finding_scorer.cpython-314.pyc +0 -0
- package/.torusguard/scripts/__pycache__/rules_sync.cpython-314.pyc +0 -0
- package/.torusguard/scripts/audit_runner.py +108 -10
- package/.torusguard/scripts/finding_scorer.py +43 -13
- package/.torusguard/scripts/skill_profiler.py +26 -0
- package/.torusguard/skills/torusguard/SKILL.md +6 -2
- package/.torusguard/skills/torusguard-audit/SKILL.md +109 -84
- package/.torusguard/workflows/audit.md +21 -17
- package/README.md +19 -11
- package/package.json +7 -2
- package/skills/torusguard/SKILL.md +6 -2
- package/skills/torusguard/__pycache__/bootstrap.cpython-314.pyc +0 -0
- package/skills/torusguard/bootstrap.py +3 -3
- package/skills/torusguard/payload/.manifest.json +48 -7
- package/skills/torusguard/payload/core/__init__.py +146 -0
- package/skills/torusguard/payload/core/agent_roles.py +104 -0
- package/skills/torusguard/payload/core/ast_walker.py +283 -0
- package/skills/torusguard/payload/core/authorization.py +218 -0
- package/skills/torusguard/payload/core/browser_verifier.py +128 -0
- package/skills/torusguard/payload/core/bundle.py +141 -0
- package/skills/torusguard/payload/core/call_graph.py +184 -0
- package/skills/torusguard/payload/core/clustering.py +275 -0
- package/skills/torusguard/payload/core/confidence.py +120 -0
- package/skills/torusguard/payload/core/cross_file_taint.py +101 -0
- package/skills/torusguard/payload/core/exploit_checker.py +317 -0
- package/skills/torusguard/payload/core/formatter.py +351 -0
- package/skills/torusguard/payload/core/governance.py +210 -0
- package/skills/torusguard/payload/core/identity.py +104 -0
- package/skills/torusguard/payload/core/import_resolver.py +91 -0
- package/skills/torusguard/payload/core/incremental.py +102 -0
- package/skills/torusguard/payload/core/lifecycle.py +137 -0
- package/skills/torusguard/payload/core/models.py +425 -0
- package/skills/torusguard/payload/core/parallel.py +56 -0
- package/skills/torusguard/payload/core/parser.py +202 -0
- package/skills/torusguard/payload/core/rechecker.py +107 -0
- package/skills/torusguard/payload/core/replay_trace.py +178 -0
- package/skills/torusguard/payload/core/rules_registry.py +131 -0
- package/skills/torusguard/payload/core/run_folder.py +60 -0
- package/skills/torusguard/payload/core/run_manager.py +163 -0
- package/skills/torusguard/payload/core/runtime_evidence.py +175 -0
- package/skills/torusguard/payload/core/runtime_validator.py +246 -0
- package/skills/torusguard/payload/core/safety_gate.py +139 -0
- package/skills/torusguard/payload/core/sarif.py +189 -0
- package/skills/torusguard/payload/core/stack_profiler.py +184 -0
- package/skills/torusguard/payload/core/symbol_table.py +91 -0
- package/skills/torusguard/payload/core/taint.py +133 -0
- package/skills/torusguard/payload/core/taint_graph.py +235 -0
- package/skills/torusguard/payload/core/taint_rules.py +268 -0
- package/skills/torusguard/payload/core/v070_reporter.py +102 -0
- package/skills/torusguard/payload/core/v070_workflow.py +339 -0
- package/skills/torusguard/payload/core/v6_reporter.py +180 -0
- package/skills/torusguard/payload/core/v6_workflow.py +221 -0
- package/skills/torusguard/payload/core/watcher.py +58 -0
- package/skills/torusguard/payload/rules/TG-INPUT-007-unvalidated-redirect.md +53 -0
- package/skills/torusguard/payload/rules/TG-INPUT-008-insecure-deserialization.md +52 -0
- package/skills/torusguard/payload/rules/container/TG-CONT-001-root-user-execution.md +50 -50
- package/skills/torusguard/payload/rules/container/TG-CONT-002-docker-socket-mount.md +47 -47
- package/skills/torusguard/payload/rules/container/TG-CONT-003-privileged-container-mode.md +53 -53
- package/skills/torusguard/payload/rules/container/TG-CONT-004-build-arg-secret-exposure.md +43 -43
- package/skills/torusguard/payload/rules/git/TG-GIT-001-historical-secret-in-git-commit.md +44 -44
- package/skills/torusguard/payload/rules/git/TG-GIT-002-plaintext-credentials-in-git-config.md +41 -41
- package/skills/torusguard/payload/rules/git/TG-GIT-003-sensitive-tracked-file-gitignore-breach.md +40 -40
- package/skills/torusguard/payload/rules/rag/TG-RAG-001-untrusted-rag-context-injection.md +72 -72
- package/skills/torusguard/payload/rules/rag/TG-RAG-002-autonomous-llm-tool-unsandboxed-call.md +51 -51
- package/skills/torusguard/payload/rules/rag/TG-RAG-003-unpartitioned-vector-tenant-lookup.md +51 -51
- package/skills/torusguard/payload/rules/redos/TG-REDOS-001-catastrophic-exponential-backtracking.md +46 -46
- package/skills/torusguard/payload/rules/redos/TG-REDOS-002-unbounded-nested-quantifier.md +43 -43
- package/skills/torusguard/payload/scripts/audit_runner.py +108 -10
- package/skills/torusguard/payload/scripts/finding_scorer.py +43 -13
- package/skills/torusguard/payload/skills/torusguard/SKILL.md +6 -2
- package/skills/torusguard/payload/skills/torusguard/bootstrap.py +3 -3
- package/skills/torusguard/payload/skills/torusguard-ai-guard/SKILL.md +95 -95
- package/skills/torusguard/payload/skills/torusguard-audit/SKILL.md +109 -84
- package/skills/torusguard/payload/skills/torusguard-container/SKILL.md +94 -94
- package/skills/torusguard/payload/skills/torusguard-git-mine/SKILL.md +92 -92
- package/skills/torusguard/payload/skills/torusguard-ocr-scan/SKILL.md +94 -94
- package/skills/torusguard/payload/skills/torusguard-redos/SKILL.md +91 -91
- package/skills/torusguard/payload/workflows/ai-guard.md +31 -31
- package/skills/torusguard/payload/workflows/audit.md +21 -17
- package/skills/torusguard/payload/workflows/container.md +29 -29
- package/skills/torusguard/payload/workflows/git-mine.md +25 -25
- package/skills/torusguard/payload/workflows/ocr-scan.md +25 -25
- package/skills/torusguard/payload/workflows/redos.md +27 -27
- package/skills/torusguard/payload/workflows/torusguard-audit.md +35 -55
- package/skills/torusguard/references/csharp-security.md +41 -41
- package/skills/torusguard/references/go-security.md +41 -41
- package/skills/torusguard/references/java-security.md +40 -40
- package/skills/torusguard/references/polyglot-security-matrix.md +25 -25
- package/skills/torusguard/references/rust-security.md +40 -40
- package/skills/torusguard-audit/SKILL.md +107 -83
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: torusguard-container
|
|
3
|
-
description: Audits Dockerfiles, Containerfiles, and Docker Compose configurations for root users, exposed docker sockets, privileged mode, and embedded secrets via CLI, Chat, or MCP.
|
|
4
|
-
version: 2.0.0
|
|
5
|
-
workflow: .torusguard/workflows/container.md
|
|
6
|
-
tools: Read, Grep, Glob, Write, run_command
|
|
7
|
-
scripts-binding:
|
|
8
|
-
- internal/scanner/container.go
|
|
9
|
-
- cmd/torusguard/main.go
|
|
10
|
-
- cmd/torusguard/mcp.go
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# TorusGuard Container & Docker Security Audit
|
|
14
|
-
|
|
15
|
-
## Objective
|
|
16
|
-
Detect and remediate critical container runtime and build-time security vulnerabilities across `Dockerfile`, `Containerfile`, `docker-compose.yml`, and `compose.yaml` files. Enforces non-root execution, privilege containment, socket isolation, and BuildKit secret mounts.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Tri-Mode Execution
|
|
21
|
-
|
|
22
|
-
### Mode A: Automated CLI Execution
|
|
23
|
-
Run container audits against current directory or specific target project:
|
|
24
|
-
```bash
|
|
25
|
-
# Scan container files in current directory
|
|
26
|
-
torusguard container
|
|
27
|
-
|
|
28
|
-
# Scan container files in specific workspace target
|
|
29
|
-
torusguard container --target ./deployments/docker
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Mode B: In-Session AI Chat Slash Command
|
|
33
|
-
Run `/torusguard container` in chat.
|
|
34
|
-
The agent invokes the native Go scanner or MCP tool to inspect container definitions, audit user permissions, and report structural container misconfigurations.
|
|
35
|
-
|
|
36
|
-
### Mode C: Native MCP Tool Call
|
|
37
|
-
MCP-enabled coding agents (Antigravity, Cursor, Windsurf, Claude Code) call:
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"tool": "torusguard_container",
|
|
41
|
-
"arguments": {
|
|
42
|
-
"target": "."
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Supported Patterns & Invariants
|
|
50
|
-
- **TG-CONT-001 (Root Execution Default):** Detects omission of explicit `USER <non-root>` instruction or explicit `USER root` declarations in production container stages.
|
|
51
|
-
- **TG-CONT-002 (Docker Socket Exposure):** Detects dangerous mounting of the host daemon socket (`/var/run/docker.sock`), which grants unconfined root privileges over the host.
|
|
52
|
-
- **TG-CONT-003 (Privileged Container Flag):** Detects `privileged: true`, `seccomp:unconfined`, or `SYS_ADMIN` capability grants that defeat Linux namespace and cgroup boundaries.
|
|
53
|
-
- **TG-CONT-004 (Build-Time Secret Injection):** Flags embedding sensitive tokens, passwords, or keys via `ARG` or `ENV` directives in Dockerfiles rather than BuildKit secret mounts.
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## 🏛️ OpenCodeReview Hybrid Architecture Integration
|
|
58
|
-
- **Deterministic Dockerfile & Compose Parser:** Pattern extraction is executed by Go AST/regex parsers without external Docker daemon dependencies.
|
|
59
|
-
- **Token Efficiency:** Only flagged container directives and minimal surrounding context are returned to the agent context.
|
|
60
|
-
- **Ponytail Bounds:** Remediation patches must add dedicated non-root users (`USER appuser`) or switch secrets to `--mount=type=secret` without full container file rewrites (≤35 additions, ≤25 deletions).
|
|
61
|
-
|
|
62
|
-
---
|
|
63
|
-
|
|
64
|
-
## 🚨 LLM Trap Table
|
|
65
|
-
|
|
66
|
-
| Pattern | What AI Does Wrong | What Is Actually Correct |
|
|
67
|
-
| :--- | :--- | :--- |
|
|
68
|
-
| **Default Root Execution** | Forgets that Docker executes as UID 0 (`root`) unless a non-root `USER` is declared. | Always declare `RUN adduser -D appuser && USER appuser` before the entrypoint. |
|
|
69
|
-
| **Secrets in Build Arguments** | Recommends `ARG API_KEY` or `ENV DB_PASSWORD`, leaving keys baked into image layers. | Use Docker BuildKit secret mounts: `RUN --mount=type=secret,id=mysecret ...`. |
|
|
70
|
-
| **Permissive Privileged Mode** | Adds `privileged: true` or `cap_add: [ALL]` to resolve permission or port binding errors. | Grant only specific minimal Linux capabilities (e.g. `NET_BIND_SERVICE`) or fix file ownership. |
|
|
71
|
-
| **Docker Socket Mounting** | Mounts `/var/run/docker.sock` inside container to run Docker commands inside Docker. | Use Docker-in-Docker (dind) rootless or ephemeral CI runners with isolated daemons. |
|
|
72
|
-
| **Full File Rewrites** | Rewrites entire multi-stage Dockerfile destroying cached layer order. | Formulate surgical diffs replacing or inserting only the missing `USER` or mount flag. |
|
|
73
|
-
|
|
74
|
-
---
|
|
75
|
-
|
|
76
|
-
## ✅ Pre-Flight Self-Audit
|
|
77
|
-
|
|
78
|
-
Before concluding a container security review, verify:
|
|
79
|
-
- [ ] Did I scan all Dockerfiles (`Dockerfile`, `Dockerfile.*`, `Containerfile`)?
|
|
80
|
-
- [ ] Did I scan all compose files (`docker-compose.yml`, `compose.yaml`)?
|
|
81
|
-
- [ ] Is there an unprivileged non-root user defined before `ENTRYPOINT` or `CMD`?
|
|
82
|
-
- [ ] Are sensitive environment variables passed via runtime `.env` / secret managers instead of `ARG` / `ENV`?
|
|
83
|
-
- [ ] Is `/var/run/docker.sock` completely absent from compose volumes?
|
|
84
|
-
- [ ] Are all proposed fixes within Ponytail churn bounds (≤35 additions, ≤25 deletions)?
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## 🔁 VBC Protocol (Verify → Build → Confirm)
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
VERIFY: Identify Dockerfiles and Compose files in the workspace.
|
|
92
|
-
BUILD: Execute torusguard container or torusguard_container to locate container privilege and secret flaws.
|
|
93
|
-
CONFIRM: Formulate surgical remediation patch introducing non-root users and removing dangerous mounts, rechecking with torusguard recheck.
|
|
94
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: torusguard-container
|
|
3
|
+
description: Audits Dockerfiles, Containerfiles, and Docker Compose configurations for root users, exposed docker sockets, privileged mode, and embedded secrets via CLI, Chat, or MCP.
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
workflow: .torusguard/workflows/container.md
|
|
6
|
+
tools: Read, Grep, Glob, Write, run_command
|
|
7
|
+
scripts-binding:
|
|
8
|
+
- internal/scanner/container.go
|
|
9
|
+
- cmd/torusguard/main.go
|
|
10
|
+
- cmd/torusguard/mcp.go
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# TorusGuard Container & Docker Security Audit
|
|
14
|
+
|
|
15
|
+
## Objective
|
|
16
|
+
Detect and remediate critical container runtime and build-time security vulnerabilities across `Dockerfile`, `Containerfile`, `docker-compose.yml`, and `compose.yaml` files. Enforces non-root execution, privilege containment, socket isolation, and BuildKit secret mounts.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Tri-Mode Execution
|
|
21
|
+
|
|
22
|
+
### Mode A: Automated CLI Execution
|
|
23
|
+
Run container audits against current directory or specific target project:
|
|
24
|
+
```bash
|
|
25
|
+
# Scan container files in current directory
|
|
26
|
+
torusguard container
|
|
27
|
+
|
|
28
|
+
# Scan container files in specific workspace target
|
|
29
|
+
torusguard container --target ./deployments/docker
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Mode B: In-Session AI Chat Slash Command
|
|
33
|
+
Run `/torusguard container` in chat.
|
|
34
|
+
The agent invokes the native Go scanner or MCP tool to inspect container definitions, audit user permissions, and report structural container misconfigurations.
|
|
35
|
+
|
|
36
|
+
### Mode C: Native MCP Tool Call
|
|
37
|
+
MCP-enabled coding agents (Antigravity, Cursor, Windsurf, Claude Code) call:
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"tool": "torusguard_container",
|
|
41
|
+
"arguments": {
|
|
42
|
+
"target": "."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Supported Patterns & Invariants
|
|
50
|
+
- **TG-CONT-001 (Root Execution Default):** Detects omission of explicit `USER <non-root>` instruction or explicit `USER root` declarations in production container stages.
|
|
51
|
+
- **TG-CONT-002 (Docker Socket Exposure):** Detects dangerous mounting of the host daemon socket (`/var/run/docker.sock`), which grants unconfined root privileges over the host.
|
|
52
|
+
- **TG-CONT-003 (Privileged Container Flag):** Detects `privileged: true`, `seccomp:unconfined`, or `SYS_ADMIN` capability grants that defeat Linux namespace and cgroup boundaries.
|
|
53
|
+
- **TG-CONT-004 (Build-Time Secret Injection):** Flags embedding sensitive tokens, passwords, or keys via `ARG` or `ENV` directives in Dockerfiles rather than BuildKit secret mounts.
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## 🏛️ OpenCodeReview Hybrid Architecture Integration
|
|
58
|
+
- **Deterministic Dockerfile & Compose Parser:** Pattern extraction is executed by Go AST/regex parsers without external Docker daemon dependencies.
|
|
59
|
+
- **Token Efficiency:** Only flagged container directives and minimal surrounding context are returned to the agent context.
|
|
60
|
+
- **Ponytail Bounds:** Remediation patches must add dedicated non-root users (`USER appuser`) or switch secrets to `--mount=type=secret` without full container file rewrites (≤35 additions, ≤25 deletions).
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 🚨 LLM Trap Table
|
|
65
|
+
|
|
66
|
+
| Pattern | What AI Does Wrong | What Is Actually Correct |
|
|
67
|
+
| :--- | :--- | :--- |
|
|
68
|
+
| **Default Root Execution** | Forgets that Docker executes as UID 0 (`root`) unless a non-root `USER` is declared. | Always declare `RUN adduser -D appuser && USER appuser` before the entrypoint. |
|
|
69
|
+
| **Secrets in Build Arguments** | Recommends `ARG API_KEY` or `ENV DB_PASSWORD`, leaving keys baked into image layers. | Use Docker BuildKit secret mounts: `RUN --mount=type=secret,id=mysecret ...`. |
|
|
70
|
+
| **Permissive Privileged Mode** | Adds `privileged: true` or `cap_add: [ALL]` to resolve permission or port binding errors. | Grant only specific minimal Linux capabilities (e.g. `NET_BIND_SERVICE`) or fix file ownership. |
|
|
71
|
+
| **Docker Socket Mounting** | Mounts `/var/run/docker.sock` inside container to run Docker commands inside Docker. | Use Docker-in-Docker (dind) rootless or ephemeral CI runners with isolated daemons. |
|
|
72
|
+
| **Full File Rewrites** | Rewrites entire multi-stage Dockerfile destroying cached layer order. | Formulate surgical diffs replacing or inserting only the missing `USER` or mount flag. |
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## ✅ Pre-Flight Self-Audit
|
|
77
|
+
|
|
78
|
+
Before concluding a container security review, verify:
|
|
79
|
+
- [ ] Did I scan all Dockerfiles (`Dockerfile`, `Dockerfile.*`, `Containerfile`)?
|
|
80
|
+
- [ ] Did I scan all compose files (`docker-compose.yml`, `compose.yaml`)?
|
|
81
|
+
- [ ] Is there an unprivileged non-root user defined before `ENTRYPOINT` or `CMD`?
|
|
82
|
+
- [ ] Are sensitive environment variables passed via runtime `.env` / secret managers instead of `ARG` / `ENV`?
|
|
83
|
+
- [ ] Is `/var/run/docker.sock` completely absent from compose volumes?
|
|
84
|
+
- [ ] Are all proposed fixes within Ponytail churn bounds (≤35 additions, ≤25 deletions)?
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 🔁 VBC Protocol (Verify → Build → Confirm)
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
VERIFY: Identify Dockerfiles and Compose files in the workspace.
|
|
92
|
+
BUILD: Execute torusguard container or torusguard_container to locate container privilege and secret flaws.
|
|
93
|
+
CONFIRM: Formulate surgical remediation patch introducing non-root users and removing dangerous mounts, rechecking with torusguard recheck.
|
|
94
|
+
```
|
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: torusguard-git-mine
|
|
3
|
-
description: Mines git commit history, commit diffs, and local repository metadata for leaked credentials, private keys, and historical API tokens via CLI, Chat, or MCP.
|
|
4
|
-
version: 2.0.0
|
|
5
|
-
workflow: .torusguard/workflows/git-mine.md
|
|
6
|
-
tools: Read, Grep, Glob, Write, run_command
|
|
7
|
-
scripts-binding:
|
|
8
|
-
- internal/scanner/git_mine.go
|
|
9
|
-
- cmd/torusguard/main.go
|
|
10
|
-
- cmd/torusguard/mcp.go
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
# TorusGuard Git History Secret Mining
|
|
14
|
-
|
|
15
|
-
## Objective
|
|
16
|
-
Inspect local `.git` metadata, remote configurations, and commit logs across the repository's commit history to identify leaked API tokens, private keys, database URIs, and credentials that were committed in past revisions or embedded in remote URLs.
|
|
17
|
-
|
|
18
|
-
---
|
|
19
|
-
|
|
20
|
-
## Tri-Mode Execution
|
|
21
|
-
|
|
22
|
-
### Mode A: Automated CLI Execution
|
|
23
|
-
Run Git history mining against current repository or specified target workspace:
|
|
24
|
-
```bash
|
|
25
|
-
# Mine Git commit history and .git/config in current workspace
|
|
26
|
-
torusguard git-mine
|
|
27
|
-
|
|
28
|
-
# Mine specific repository target
|
|
29
|
-
torusguard git-mine --target /path/to/repo
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Mode B: In-Session AI Chat Slash Command
|
|
33
|
-
Run `/torusguard git-mine` in chat.
|
|
34
|
-
The agent executes the compiled Go Git mining engine or MCP tool to inspect commit history logs, detect historical secret leaks, and provide provider revocation guidance.
|
|
35
|
-
|
|
36
|
-
### Mode C: Native MCP Tool Call
|
|
37
|
-
MCP-enabled coding agents (Antigravity, Cursor, Windsurf, Claude Code) call:
|
|
38
|
-
```json
|
|
39
|
-
{
|
|
40
|
-
"tool": "torusguard_git_mine",
|
|
41
|
-
"arguments": {
|
|
42
|
-
"target": "."
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Supported Patterns & Invariants
|
|
50
|
-
- **TG-GIT-001 (Historical Secret Commit):** Detects API keys (OpenAI `sk-...`, AWS `AKIA...`, GitHub `ghp_...`), private certificates, or database credentials introduced in prior git commits even if removed from the current working tree.
|
|
51
|
-
- **TG-GIT-002 (Plaintext Remote Credentials):** Flags remote URLs in `.git/config` containing basic authentication credentials (`https://user:token@github.com/...`).
|
|
52
|
-
- **TG-GIT-003 (Sensitive File History Tracking):** Detects tracked `.env`, `id_rsa`, `.pem`, or `.key` files in git log metadata that bypass `.gitignore`.
|
|
53
|
-
|
|
54
|
-
---
|
|
55
|
-
|
|
56
|
-
## 🏛️ OpenCodeReview Hybrid Architecture Integration
|
|
57
|
-
- **Deterministic History Inspection:** Analyzes commit logs via local Git commands or fallback file reading with strict 5-second timeouts and bounded commit depths.
|
|
58
|
-
- **Token Minimization:** Emits commit SHA, author timestamp, and redacted secret preview rather than dumping full commit logs into LLM context.
|
|
59
|
-
- **Revocation-First Governance:** Prioritizes immediate credential revocation at the provider (OpenAI, AWS, GitHub) before history rewrites (`git filter-repo` / BFG).
|
|
60
|
-
|
|
61
|
-
---
|
|
62
|
-
|
|
63
|
-
## 🚨 LLM Trap Table
|
|
64
|
-
|
|
65
|
-
| Pattern | What AI Does Wrong | What Is Actually Correct |
|
|
66
|
-
| :--- | :--- | :--- |
|
|
67
|
-
| **Working Tree Only Bias** | Only scans files currently on disk, assuming deleted secrets are safely removed. | Always mine Git commit history (`git log -p`) because Git never forgets past commits. |
|
|
68
|
-
| **Token in Remote Origin URL** | Recommends `git remote set-url origin https://ghp_xxx@github.com/...` which writes token to disk in plaintext. | Use SSH keys, GitHub CLI (`gh auth login`), or credential helpers (`git credential-manager`). |
|
|
69
|
-
| **History Rewriting Over Revocation** | Recommends scrubbing Git history before revoking the leaked secret at the cloud provider. | Always rotate and revoke the credential immediately at the provider first; assume it was scraped. |
|
|
70
|
-
| **Single Commit Amends** | Recommends `git commit --amend` when the secret was committed 5 commits ago. | Use `git rebase -i` or `git-filter-repo` for deeper historical scrubbing. |
|
|
71
|
-
| **Tracking .env in Git** | Adds `.env` to `.gitignore` without running `git rm --cached .env`, leaving file tracked. | Run `git rm --cached <file>` so Git stops tracking the sensitive file in subsequent commits. |
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## ✅ Pre-Flight Self-Audit
|
|
76
|
-
|
|
77
|
-
Before concluding a Git repository security audit, verify:
|
|
78
|
-
- [ ] Is `.git` directory present and valid?
|
|
79
|
-
- [ ] Were remote URLs in `.git/config` checked for embedded plaintext passwords or tokens?
|
|
80
|
-
- [ ] Were the most recent 50 commits audited for added secrets in commit diffs?
|
|
81
|
-
- [ ] Did I verify whether `.env` or private keys were ever tracked in git history?
|
|
82
|
-
- [ ] Was the user instructed to rotate/revoke leaked keys at the provider immediately?
|
|
83
|
-
|
|
84
|
-
---
|
|
85
|
-
|
|
86
|
-
## 🔁 VBC Protocol (Verify → Build → Confirm)
|
|
87
|
-
|
|
88
|
-
```
|
|
89
|
-
VERIFY: Confirm workspace is a valid Git repository with accessible commit history.
|
|
90
|
-
BUILD: Execute torusguard git-mine or torusguard_git_mine to detect historical leaks and credential configs.
|
|
91
|
-
CONFIRM: Provide immediate rotation steps, clean .git/config, and scrub historical commits via git-filter-repo.
|
|
92
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: torusguard-git-mine
|
|
3
|
+
description: Mines git commit history, commit diffs, and local repository metadata for leaked credentials, private keys, and historical API tokens via CLI, Chat, or MCP.
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
workflow: .torusguard/workflows/git-mine.md
|
|
6
|
+
tools: Read, Grep, Glob, Write, run_command
|
|
7
|
+
scripts-binding:
|
|
8
|
+
- internal/scanner/git_mine.go
|
|
9
|
+
- cmd/torusguard/main.go
|
|
10
|
+
- cmd/torusguard/mcp.go
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# TorusGuard Git History Secret Mining
|
|
14
|
+
|
|
15
|
+
## Objective
|
|
16
|
+
Inspect local `.git` metadata, remote configurations, and commit logs across the repository's commit history to identify leaked API tokens, private keys, database URIs, and credentials that were committed in past revisions or embedded in remote URLs.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Tri-Mode Execution
|
|
21
|
+
|
|
22
|
+
### Mode A: Automated CLI Execution
|
|
23
|
+
Run Git history mining against current repository or specified target workspace:
|
|
24
|
+
```bash
|
|
25
|
+
# Mine Git commit history and .git/config in current workspace
|
|
26
|
+
torusguard git-mine
|
|
27
|
+
|
|
28
|
+
# Mine specific repository target
|
|
29
|
+
torusguard git-mine --target /path/to/repo
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Mode B: In-Session AI Chat Slash Command
|
|
33
|
+
Run `/torusguard git-mine` in chat.
|
|
34
|
+
The agent executes the compiled Go Git mining engine or MCP tool to inspect commit history logs, detect historical secret leaks, and provide provider revocation guidance.
|
|
35
|
+
|
|
36
|
+
### Mode C: Native MCP Tool Call
|
|
37
|
+
MCP-enabled coding agents (Antigravity, Cursor, Windsurf, Claude Code) call:
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"tool": "torusguard_git_mine",
|
|
41
|
+
"arguments": {
|
|
42
|
+
"target": "."
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Supported Patterns & Invariants
|
|
50
|
+
- **TG-GIT-001 (Historical Secret Commit):** Detects API keys (OpenAI `sk-...`, AWS `AKIA...`, GitHub `ghp_...`), private certificates, or database credentials introduced in prior git commits even if removed from the current working tree.
|
|
51
|
+
- **TG-GIT-002 (Plaintext Remote Credentials):** Flags remote URLs in `.git/config` containing basic authentication credentials (`https://user:token@github.com/...`).
|
|
52
|
+
- **TG-GIT-003 (Sensitive File History Tracking):** Detects tracked `.env`, `id_rsa`, `.pem`, or `.key` files in git log metadata that bypass `.gitignore`.
|
|
53
|
+
|
|
54
|
+
---
|
|
55
|
+
|
|
56
|
+
## 🏛️ OpenCodeReview Hybrid Architecture Integration
|
|
57
|
+
- **Deterministic History Inspection:** Analyzes commit logs via local Git commands or fallback file reading with strict 5-second timeouts and bounded commit depths.
|
|
58
|
+
- **Token Minimization:** Emits commit SHA, author timestamp, and redacted secret preview rather than dumping full commit logs into LLM context.
|
|
59
|
+
- **Revocation-First Governance:** Prioritizes immediate credential revocation at the provider (OpenAI, AWS, GitHub) before history rewrites (`git filter-repo` / BFG).
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## 🚨 LLM Trap Table
|
|
64
|
+
|
|
65
|
+
| Pattern | What AI Does Wrong | What Is Actually Correct |
|
|
66
|
+
| :--- | :--- | :--- |
|
|
67
|
+
| **Working Tree Only Bias** | Only scans files currently on disk, assuming deleted secrets are safely removed. | Always mine Git commit history (`git log -p`) because Git never forgets past commits. |
|
|
68
|
+
| **Token in Remote Origin URL** | Recommends `git remote set-url origin https://ghp_xxx@github.com/...` which writes token to disk in plaintext. | Use SSH keys, GitHub CLI (`gh auth login`), or credential helpers (`git credential-manager`). |
|
|
69
|
+
| **History Rewriting Over Revocation** | Recommends scrubbing Git history before revoking the leaked secret at the cloud provider. | Always rotate and revoke the credential immediately at the provider first; assume it was scraped. |
|
|
70
|
+
| **Single Commit Amends** | Recommends `git commit --amend` when the secret was committed 5 commits ago. | Use `git rebase -i` or `git-filter-repo` for deeper historical scrubbing. |
|
|
71
|
+
| **Tracking .env in Git** | Adds `.env` to `.gitignore` without running `git rm --cached .env`, leaving file tracked. | Run `git rm --cached <file>` so Git stops tracking the sensitive file in subsequent commits. |
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## ✅ Pre-Flight Self-Audit
|
|
76
|
+
|
|
77
|
+
Before concluding a Git repository security audit, verify:
|
|
78
|
+
- [ ] Is `.git` directory present and valid?
|
|
79
|
+
- [ ] Were remote URLs in `.git/config` checked for embedded plaintext passwords or tokens?
|
|
80
|
+
- [ ] Were the most recent 50 commits audited for added secrets in commit diffs?
|
|
81
|
+
- [ ] Did I verify whether `.env` or private keys were ever tracked in git history?
|
|
82
|
+
- [ ] Was the user instructed to rotate/revoke leaked keys at the provider immediately?
|
|
83
|
+
|
|
84
|
+
---
|
|
85
|
+
|
|
86
|
+
## 🔁 VBC Protocol (Verify → Build → Confirm)
|
|
87
|
+
|
|
88
|
+
```
|
|
89
|
+
VERIFY: Confirm workspace is a valid Git repository with accessible commit history.
|
|
90
|
+
BUILD: Execute torusguard git-mine or torusguard_git_mine to detect historical leaks and credential configs.
|
|
91
|
+
CONFIRM: Provide immediate rotation steps, clean .git/config, and scrub historical commits via git-filter-repo.
|
|
92
|
+
```
|
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: torusguard-ocr-scan
|
|
3
|
-
description: Scans images, architecture diagrams, and screenshots via Tesseract OCR for leaked API keys, tokens, and credentials via CLI or AI Agent.
|
|
4
|
-
version: 2.0.0
|
|
5
|
-
workflow: .torusguard/workflows/ocr-scan.md
|
|
6
|
-
tools: Read, Grep, Glob, Write, run_command
|
|
7
|
-
scripts-binding:
|
|
8
|
-
- internal/scanner/ocr.go
|
|
9
|
-
- cmd/torusguard/main.go
|
|
10
|
-
---
|
|
11
|
-
|
|
12
|
-
# TorusGuard OCR Vision Scan — Multi-Modal Secret Extraction
|
|
13
|
-
|
|
14
|
-
## Objective
|
|
15
|
-
Detect optical leaks of private API keys, AWS credentials, database URIs, GitHub personal access tokens, and private certificates embedded inside visual artifacts (PNG, JPG, WebP, BMP, TIFF) up to 10MB using Tesseract OCR and deterministic regex signatures.
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
## Tri-Mode Execution
|
|
20
|
-
|
|
21
|
-
### Mode A: Automated CLI Execution
|
|
22
|
-
Run OCR scanning against a single diagram file or an entire directory of visual assets:
|
|
23
|
-
```bash
|
|
24
|
-
# Scan a specific architecture diagram or screenshot
|
|
25
|
-
torusguard ocr-scan docs/architecture/diagram.png
|
|
26
|
-
|
|
27
|
-
# Scan an entire directory of media assets
|
|
28
|
-
torusguard ocr-scan ./assets/images/
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
### Mode B: In-Session AI Chat Slash Command
|
|
32
|
-
Run `/torusguard ocr-scan <path>` in chat.
|
|
33
|
-
The agent invokes the native Go scanner or MCP tool to extract optical text, analyze credential patterns, and report leaked keys.
|
|
34
|
-
|
|
35
|
-
### Mode C: Native MCP Tool Call
|
|
36
|
-
MCP-enabled coding agents (Antigravity, Cursor, Windsurf, Claude Code) call:
|
|
37
|
-
```json
|
|
38
|
-
{
|
|
39
|
-
"tool": "torusguard_ocr_scan",
|
|
40
|
-
"arguments": {
|
|
41
|
-
"target": "docs/architecture/cloud-architecture.png",
|
|
42
|
-
"max_image_mb": 10
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
## Supported Patterns & Invariants
|
|
50
|
-
- **TG-SEC-001:** Hardcoded API Keys / Tokens / OpenAI & Stripe Keys (`sk-live-...`, `sk-...`).
|
|
51
|
-
- **TG-SEC-002:** AWS Access Key IDs (`AKIA[0-9A-Z]{16}`).
|
|
52
|
-
- **TG-SEC-003:** GitHub Personal Access Tokens (`ghp_...`, `github_pat_...`).
|
|
53
|
-
- **TG-SEC-004:** Database Connection URIs (`postgres://user:pass@host:5432/db`).
|
|
54
|
-
- **TG-SEC-005:** Private Key Headers (`-----BEGIN RSA PRIVATE KEY-----`).
|
|
55
|
-
- **TG-SEC-007:** Password assignments (`password = "..."`).
|
|
56
|
-
- **10MB DoS Guard:** Files exceeding 10MB are rejected fail-closed to prevent resource exhaustion attacks.
|
|
57
|
-
|
|
58
|
-
---
|
|
59
|
-
|
|
60
|
-
## 🏛️ OpenCodeReview Hybrid Architecture Integration
|
|
61
|
-
- **Deterministic OCR Preprocessing:** Optical extraction and regex pattern matching run entirely in compiled Go code without LLM hallucination.
|
|
62
|
-
- **Token Efficiency:** Only the extracted text and detected secret matches are emitted to the agent context (zero token waste on binary image blobs).
|
|
63
|
-
|
|
64
|
-
---
|
|
65
|
-
|
|
66
|
-
## 🚨 LLM Trap Table
|
|
67
|
-
|
|
68
|
-
| Pattern | What AI Does Wrong | What Is Actually Correct |
|
|
69
|
-
| :--- | :--- | :--- |
|
|
70
|
-
| **Reading Binary Images as Text** | Attempts to read raw `.png` or `.jpg` with `view_file` as utf-8 text. | Invoke `torusguard ocr-scan` or `torusguard_ocr_scan` to perform OCR. |
|
|
71
|
-
| **Ignoring Image File Size Bounds** | Tries to OCR multi-hundred megabyte video files or giant raw images. | Adhere to the 10MB DoS boundary (`DefaultMaxImageSize`). |
|
|
72
|
-
| **Echoing Full Leaked Secrets in Logs** | Prints live production credentials unredacted in terminal output or reports. | Partially redact sensitive tokens (e.g. `sk-live-****3211`). |
|
|
73
|
-
| **Assuming Images Don't Contain Secrets** | Audits only `.go` or `.js` code and ignores cloud diagrams or screenshots. | Always run OCR vision scan across image directories during full audits. |
|
|
74
|
-
|
|
75
|
-
---
|
|
76
|
-
|
|
77
|
-
## ✅ Pre-Flight Self-Audit
|
|
78
|
-
|
|
79
|
-
Before concluding an OCR inspection, verify:
|
|
80
|
-
- [ ] Is Tesseract installed and discoverable on PATH?
|
|
81
|
-
- [ ] Are all target files valid image formats (`.png`, `.jpg`, `.jpeg`, `.webp`, `.bmp`, `.tiff`)?
|
|
82
|
-
- [ ] Are target image file sizes strictly $\le 10$ MB?
|
|
83
|
-
- [ ] Did I check against all 7 canonical secret signatures (`TG-SEC-001` through `TG-SEC-007`)?
|
|
84
|
-
- [ ] Are confirmed leaks documented in `security_report.md` with remediation steps?
|
|
85
|
-
|
|
86
|
-
---
|
|
87
|
-
|
|
88
|
-
## 🔁 VBC Protocol (Verify → Build → Confirm)
|
|
89
|
-
|
|
90
|
-
```
|
|
91
|
-
VERIFY: Confirm target image existence and size <= 10MB.
|
|
92
|
-
BUILD: Execute torusguard ocr-scan or torusguard_ocr_scan to extract optical text.
|
|
93
|
-
CONFIRM: Match text against OCRSecretPattern signatures, redact sensitive tokens, and record in security_report.md.
|
|
94
|
-
```
|
|
1
|
+
---
|
|
2
|
+
name: torusguard-ocr-scan
|
|
3
|
+
description: Scans images, architecture diagrams, and screenshots via Tesseract OCR for leaked API keys, tokens, and credentials via CLI or AI Agent.
|
|
4
|
+
version: 2.0.0
|
|
5
|
+
workflow: .torusguard/workflows/ocr-scan.md
|
|
6
|
+
tools: Read, Grep, Glob, Write, run_command
|
|
7
|
+
scripts-binding:
|
|
8
|
+
- internal/scanner/ocr.go
|
|
9
|
+
- cmd/torusguard/main.go
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# TorusGuard OCR Vision Scan — Multi-Modal Secret Extraction
|
|
13
|
+
|
|
14
|
+
## Objective
|
|
15
|
+
Detect optical leaks of private API keys, AWS credentials, database URIs, GitHub personal access tokens, and private certificates embedded inside visual artifacts (PNG, JPG, WebP, BMP, TIFF) up to 10MB using Tesseract OCR and deterministic regex signatures.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
## Tri-Mode Execution
|
|
20
|
+
|
|
21
|
+
### Mode A: Automated CLI Execution
|
|
22
|
+
Run OCR scanning against a single diagram file or an entire directory of visual assets:
|
|
23
|
+
```bash
|
|
24
|
+
# Scan a specific architecture diagram or screenshot
|
|
25
|
+
torusguard ocr-scan docs/architecture/diagram.png
|
|
26
|
+
|
|
27
|
+
# Scan an entire directory of media assets
|
|
28
|
+
torusguard ocr-scan ./assets/images/
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### Mode B: In-Session AI Chat Slash Command
|
|
32
|
+
Run `/torusguard ocr-scan <path>` in chat.
|
|
33
|
+
The agent invokes the native Go scanner or MCP tool to extract optical text, analyze credential patterns, and report leaked keys.
|
|
34
|
+
|
|
35
|
+
### Mode C: Native MCP Tool Call
|
|
36
|
+
MCP-enabled coding agents (Antigravity, Cursor, Windsurf, Claude Code) call:
|
|
37
|
+
```json
|
|
38
|
+
{
|
|
39
|
+
"tool": "torusguard_ocr_scan",
|
|
40
|
+
"arguments": {
|
|
41
|
+
"target": "docs/architecture/cloud-architecture.png",
|
|
42
|
+
"max_image_mb": 10
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## Supported Patterns & Invariants
|
|
50
|
+
- **TG-SEC-001:** Hardcoded API Keys / Tokens / OpenAI & Stripe Keys (`sk-live-...`, `sk-...`).
|
|
51
|
+
- **TG-SEC-002:** AWS Access Key IDs (`AKIA[0-9A-Z]{16}`).
|
|
52
|
+
- **TG-SEC-003:** GitHub Personal Access Tokens (`ghp_...`, `github_pat_...`).
|
|
53
|
+
- **TG-SEC-004:** Database Connection URIs (`postgres://user:pass@host:5432/db`).
|
|
54
|
+
- **TG-SEC-005:** Private Key Headers (`-----BEGIN RSA PRIVATE KEY-----`).
|
|
55
|
+
- **TG-SEC-007:** Password assignments (`password = "..."`).
|
|
56
|
+
- **10MB DoS Guard:** Files exceeding 10MB are rejected fail-closed to prevent resource exhaustion attacks.
|
|
57
|
+
|
|
58
|
+
---
|
|
59
|
+
|
|
60
|
+
## 🏛️ OpenCodeReview Hybrid Architecture Integration
|
|
61
|
+
- **Deterministic OCR Preprocessing:** Optical extraction and regex pattern matching run entirely in compiled Go code without LLM hallucination.
|
|
62
|
+
- **Token Efficiency:** Only the extracted text and detected secret matches are emitted to the agent context (zero token waste on binary image blobs).
|
|
63
|
+
|
|
64
|
+
---
|
|
65
|
+
|
|
66
|
+
## 🚨 LLM Trap Table
|
|
67
|
+
|
|
68
|
+
| Pattern | What AI Does Wrong | What Is Actually Correct |
|
|
69
|
+
| :--- | :--- | :--- |
|
|
70
|
+
| **Reading Binary Images as Text** | Attempts to read raw `.png` or `.jpg` with `view_file` as utf-8 text. | Invoke `torusguard ocr-scan` or `torusguard_ocr_scan` to perform OCR. |
|
|
71
|
+
| **Ignoring Image File Size Bounds** | Tries to OCR multi-hundred megabyte video files or giant raw images. | Adhere to the 10MB DoS boundary (`DefaultMaxImageSize`). |
|
|
72
|
+
| **Echoing Full Leaked Secrets in Logs** | Prints live production credentials unredacted in terminal output or reports. | Partially redact sensitive tokens (e.g. `sk-live-****3211`). |
|
|
73
|
+
| **Assuming Images Don't Contain Secrets** | Audits only `.go` or `.js` code and ignores cloud diagrams or screenshots. | Always run OCR vision scan across image directories during full audits. |
|
|
74
|
+
|
|
75
|
+
---
|
|
76
|
+
|
|
77
|
+
## ✅ Pre-Flight Self-Audit
|
|
78
|
+
|
|
79
|
+
Before concluding an OCR inspection, verify:
|
|
80
|
+
- [ ] Is Tesseract installed and discoverable on PATH?
|
|
81
|
+
- [ ] Are all target files valid image formats (`.png`, `.jpg`, `.jpeg`, `.webp`, `.bmp`, `.tiff`)?
|
|
82
|
+
- [ ] Are target image file sizes strictly $\le 10$ MB?
|
|
83
|
+
- [ ] Did I check against all 7 canonical secret signatures (`TG-SEC-001` through `TG-SEC-007`)?
|
|
84
|
+
- [ ] Are confirmed leaks documented in `security_report.md` with remediation steps?
|
|
85
|
+
|
|
86
|
+
---
|
|
87
|
+
|
|
88
|
+
## 🔁 VBC Protocol (Verify → Build → Confirm)
|
|
89
|
+
|
|
90
|
+
```
|
|
91
|
+
VERIFY: Confirm target image existence and size <= 10MB.
|
|
92
|
+
BUILD: Execute torusguard ocr-scan or torusguard_ocr_scan to extract optical text.
|
|
93
|
+
CONFIRM: Match text against OCRSecretPattern signatures, redact sensitive tokens, and record in security_report.md.
|
|
94
|
+
```
|