guardvibe 0.6.2 → 0.6.4
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/README.md +93 -156
- package/build/data/rules/core.js +13 -13
- package/build/data/rules/core.js.map +1 -1
- package/build/data/rules/index.d.ts.map +1 -1
- package/build/data/rules/index.js +0 -6
- package/build/data/rules/index.js.map +1 -1
- package/build/index.js +5 -5
- package/build/index.js.map +1 -1
- package/build/tools/check-project.d.ts.map +1 -1
- package/build/tools/check-project.js +4 -3
- package/build/tools/check-project.js.map +1 -1
- package/build/tools/compliance-report.d.ts.map +1 -1
- package/build/tools/compliance-report.js +6 -7
- package/build/tools/compliance-report.js.map +1 -1
- package/build/tools/export-sarif.d.ts.map +1 -1
- package/build/tools/export-sarif.js +6 -7
- package/build/tools/export-sarif.js.map +1 -1
- package/build/tools/scan-directory.d.ts.map +1 -1
- package/build/tools/scan-directory.js +6 -8
- package/build/tools/scan-directory.js.map +1 -1
- package/build/tools/scan-secrets.d.ts.map +1 -1
- package/build/tools/scan-secrets.js +98 -72
- package/build/tools/scan-secrets.js.map +1 -1
- package/build/tools/scan-staged.d.ts.map +1 -1
- package/build/tools/scan-staged.js +5 -7
- package/build/tools/scan-staged.js.map +1 -1
- package/build/utils/config.d.ts.map +1 -1
- package/build/utils/config.js +12 -14
- package/build/utils/config.js.map +1 -1
- package/build/utils/manifest-parser.d.ts.map +1 -1
- package/build/utils/manifest-parser.js +89 -87
- package/build/utils/manifest-parser.js.map +1 -1
- package/build/utils/osv-client.js +1 -1
- package/build/utils/osv-client.js.map +1 -1
- package/package.json +2 -3
- package/build/data/rules/java.d.ts +0 -3
- package/build/data/rules/java.d.ts.map +0 -1
- package/build/data/rules/java.js +0 -70
- package/build/data/rules/java.js.map +0 -1
- package/build/data/rules/php.d.ts +0 -3
- package/build/data/rules/php.d.ts.map +0 -1
- package/build/data/rules/php.js +0 -59
- package/build/data/rules/php.js.map +0 -1
- package/build/data/rules/ruby.d.ts +0 -3
- package/build/data/rules/ruby.d.ts.map +0 -1
- package/build/data/rules/ruby.js +0 -59
- package/build/data/rules/ruby.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,61 +1,47 @@
|
|
|
1
|
-
# GuardVibe
|
|
2
|
-
|
|
3
|
-
**
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
##
|
|
8
|
-
|
|
9
|
-
- **
|
|
10
|
-
- **
|
|
11
|
-
- **
|
|
12
|
-
- **Secret
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
-
|
|
23
|
-
- **8 Languages + Dockerfile + YAML + Terraform** — JS, TS, Python, Go, Java, PHP, Ruby, and more
|
|
24
|
-
- **OWASP Top 10:2025** — All rules mapped to latest standards
|
|
25
|
-
- **Zero-Config Setup** — `npx guardvibe init claude`
|
|
1
|
+
# GuardVibe
|
|
2
|
+
|
|
3
|
+
**Local-first security MCP for vibe coding.** GuardVibe gives Cursor, Claude, Gemini, Codex, and other MCP-capable coding agents fast security guardrails while they generate code.
|
|
4
|
+
|
|
5
|
+
GuardVibe is intentionally hard-focused on the stacks AI agents reach for most often in vibe coding workflows: **TypeScript, JavaScript, Python, Go, Dockerfile, YAML, and Terraform**. It skips legacy language packs so the MCP stays smaller, faster, and more consistent.
|
|
6
|
+
|
|
7
|
+
## Why GuardVibe
|
|
8
|
+
|
|
9
|
+
- **Hard-focused on vibe coding stacks** instead of trying to scan every language badly
|
|
10
|
+
- **40+ security patterns** across application code, infra, CI, and containers
|
|
11
|
+
- **Dependency CVE checks** via Google's OSV database
|
|
12
|
+
- **Secret detection** with pattern matching, entropy checks, and `.gitignore` coverage
|
|
13
|
+
- **Filesystem-native scanning** for full projects, staged files, compliance, and SARIF export
|
|
14
|
+
- **Project-level config** with `.guardviberc`
|
|
15
|
+
- **Security docs for agent workflows** covering modern web and API topics
|
|
16
|
+
|
|
17
|
+
## Supported Surface
|
|
18
|
+
|
|
19
|
+
- Languages: `typescript`, `javascript`, `python`, `go`
|
|
20
|
+
- Infra and config: `dockerfile`, `yaml`, `terraform`
|
|
21
|
+
- Supporting files: `html`, `sql`, `shell`
|
|
22
|
+
- Dependency manifests: `package.json`, `package-lock.json`, `requirements.txt`, `go.mod`
|
|
26
23
|
|
|
27
24
|
## Quick Start
|
|
28
25
|
|
|
29
|
-
### Auto
|
|
26
|
+
### Auto setup
|
|
30
27
|
|
|
31
28
|
```bash
|
|
32
|
-
|
|
33
|
-
npx guardvibe init
|
|
34
|
-
npx guardvibe init
|
|
35
|
-
npx guardvibe init
|
|
36
|
-
npx guardvibe init all # All platforms
|
|
29
|
+
npx guardvibe init claude
|
|
30
|
+
npx guardvibe init gemini
|
|
31
|
+
npx guardvibe init cursor
|
|
32
|
+
npx guardvibe init all
|
|
37
33
|
```
|
|
38
34
|
|
|
39
|
-
### Manual
|
|
35
|
+
### Manual MCP setup
|
|
36
|
+
|
|
37
|
+
**Claude Code**
|
|
40
38
|
|
|
41
|
-
**Claude Code:**
|
|
42
39
|
```bash
|
|
43
40
|
claude mcp add guardvibe -- npx guardvibe
|
|
44
41
|
```
|
|
45
42
|
|
|
46
|
-
**Gemini CLI**
|
|
47
|
-
```json
|
|
48
|
-
{
|
|
49
|
-
"mcpServers": {
|
|
50
|
-
"guardvibe": {
|
|
51
|
-
"command": "npx",
|
|
52
|
-
"args": ["-y", "guardvibe"]
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
```
|
|
43
|
+
**Gemini CLI** or **Cursor / VS Code**
|
|
57
44
|
|
|
58
|
-
**Cursor / VS Code** — add to MCP settings:
|
|
59
45
|
```json
|
|
60
46
|
{
|
|
61
47
|
"mcpServers": {
|
|
@@ -70,193 +56,144 @@ claude mcp add guardvibe -- npx guardvibe
|
|
|
70
56
|
## Tools
|
|
71
57
|
|
|
72
58
|
### `check_code`
|
|
73
|
-
Analyze a single code snippet for security vulnerabilities.
|
|
74
59
|
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
Analyze a single snippet for security issues.
|
|
61
|
+
|
|
62
|
+
```text
|
|
63
|
+
Input: { code: string, language: "javascript"|"typescript"|"python"|"go"|"dockerfile"|"html"|"sql"|"shell"|"yaml"|"terraform", framework?: string }
|
|
77
64
|
Output: Security report with findings, severity, OWASP mapping, and fix suggestions
|
|
78
65
|
```
|
|
79
66
|
|
|
80
67
|
### `check_project`
|
|
81
|
-
Scan multiple files and generate a project-wide security report with a score (A-F).
|
|
82
68
|
|
|
83
|
-
|
|
69
|
+
Scan multiple in-memory files and return a project security score.
|
|
70
|
+
|
|
71
|
+
```text
|
|
84
72
|
Input: { files: [{ path: "src/app.ts", content: "..." }, ...] }
|
|
85
|
-
Output: Project
|
|
73
|
+
Output: Project report with score, summary, and per-file findings
|
|
86
74
|
```
|
|
87
75
|
|
|
88
76
|
### `get_security_docs`
|
|
89
|
-
Get security best practices for a topic or framework.
|
|
90
77
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
78
|
+
Return best practices for framework or vulnerability topics.
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
Input: { topic: "nextjs csrf" | "express authentication" | "sql injection" | ... }
|
|
82
|
+
Output: Markdown guide with examples
|
|
94
83
|
```
|
|
95
84
|
|
|
96
85
|
### `scan_staged`
|
|
97
|
-
Scan git-staged files before committing. No input needed.
|
|
98
86
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
Scan git-staged files before commit.
|
|
88
|
+
|
|
89
|
+
```text
|
|
90
|
+
Input: {}
|
|
91
|
+
Output: Pre-commit report with A-F security score
|
|
102
92
|
```
|
|
103
93
|
|
|
104
94
|
### `scan_directory`
|
|
105
|
-
Scan an entire project directory directly from the filesystem. No need to pass file contents.
|
|
106
95
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
96
|
+
Scan a project directory directly from disk.
|
|
97
|
+
|
|
98
|
+
```text
|
|
99
|
+
Input: { path: ".", recursive?: true, exclude?: ["fixtures"] }
|
|
100
|
+
Output: Directory security report with score, summary, and detailed findings
|
|
110
101
|
```
|
|
111
102
|
|
|
112
103
|
### `scan_dependencies`
|
|
113
|
-
Parse a lockfile/manifest and check all dependencies for CVEs in one batch query.
|
|
114
104
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
105
|
+
Parse a supported manifest and batch-check dependencies for known CVEs.
|
|
106
|
+
|
|
107
|
+
```text
|
|
108
|
+
Input: { manifest_path: "package-lock.json" }
|
|
109
|
+
Supported: package.json, package-lock.json, requirements.txt, go.mod
|
|
118
110
|
Output: Vulnerability report with normalized severity and fix versions
|
|
119
111
|
```
|
|
120
112
|
|
|
121
113
|
### `scan_secrets`
|
|
122
|
-
Detect leaked secrets, API keys, and tokens in code and config files.
|
|
123
114
|
|
|
124
|
-
|
|
115
|
+
Detect leaked secrets in source and config files.
|
|
116
|
+
|
|
117
|
+
```text
|
|
125
118
|
Input: { path: ".", recursive?: true }
|
|
126
|
-
Output: Secret scan report with provider identification, .gitignore coverage
|
|
119
|
+
Output: Secret scan report with provider identification, entropy detection, and .gitignore coverage checks
|
|
127
120
|
```
|
|
128
121
|
|
|
129
122
|
### `compliance_report`
|
|
130
|
-
Generate a compliance-focused report mapped to SOC2, PCI-DSS, or HIPAA controls.
|
|
131
123
|
|
|
132
|
-
|
|
133
|
-
|
|
124
|
+
Map findings to `SOC2`, `PCI-DSS`, `HIPAA`, or `all`.
|
|
125
|
+
|
|
126
|
+
```text
|
|
127
|
+
Input: { path: ".", framework: "SOC2" | "PCI-DSS" | "HIPAA" | "all" }
|
|
134
128
|
Output: Findings grouped by compliance control
|
|
135
129
|
```
|
|
136
130
|
|
|
137
131
|
### `export_sarif`
|
|
138
|
-
Export scan results in SARIF v2.1.0 format for CI/CD integration.
|
|
139
132
|
|
|
140
|
-
|
|
133
|
+
Export directory findings as SARIF v2.1.0.
|
|
134
|
+
|
|
135
|
+
```text
|
|
141
136
|
Input: { path: "." }
|
|
142
|
-
Output: SARIF JSON
|
|
137
|
+
Output: SARIF JSON for GitHub Code Scanning and compatible platforms
|
|
143
138
|
```
|
|
144
139
|
|
|
145
140
|
### `check_dependencies`
|
|
146
|
-
Check individual packages for known CVEs via Google OSV.
|
|
147
141
|
|
|
148
|
-
|
|
142
|
+
Check individual packages directly against OSV.
|
|
143
|
+
|
|
144
|
+
```text
|
|
149
145
|
Input: { packages: [{ name: "lodash", version: "4.17.20", ecosystem: "npm" }] }
|
|
150
|
-
Output: Vulnerability report with CVE IDs, severity, and fix
|
|
146
|
+
Output: Vulnerability report with CVE IDs, severity, and fix guidance
|
|
151
147
|
```
|
|
152
148
|
|
|
153
|
-
##
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
| FastAPI | Pydantic, CORS, rate limiting, SQLAlchemy, auth |
|
|
161
|
-
| React | XSS prevention, secure API calls, state management |
|
|
162
|
-
| SQL Injection | Parameterized queries, ORMs (Prisma, Drizzle, SQLAlchemy) |
|
|
163
|
-
| XSS | DOM sanitization, CSP, React escaping |
|
|
164
|
-
| Authentication | bcrypt, JWT, OAuth, session security |
|
|
165
|
-
| Environment Variables | .env management, Vercel, secret rotation |
|
|
166
|
-
| Django | CSRF, ORM, settings, ALLOWED_HOSTS, password hashing |
|
|
167
|
-
| NestJS | Guards, Helmet, ValidationPipe, rate limiting |
|
|
168
|
-
| Hono | Middleware auth, CORS, zod validation, secure headers |
|
|
169
|
-
| Supabase | Row Level Security, anon vs service key, auth |
|
|
170
|
-
| tRPC | Input validation, auth middleware, rate limiting |
|
|
171
|
-
|
|
172
|
-
## Security Rules (55+ patterns)
|
|
173
|
-
|
|
174
|
-
### Core Rules (All supported languages)
|
|
175
|
-
|
|
176
|
-
| ID | Rule | Severity | Languages |
|
|
177
|
-
|----|------|----------|-----------|
|
|
178
|
-
| VG001 | Hardcoded credentials | Critical | All |
|
|
179
|
-
| VG003 | Cloud provider API keys (AWS, GitHub, OpenAI, Stripe) | Critical | All |
|
|
180
|
-
| VG010 | SQL injection | Critical | All |
|
|
181
|
-
| VG011 | Command injection | Critical | All |
|
|
182
|
-
| VG014 | Dynamic code execution (eval) | Critical | JS/TS/Python/PHP/Ruby |
|
|
183
|
-
| VG060 | Weak password hashing (MD5/SHA-1) | Critical | All |
|
|
184
|
-
| VG040 | CORS wildcard | High | All |
|
|
185
|
-
| VG030 | Missing rate limiting | Medium | All |
|
|
186
|
-
|
|
187
|
-
### Language-Specific Rules
|
|
188
|
-
|
|
189
|
-
| ID Range | Language | Rules |
|
|
190
|
-
|----------|----------|-------|
|
|
191
|
-
| VG002, VG012-VG015 | JavaScript/TypeScript | Missing auth, XSS, NoSQL injection, JWT |
|
|
192
|
-
| VG005 | Python | Missing auth (FastAPI/Flask) |
|
|
193
|
-
| VG110-VG115 | Go | SQL injection (fmt.Sprintf), os/exec, template.HTML, handler auth, weak hash, CORS |
|
|
194
|
-
| VG120-VG125 | Java | SQL concat, Runtime.exec, JSP XSS, Spring auth, MessageDigest, @CrossOrigin |
|
|
195
|
-
| VG130-VG134 | PHP | $_GET/$_POST SQL injection, shell_exec, echo XSS, md5/sha1, eval |
|
|
196
|
-
| VG140-VG144 | Ruby | String interpolation SQL, backtick injection, html_safe XSS, route auth, Digest |
|
|
197
|
-
| VG200-VG204 | Dockerfile | Root container, COPY ordering, latest tag, secrets in ENV, ADD vs COPY |
|
|
198
|
-
| VG210-VG213 | GitHub Actions | Secrets in run steps, pull_request_target, unpinned actions, permissions |
|
|
199
|
-
| VG300-VG304 | Terraform | Public S3, open security groups, unencrypted RDS, IAM wildcards, hardcoded secrets |
|
|
149
|
+
## Coverage
|
|
150
|
+
|
|
151
|
+
- Web/API issues: auth gaps, SQL injection, command injection, XSS, CORS, SSRF, weak hashing
|
|
152
|
+
- Containers: root user, unpinned images, secret leakage, unsafe Dockerfile patterns
|
|
153
|
+
- CI/CD: GitHub Actions permissions, unpinned actions, risky event triggers
|
|
154
|
+
- Terraform: public buckets, open security groups, wildcard IAM, hardcoded secrets
|
|
155
|
+
- Secrets: AWS, GitHub, OpenAI, Stripe, private keys, `NEXT_PUBLIC_*` exposures
|
|
200
156
|
|
|
201
157
|
## Configuration
|
|
202
158
|
|
|
203
|
-
Create a `.guardviberc` file in your project root
|
|
159
|
+
Create a `.guardviberc` file in your project root:
|
|
204
160
|
|
|
205
161
|
```json
|
|
206
162
|
{
|
|
207
163
|
"rules": {
|
|
208
|
-
"disable": ["VG030"
|
|
209
|
-
"severity": {
|
|
164
|
+
"disable": ["VG030"],
|
|
165
|
+
"severity": {
|
|
166
|
+
"VG002": "medium"
|
|
167
|
+
}
|
|
210
168
|
},
|
|
211
169
|
"scan": {
|
|
212
|
-
"exclude": ["
|
|
170
|
+
"exclude": ["fixtures/", "coverage/"],
|
|
213
171
|
"maxFileSize": 1048576
|
|
214
172
|
}
|
|
215
173
|
}
|
|
216
174
|
```
|
|
217
175
|
|
|
218
|
-
##
|
|
176
|
+
## Suppression
|
|
219
177
|
|
|
220
|
-
|
|
178
|
+
GuardVibe supports inline suppression comments:
|
|
221
179
|
|
|
222
180
|
```javascript
|
|
223
|
-
// Suppress a specific rule on this line
|
|
224
181
|
const password = process.env.DB_PASSWORD; // guardvibe-ignore VG001
|
|
225
182
|
|
|
226
|
-
// Suppress a rule on the next line
|
|
227
183
|
// guardvibe-ignore-next-line VG002
|
|
228
|
-
app.get(
|
|
229
|
-
|
|
230
|
-
// Suppress all rules on this line
|
|
231
|
-
const x = something; // guardvibe-ignore
|
|
184
|
+
app.get("/api/health", (req, res) => res.json({ ok: true }));
|
|
232
185
|
```
|
|
233
186
|
|
|
234
187
|
Supports `//`, `#`, and `<!-- -->` comment styles.
|
|
235
188
|
|
|
236
|
-
## How It Works
|
|
237
|
-
|
|
238
|
-
GuardVibe runs as a local MCP server (stdio transport). When your AI assistant needs security guidance, it calls GuardVibe's tools:
|
|
239
|
-
|
|
240
|
-
1. **Writing code?** → `check_code` scans for vulnerability patterns with auto-fix
|
|
241
|
-
2. **Reviewing a project?** → `scan_directory` scans your entire codebase
|
|
242
|
-
3. **About to commit?** → `scan_staged` checks only staged files
|
|
243
|
-
4. **Adding a package?** → `scan_dependencies` checks your lockfile for CVEs
|
|
244
|
-
5. **Worried about leaks?** → `scan_secrets` detects API keys and tokens
|
|
245
|
-
6. **Building Docker?** → `check_code` with language `dockerfile` scans your Dockerfile
|
|
246
|
-
7. **Need guidance?** → `get_security_docs` for 14 framework guides
|
|
247
|
-
|
|
248
|
-
No API keys needed. No cloud dependency. Runs entirely on your machine.
|
|
249
|
-
|
|
250
189
|
## Development
|
|
251
190
|
|
|
252
191
|
```bash
|
|
253
192
|
git clone https://github.com/goklab/guardvibe.git
|
|
254
193
|
cd guardvibe
|
|
255
194
|
npm install
|
|
256
|
-
npm run
|
|
257
|
-
npm
|
|
258
|
-
npm test # run tests
|
|
259
|
-
npm start # run server
|
|
195
|
+
npm run build
|
|
196
|
+
npm test
|
|
260
197
|
```
|
|
261
198
|
|
|
262
199
|
## License
|
package/build/data/rules/core.js
CHANGED
|
@@ -8,7 +8,7 @@ export const coreRules = [
|
|
|
8
8
|
owasp: "A01:2025 Broken Access Control",
|
|
9
9
|
description: "Hardcoded passwords, API keys, or secrets detected in source code.",
|
|
10
10
|
pattern: /(?:secret_?key|api_?key|api_?secret|private_?key|access_?key|password|passwd|pwd|secret|token|auth_?token)\w*\s*[:=]\s*['"][^'"]{3,}['"]/gi,
|
|
11
|
-
languages: ["javascript", "typescript", "python", "go"
|
|
11
|
+
languages: ["javascript", "typescript", "python", "go"],
|
|
12
12
|
fix: "Use environment variables (process.env.SECRET) or a secrets manager. Never commit credentials to source code.",
|
|
13
13
|
fixCode: "// Use environment variables instead\nconst password = process.env.DB_PASSWORD;\nconst apiKey = process.env.API_KEY;",
|
|
14
14
|
compliance: ["SOC2:CC6.1", "PCI-DSS:Req2.3", "PCI-DSS:Req8", "HIPAA:§164.312(a)"],
|
|
@@ -20,7 +20,7 @@ export const coreRules = [
|
|
|
20
20
|
owasp: "A01:2025 Broken Access Control",
|
|
21
21
|
description: "Cloud provider API key or token pattern detected in source code (AWS, GitHub, OpenAI, Stripe).",
|
|
22
22
|
pattern: /(?:AKIA[0-9A-Z]{16}|(?:ghp|gho|ghu|ghs|ghr)_[A-Za-z0-9_]{36,}|sk-[A-Za-z0-9]{20,}|sk_live_[A-Za-z0-9]{20,})/g,
|
|
23
|
-
languages: ["javascript", "typescript", "python", "go", "
|
|
23
|
+
languages: ["javascript", "typescript", "python", "go", "html", "shell"],
|
|
24
24
|
fix: "Remove hardcoded keys immediately. Use environment variables or a secrets manager (AWS Secrets Manager, Vault). Rotate any compromised keys.",
|
|
25
25
|
fixCode: "// Store keys in environment variables\nconst awsKey = process.env.AWS_ACCESS_KEY_ID;\nconst githubToken = process.env.GITHUB_TOKEN;",
|
|
26
26
|
compliance: ["SOC2:CC6.1", "PCI-DSS:Req2.3", "HIPAA:§164.312(a)"],
|
|
@@ -55,8 +55,8 @@ export const coreRules = [
|
|
|
55
55
|
severity: "critical",
|
|
56
56
|
owasp: "A02:2025 Injection",
|
|
57
57
|
description: "String concatenation, template literals, or f-strings used in SQL queries. This allows SQL injection attacks.",
|
|
58
|
-
pattern: /(?:query|execute|raw|sql)\s*\(\s*(?:`[^`]*\$\{|['"][^'"]*['"]\s*\+\s*|f"[^"]*\{|f'[^']*\{|['"][^'"]*['"]\s*%\s*|['"][^'"]*['"]\s*\.format\s*\(|['"][^'"]*['"]\s*,\s*(?:req\.|request\.|params\.|body\.|args))/gi,
|
|
59
|
-
languages: ["javascript", "typescript", "python", "go"
|
|
58
|
+
pattern: /(?:query|execute|raw|sql|all|run|get|exec|prepare|QueryRow|QueryContext)\s*\(\s*(?:`[^`]*\$\{|['"][^'"]*['"]\s*\+\s*|f"[^"]*\{|f'[^']*\{|['"][^'"]*['"]\s*%\s*|['"][^'"]*['"]\s*\.format\s*\(|['"][^'"]*['"]\s*,\s*(?:req\.|request\.|params\.|body\.|args))/gi,
|
|
59
|
+
languages: ["javascript", "typescript", "python", "go"],
|
|
60
60
|
fix: "Use parameterized queries: db.query('SELECT * FROM users WHERE id = $1', [userId]). Python: cursor.execute('SELECT * FROM users WHERE id = %s', (user_id,)). Never concatenate user input into SQL strings.",
|
|
61
61
|
fixCode: "// Use parameterized queries\ndb.query('SELECT * FROM users WHERE id = $1', [userId]);\n// Python: cursor.execute('SELECT * FROM users WHERE id = %s', (user_id,))",
|
|
62
62
|
compliance: ["SOC2:CC7.1", "PCI-DSS:Req6.5.1", "HIPAA:§164.312(a)"],
|
|
@@ -67,8 +67,8 @@ export const coreRules = [
|
|
|
67
67
|
severity: "critical",
|
|
68
68
|
owasp: "A02:2025 Injection",
|
|
69
69
|
description: "User input passed to shell command functions. This allows arbitrary command execution.",
|
|
70
|
-
pattern: /(?:exec(?:Sync)?|spawn(?:Sync)?|system|popen|subprocess\.(?:call|run|Popen))\s*\(\s*(?:`[^`]*\$\{|['"][^'"]*['"]\s*\+|f['"][^'"]*\{|.*(?:req\.|request\.|params\.|body\.|input|argv))/gi,
|
|
71
|
-
languages: ["javascript", "typescript", "python", "go", "
|
|
70
|
+
pattern: /(?:exec(?:Sync)?|spawn(?:Sync)?|system|popen|subprocess\.(?:call|run|Popen)|shell_exec|sh|bash)\s*\(\s*(?:`[^`]*\$\{|['"][^'"]*['"]\s*\+|f['"][^'"]*\{|.*(?:req\.|request\.|params\.|body\.|input|argv))/gi,
|
|
71
|
+
languages: ["javascript", "typescript", "python", "go", "shell"],
|
|
72
72
|
fix: "Avoid shell commands with user input. Use allowlists and input validation. Prefer spawn() with array arguments. Python: use subprocess.run([...]) with list arguments, never shell=True with user input.",
|
|
73
73
|
fixCode: "// Use spawn with array arguments (no shell)\nimport { spawn } from 'child_process';\nspawn('ls', ['-la', directory]);",
|
|
74
74
|
compliance: ["SOC2:CC7.1", "PCI-DSS:Req6.5.1"],
|
|
@@ -117,7 +117,7 @@ export const coreRules = [
|
|
|
117
117
|
owasp: "A02:2025 Injection",
|
|
118
118
|
description: "Dynamic code execution function detected. This can run arbitrary code and is a major security risk.",
|
|
119
119
|
pattern: /\beval\s*\(/gi,
|
|
120
|
-
languages: ["javascript", "typescript", "python"
|
|
120
|
+
languages: ["javascript", "typescript", "python"],
|
|
121
121
|
fix: "Avoid dynamic code execution. Use JSON.parse() for JSON data. Use a sandboxed environment if absolutely required.",
|
|
122
122
|
fixCode: "// Use JSON.parse for data\nconst data = JSON.parse(input);\n// Alternatives: use a proper parser for your data format\n// const fn = new " + "Function('x', 'return x * 2'); // only if absolutely needed",
|
|
123
123
|
compliance: ["SOC2:CC7.1", "PCI-DSS:Req6.5.1"],
|
|
@@ -140,7 +140,7 @@ export const coreRules = [
|
|
|
140
140
|
owasp: "A04:2025 Insecure Design",
|
|
141
141
|
description: "Authentication or API endpoints without rate limiting are vulnerable to brute force attacks.",
|
|
142
142
|
pattern: /(?:\/login|\/auth|\/api\/|\/signin|\/register|\/signup|\/forgot-password)/gi,
|
|
143
|
-
languages: ["javascript", "typescript", "python", "go"
|
|
143
|
+
languages: ["javascript", "typescript", "python", "go"],
|
|
144
144
|
fix: "Add rate limiting middleware. Express: npm install express-rate-limit. FastAPI: use slowapi. Apply stricter limits on auth endpoints (e.g. 5 requests/minute).",
|
|
145
145
|
fixCode: "// Express rate limiting\nimport rateLimit from 'express-rate-limit';\napp.use('/api/', rateLimit({ windowMs: 15 * 60 * 1000, max: 100 }));",
|
|
146
146
|
},
|
|
@@ -151,7 +151,7 @@ export const coreRules = [
|
|
|
151
151
|
owasp: "A05:2025 Security Misconfiguration",
|
|
152
152
|
description: "CORS configured with wildcard (*) origin allows any website to make requests to your API.",
|
|
153
153
|
pattern: /(?:(?:cors|Access-Control-Allow-Origin)['"]?\]?\s*[:=(]\s*['"]?\s*\*|origin\s*:\s*['"]?\s*\*\s*['"]?|CORS_ORIGINS['"]?\]?\s*=\s*['"]?\s*\*)/gi,
|
|
154
|
-
languages: ["javascript", "typescript", "python", "go"
|
|
154
|
+
languages: ["javascript", "typescript", "python", "go"],
|
|
155
155
|
fix: "Set specific allowed origins: cors({ origin: ['https://myapp.com'] }). Never use wildcard with authentication.",
|
|
156
156
|
fixCode: "// Specify allowed origins\nimport cors from 'cors';\napp.use(cors({ origin: ['https://myapp.com'] }));",
|
|
157
157
|
compliance: ["SOC2:CC6.6", "PCI-DSS:Req6.5.10"],
|
|
@@ -185,7 +185,7 @@ export const coreRules = [
|
|
|
185
185
|
owasp: "A07:2025 Auth Failures",
|
|
186
186
|
description: "Using MD5 or SHA-1 for password hashing. These are fast hashes, not designed for passwords.",
|
|
187
187
|
pattern: /(?:md5|sha1|sha-1|createHash\s*\(\s*['"](?:md5|sha1)['"]\s*\))/gi,
|
|
188
|
-
languages: ["javascript", "typescript", "python", "go"
|
|
188
|
+
languages: ["javascript", "typescript", "python", "go"],
|
|
189
189
|
fix: "Use bcrypt, scrypt, or argon2 for password hashing. Use at least 12 salt rounds.",
|
|
190
190
|
fixCode: "// Use bcrypt for password hashing\nimport bcrypt from 'bcrypt';\nconst hash = await bcrypt.hash(password, 12);\nconst valid = await bcrypt.compare(input, hash);",
|
|
191
191
|
compliance: ["SOC2:CC6.1", "PCI-DSS:Req3.4", "PCI-DSS:Req8.2.1", "HIPAA:§164.312(a)"],
|
|
@@ -221,7 +221,7 @@ export const coreRules = [
|
|
|
221
221
|
owasp: "A09:2025 Logging Failures",
|
|
222
222
|
description: "Logging sensitive information like passwords, tokens, or personal data.",
|
|
223
223
|
pattern: /(?:console\.log|logger\.\w+|print)\s*\([^)]*(?:password|token|secret|ssn|credit.?card|api.?key)/gi,
|
|
224
|
-
languages: ["javascript", "typescript", "python", "go"
|
|
224
|
+
languages: ["javascript", "typescript", "python", "go"],
|
|
225
225
|
fix: "Never log sensitive data. Redact or mask sensitive fields before logging.",
|
|
226
226
|
fixCode: "// Redact sensitive fields\nconst safeUser = { ...user, password: '[REDACTED]' };\nconsole.log('User:', safeUser);",
|
|
227
227
|
compliance: ["SOC2:CC6.1", "PCI-DSS:Req3.4", "HIPAA:§164.312(a)"],
|
|
@@ -233,7 +233,7 @@ export const coreRules = [
|
|
|
233
233
|
owasp: "A10:2025 SSRF",
|
|
234
234
|
description: "User-supplied URLs passed to fetch/request functions can be used for SSRF attacks.",
|
|
235
235
|
pattern: /(?:fetch|axios|request|http\.get|urllib|requests\.get)\s*\(\s*(?:req\.|request\.|body\.|params\.|query\.|input|url|href)/gi,
|
|
236
|
-
languages: ["javascript", "typescript", "python", "go"
|
|
236
|
+
languages: ["javascript", "typescript", "python", "go"],
|
|
237
237
|
fix: "Validate and allowlist URLs before making requests. Block internal IP ranges.",
|
|
238
238
|
fixCode: "// Validate URL against allowlist\nconst allowed = ['https://api.example.com'];\nconst url = new URL(input);\nif (!allowed.some(a => url.origin === a)) throw new Error('Blocked');",
|
|
239
239
|
compliance: ["SOC2:CC7.1", "PCI-DSS:Req6.5.1"],
|
|
@@ -269,7 +269,7 @@ export const coreRules = [
|
|
|
269
269
|
owasp: "A01:2025 Broken Access Control",
|
|
270
270
|
description: "User input used in file paths without sanitization.",
|
|
271
271
|
pattern: /(?:readFile|readFileSync|createReadStream|open|path\.join|path\.resolve)\s*\([^)]*(?:req\.|request\.|params\.|body\.|query\.)/gi,
|
|
272
|
-
languages: ["javascript", "typescript", "python", "go"
|
|
272
|
+
languages: ["javascript", "typescript", "python", "go"],
|
|
273
273
|
fix: "Sanitize file paths: remove ../ sequences, verify the result is within the expected directory.",
|
|
274
274
|
fixCode: "import path from 'path';\nconst safePath = path.resolve('/uploads', filename);\nif (!safePath.startsWith('/uploads/')) throw new Error('Invalid path');",
|
|
275
275
|
compliance: ["SOC2:CC7.1", "PCI-DSS:Req6.5.1"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../src/data/rules/core.ts"],"names":[],"mappings":"AAEA,6EAA6E;AAC7E,6EA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E,sBAAsB;QAC5B,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,gCAAgC;QACvC,WAAW,EAAE,wDAAwD;QACrE,OAAO,EACL,yGAAyG;QAC3G,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACvC,GAAG,EAAE,yFAAyF;QAC9F,OAAO,EAAE,wLAAwL;QACjM,UAAU,EAAE,CAAC,YAAY,EAAE,mBAAmB,CAAC;KAChD;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,gCAAgC;QACvC,WAAW,EAAE,qDAAqD;QAClE,OAAO,EACL,iIAAiI;QACnI,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,IAAI,CAAC;QACvD,GAAG,EAAE,gGAAgG;QACrG,OAAO,EAAE,yJAAyJ;QAClK,UAAU,EAAE,CAAC,YAAY,EAAE,kBAAkB,CAAC;KAC/C;IACD;QACE,EAAE,EAAE,OAAO;QACX,IAAI,EAAE,0BAA0B;QAChC,QAAQ,EAAE,MAAM;QAChB,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EACT,kFAAkF;QACpF,OAAO,EACL,sFAAsF;QACxF,SAAS,EAAE,CAAC,YAAY,EAAE,YAAY,CAAC;QACvC,GAAG,EAAE,oHAAoH;QACzH,OAAO,EAAE,2NAA2N;QACpO,UAAU,EAAE,CAAC,YAAY,EAAE,kBAAkB,CAAC;KAC/C;CACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/rules/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/data/rules/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAO/C,eAAO,MAAM,UAAU,qCAMtB,CAAC"}
|
|
@@ -1,17 +1,11 @@
|
|
|
1
1
|
import { coreRules } from "./core.js";
|
|
2
2
|
import { goRules } from "./go.js";
|
|
3
|
-
import { javaRules } from "./java.js";
|
|
4
|
-
import { phpRules } from "./php.js";
|
|
5
|
-
import { rubyRules } from "./ruby.js";
|
|
6
3
|
import { dockerfileRules } from "./dockerfile.js";
|
|
7
4
|
import { cicdRules } from "./cicd.js";
|
|
8
5
|
import { terraformRules } from "./terraform.js";
|
|
9
6
|
export const owaspRules = [
|
|
10
7
|
...coreRules,
|
|
11
8
|
...goRules,
|
|
12
|
-
...javaRules,
|
|
13
|
-
...phpRules,
|
|
14
|
-
...rubyRules,
|
|
15
9
|
...dockerfileRules,
|
|
16
10
|
...cicdRules,
|
|
17
11
|
...terraformRules,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/rules/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/data/rules/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,GAAG,SAAS;IACZ,GAAG,OAAO;IACV,GAAG,eAAe;IAClB,GAAG,SAAS;IACZ,GAAG,cAAc;CAClB,CAAC"}
|
package/build/index.js
CHANGED
|
@@ -14,13 +14,13 @@ import { complianceReport } from "./tools/compliance-report.js";
|
|
|
14
14
|
import { exportSarif } from "./tools/export-sarif.js";
|
|
15
15
|
const server = new McpServer({
|
|
16
16
|
name: "guardvibe",
|
|
17
|
-
version: "0.6.
|
|
17
|
+
version: "0.6.4",
|
|
18
18
|
});
|
|
19
19
|
// Tool 1: Analyze code for security vulnerabilities
|
|
20
20
|
server.tool("check_code", "Analyze code for security vulnerabilities (OWASP Top 10, XSS, SQL injection, insecure patterns). Use this when reviewing or writing code to catch security issues early.", {
|
|
21
21
|
code: z.string().describe("The code snippet to analyze"),
|
|
22
22
|
language: z
|
|
23
|
-
.enum(["javascript", "typescript", "python", "go", "
|
|
23
|
+
.enum(["javascript", "typescript", "python", "go", "dockerfile", "html", "sql", "shell", "yaml", "terraform"])
|
|
24
24
|
.describe("Programming language of the code"),
|
|
25
25
|
framework: z
|
|
26
26
|
.string()
|
|
@@ -62,11 +62,11 @@ const packageSchema = z.object({
|
|
|
62
62
|
name: z.string().describe("Package name (e.g. lodash, express, django)"),
|
|
63
63
|
version: z.string().describe("Package version (e.g. 4.17.20)"),
|
|
64
64
|
ecosystem: z
|
|
65
|
-
.enum(["npm", "PyPI", "Go"
|
|
65
|
+
.enum(["npm", "PyPI", "Go"])
|
|
66
66
|
.default("npm")
|
|
67
67
|
.describe("Package ecosystem"),
|
|
68
68
|
});
|
|
69
|
-
server.tool("check_dependencies", "Check npm
|
|
69
|
+
server.tool("check_dependencies", "Check npm, PyPI, or Go packages for known security vulnerabilities (CVEs) using the OSV database. Use this before adding new dependencies or to audit existing ones.", {
|
|
70
70
|
packages: z.preprocess((val) => {
|
|
71
71
|
if (typeof val === "string") {
|
|
72
72
|
try {
|
|
@@ -94,7 +94,7 @@ server.tool("scan_directory", "Scan an entire project directory for security vul
|
|
|
94
94
|
return { content: [{ type: "text", text: results }] };
|
|
95
95
|
});
|
|
96
96
|
// Tool 6: Scan manifest/lockfile for dependency vulnerabilities
|
|
97
|
-
server.tool("scan_dependencies", "Parse a lockfile or manifest (package.json, requirements.txt, go.mod
|
|
97
|
+
server.tool("scan_dependencies", "Parse a lockfile or manifest (package.json, package-lock.json, requirements.txt, go.mod) and check all dependencies for known CVEs via the OSV database. Reads the file directly.", {
|
|
98
98
|
manifest_path: z.string().describe("Path to manifest file (e.g. 'package.json', 'requirements.txt', 'go.mod')"),
|
|
99
99
|
}, async ({ manifest_path }) => {
|
|
100
100
|
const results = await scanDependencies(manifest_path);
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAEtD,MAAM,MAAM,GAAG,IAAI,SAAS,CAAC;IAC3B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;CACjB,CAAC,CAAC;AAEH,oDAAoD;AACpD,MAAM,CAAC,IAAI,CACT,YAAY,EACZ,0KAA0K,EAC1K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AAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AACxD,CAAC,CACF,CAAC;AAEF,sDAAsD;AACtD,MAAM,CAAC,IAAI,CACT,cAAc,EACd,uIAAuI,EACvI;IACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,mBAAmB,CAAC;CAC/C,EACD,KAAK,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IACjB,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAClC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;AACxD,CAAC,CACF,CAAC;AAEF,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,gDAAgD,CAAC,CAAC;AAClE,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;IACrB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,KAAK,CAAC,CAAC;IACrC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"check-project.d.ts","sourceRoot":"","sources":["../../src/tools/check-project.ts"],"names":[],"mappings":"AAEA,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;
|
|
1
|
+
{"version":3,"file":"check-project.d.ts","sourceRoot":"","sources":["../../src/tools/check-project.ts"],"names":[],"mappings":"AAEA,UAAU,SAAS;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAiDD,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,MAAM,CAkJvD"}
|
|
@@ -2,13 +2,14 @@ import { analyzeCode } from "./check-code.js";
|
|
|
2
2
|
const extensionMap = {
|
|
3
3
|
".js": "javascript",
|
|
4
4
|
".jsx": "javascript",
|
|
5
|
+
".mjs": "javascript",
|
|
6
|
+
".cjs": "javascript",
|
|
5
7
|
".ts": "typescript",
|
|
6
8
|
".tsx": "typescript",
|
|
9
|
+
".mts": "typescript",
|
|
10
|
+
".cts": "typescript",
|
|
7
11
|
".py": "python",
|
|
8
12
|
".go": "go",
|
|
9
|
-
".java": "java",
|
|
10
|
-
".php": "php",
|
|
11
|
-
".rb": "ruby",
|
|
12
13
|
".html": "html",
|
|
13
14
|
".sql": "sql",
|
|
14
15
|
".sh": "shell",
|