vibe-guard 1.1.2 → 1.1.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/CHANGELOG.md +24 -2
- package/README.md +186 -110
- package/dist/bin/vibe-guard.js +60 -12
- package/dist/bin/vibe-guard.js.map +1 -1
- package/dist/config.d.ts +29 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +213 -0
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +9 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -15
- package/dist/index.js.map +1 -1
- package/dist/reporter.d.ts +7 -0
- package/dist/reporter.d.ts.map +1 -1
- package/dist/reporter.js +361 -5
- package/dist/reporter.js.map +1 -1
- package/dist/rules/ai-agent-access-control.d.ts +11 -0
- package/dist/rules/ai-agent-access-control.d.ts.map +1 -0
- package/dist/rules/ai-agent-access-control.js +65 -0
- package/dist/rules/ai-agent-access-control.js.map +1 -0
- package/dist/rules/ai-data-leakage-prevention.d.ts +11 -0
- package/dist/rules/ai-data-leakage-prevention.d.ts.map +1 -0
- package/dist/rules/ai-data-leakage-prevention.js +68 -0
- package/dist/rules/ai-data-leakage-prevention.js.map +1 -0
- package/dist/rules/ai-generated-code-validation.d.ts +17 -0
- package/dist/rules/ai-generated-code-validation.d.ts.map +1 -0
- package/dist/rules/ai-generated-code-validation.js +225 -0
- package/dist/rules/ai-generated-code-validation.js.map +1 -0
- package/dist/rules/broken-access-control.d.ts.map +1 -1
- package/dist/rules/broken-access-control.js +1 -10
- package/dist/rules/broken-access-control.js.map +1 -1
- package/dist/rules/csrf-protection.d.ts +0 -1
- package/dist/rules/csrf-protection.d.ts.map +1 -1
- package/dist/rules/csrf-protection.js +2 -22
- package/dist/rules/csrf-protection.js.map +1 -1
- package/dist/rules/exposed-secrets.d.ts.map +1 -1
- package/dist/rules/exposed-secrets.js +14 -36
- package/dist/rules/exposed-secrets.js.map +1 -1
- package/dist/rules/hardcoded-sensitive-data.d.ts.map +1 -1
- package/dist/rules/hardcoded-sensitive-data.js +0 -1
- package/dist/rules/hardcoded-sensitive-data.js.map +1 -1
- package/dist/rules/insecure-configuration.d.ts +5 -5
- package/dist/rules/insecure-configuration.d.ts.map +1 -1
- package/dist/rules/insecure-configuration.js +71 -87
- package/dist/rules/insecure-configuration.js.map +1 -1
- package/dist/rules/insecure-dependencies.d.ts.map +1 -1
- package/dist/rules/insecure-dependencies.js +29 -48
- package/dist/rules/insecure-dependencies.js.map +1 -1
- package/dist/rules/insecure-logging.d.ts.map +1 -1
- package/dist/rules/insecure-logging.js +0 -1
- package/dist/rules/insecure-logging.js.map +1 -1
- package/dist/rules/insecure-random-generation.d.ts.map +1 -1
- package/dist/rules/insecure-random-generation.js +0 -4
- package/dist/rules/insecure-random-generation.js.map +1 -1
- package/dist/rules/mcp-server-security.d.ts +11 -0
- package/dist/rules/mcp-server-security.d.ts.map +1 -0
- package/dist/rules/mcp-server-security.js +96 -0
- package/dist/rules/mcp-server-security.js.map +1 -0
- package/dist/rules/prompt-injection-detection.d.ts +11 -0
- package/dist/rules/prompt-injection-detection.d.ts.map +1 -0
- package/dist/rules/prompt-injection-detection.js +69 -0
- package/dist/rules/prompt-injection-detection.js.map +1 -0
- package/dist/rules/sql-injection.d.ts.map +1 -1
- package/dist/rules/sql-injection.js +13 -53
- package/dist/rules/sql-injection.js.map +1 -1
- package/dist/rules/unvalidated-input.d.ts.map +1 -1
- package/dist/rules/unvalidated-input.js +0 -1
- package/dist/rules/unvalidated-input.js.map +1 -1
- package/dist/rules/xss-detection.d.ts.map +1 -1
- package/dist/rules/xss-detection.js +17 -75
- package/dist/rules/xss-detection.js.map +1 -1
- package/dist/scanner.d.ts.map +1 -1
- package/dist/scanner.js +1 -13
- package/dist/scanner.js.map +1 -1
- package/dist/types/index.d.ts +11 -5
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.js +1 -1
- package/package.json +17 -12
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.1.3] - 2025-01-27
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
- **Complete Documentation Site**: Beautiful, responsive documentation with performance benchmarks
|
|
12
|
+
- **Performance Benchmarking**: Comprehensive speed testing with `npm run benchmark`
|
|
13
|
+
- **Multiple Output Formats**: SARIF and HTML report support
|
|
14
|
+
- **Configuration System**: Full `vibe-guard.json` configuration support
|
|
15
|
+
- **GitHub Pages Deployment**: Automated documentation deployment
|
|
16
|
+
- **Enhanced CLI**: Better error handling and user experience
|
|
17
|
+
|
|
18
|
+
### Changed
|
|
19
|
+
- **Performance Optimization**: Streamlined detection patterns across all security rules
|
|
20
|
+
- **Code Quality Improvements**: Eliminated redundant logic and overlapping patterns
|
|
21
|
+
- **Enhanced Maintainability**: Consolidated similar patterns for better code organization
|
|
22
|
+
- **Documentation**: Complete rewrite with performance metrics and benchmarks
|
|
23
|
+
|
|
24
|
+
### Fixed
|
|
25
|
+
- Eliminated redundant logic that was catching everything then filtering
|
|
26
|
+
- Removed duplicate pattern matching that slowed down scanning
|
|
27
|
+
- Improved code maintainability with cleaner rule implementations
|
|
28
|
+
- Fixed Vite build configuration for documentation deployment
|
|
29
|
+
|
|
8
30
|
## [1.1.2] - 2025-01-27
|
|
9
31
|
|
|
10
32
|
### Added
|
|
@@ -34,10 +56,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
34
56
|
- **Zero False Positives**: Clean code no longer triggers false alarms
|
|
35
57
|
- **Improved Documentation**: Updated README with all 20 rules categorized by severity
|
|
36
58
|
|
|
37
|
-
### Security Rules (
|
|
59
|
+
### Security Rules (25 Total)
|
|
38
60
|
- **Critical (7)**: Exposed secrets, hardcoded sensitive data, XSS detection
|
|
39
61
|
- **High (12)**: Missing authentication, SQL injection, directory traversal, open CORS, CSRF protection, insecure deserialization, broken access control, insecure file upload, insecure session management
|
|
40
|
-
- **Medium (
|
|
62
|
+
- **Medium (13)**: Unvalidated input, insecure HTTP, insecure dependencies, missing security headers, insecure random generation, insecure logging, insecure error handling, insecure configuration, AI-generated code validation, AI data leakage prevention, prompt injection detection, AI agent access control, MCP server security
|
|
41
63
|
|
|
42
64
|
### Changed
|
|
43
65
|
- Enhanced pattern detection for all security rules
|
package/README.md
CHANGED
|
@@ -1,107 +1,92 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Vibe-Guard Security Scanner
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**The security scanner that actually catches real vulnerabilities without the noise**
|
|
4
4
|
|
|
5
|
-
Zero dependencies • Instant setup • Works everywhere •
|
|
5
|
+
Zero dependencies • Instant setup • Works everywhere • 25 essential security rules
|
|
6
6
|
|
|
7
|
-
##
|
|
7
|
+
## What Is This Thing?
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
Vibe-Guard catches the security mistakes we all make when we're coding fast. You know the drill you're in the zone, AI is helping you code, or you're quickly prototyping something, and suddenly you've got API keys in your code or forgot to add auth to that admin endpoint. We've all been there.
|
|
10
|
+
|
|
11
|
+
### The Core Philosophy
|
|
12
|
+
|
|
13
|
+
- **Catch real issues** - Not theoretical vulnerabilities that don't matter
|
|
14
|
+
- **Zero false positives** - If it flags something, it's actually a problem
|
|
15
|
+
- **Fast enough to use daily** - Scans your entire project in seconds
|
|
16
|
+
- **Works everywhere** - macOS, Linux, Windows, Docker, CI/CD
|
|
17
|
+
- **No setup required** - Download and run, that's it
|
|
18
|
+
|
|
19
|
+
## Quick Start (The "Just Show Me Code" Section)
|
|
20
|
+
|
|
21
|
+
### Option 1: Download Binary (Recommended)
|
|
10
22
|
```bash
|
|
11
23
|
# macOS (Intel)
|
|
12
|
-
curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.
|
|
24
|
+
curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.1.3/vibe-guard-macos-x64 -o vibe-guard
|
|
13
25
|
chmod +x vibe-guard
|
|
14
26
|
./vibe-guard scan .
|
|
15
27
|
|
|
16
28
|
# macOS (Apple Silicon)
|
|
17
|
-
curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.
|
|
18
|
-
chmod +x vibe-guard
|
|
19
|
-
./vibe-guard scan .
|
|
20
|
-
|
|
21
|
-
# Linux (x64)
|
|
22
|
-
curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.0.1/vibe-guard-linux-x64 -o vibe-guard
|
|
29
|
+
curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.1.3/vibe-guard-macos-arm64 -o vibe-guard
|
|
23
30
|
chmod +x vibe-guard
|
|
24
31
|
./vibe-guard scan .
|
|
25
32
|
|
|
26
|
-
# Linux
|
|
27
|
-
curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.
|
|
33
|
+
# Linux
|
|
34
|
+
curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.1.3/vibe-guard-linux-x64 -o vibe-guard
|
|
28
35
|
chmod +x vibe-guard
|
|
29
36
|
./vibe-guard scan .
|
|
30
|
-
|
|
31
|
-
# Windows
|
|
32
|
-
# Download vibe-guard-windows-x64.exe from releases page
|
|
33
37
|
```
|
|
34
38
|
|
|
35
|
-
### Option 2:
|
|
39
|
+
### Option 2: Homebrew
|
|
36
40
|
```bash
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
brew install vibe-guard
|
|
40
|
-
|
|
41
|
-
# Chocolatey (Windows) - Ready for submission
|
|
42
|
-
# choco install vibe-guard
|
|
43
|
-
|
|
44
|
-
# RPM (RHEL/CentOS) - Ready for submission
|
|
45
|
-
# rpm -i https://github.com/Devjosef/vibe-guard/releases/latest/download/vibe-guard.rpm
|
|
46
|
-
|
|
47
|
-
# DEB (Ubuntu/Debian) - Ready for submission
|
|
48
|
-
# curl -L https://github.com/Devjosef/vibe-guard/releases/latest/download/vibe-guard.deb -o vibe-guard.deb
|
|
49
|
-
# sudo dpkg -i vibe-guard.deb
|
|
41
|
+
brew install Devjosef/tap/vibe-guard
|
|
42
|
+
vibe-guard scan .
|
|
50
43
|
```
|
|
51
44
|
|
|
52
|
-
### Option 3:
|
|
45
|
+
### Option 3: One-liner Install
|
|
53
46
|
```bash
|
|
54
|
-
|
|
55
|
-
docker pull vibe-guard/vibe-guard:latest
|
|
56
|
-
|
|
57
|
-
# Scan current directory
|
|
58
|
-
docker run --rm -v $(pwd):/code vibe-guard/vibe-guard:latest scan /code
|
|
59
|
-
|
|
60
|
-
# Scan specific file
|
|
61
|
-
docker run --rm -v $(pwd):/code vibe-guard/vibe-guard:latest scan /code/app.js
|
|
62
|
-
|
|
63
|
-
# Use specific version
|
|
64
|
-
docker run --rm -v $(pwd):/code vibe-guard/vibe-guard:1.0.1 scan /code
|
|
47
|
+
curl -fsSL https://raw.githubusercontent.com/Devjosef/vibe-guard/main/install.sh | sh
|
|
65
48
|
```
|
|
66
49
|
|
|
67
|
-
### Option 4: NPM
|
|
50
|
+
### Option 4: NPM
|
|
68
51
|
```bash
|
|
69
|
-
#
|
|
52
|
+
# One-time use
|
|
70
53
|
npx vibe-guard scan .
|
|
71
|
-
|
|
54
|
+
|
|
55
|
+
# Global install
|
|
72
56
|
npm install -g vibe-guard
|
|
73
57
|
vibe-guard scan .
|
|
74
58
|
```
|
|
75
59
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- **Won't Spam You**: Smart enough to know test code from real issues
|
|
81
|
-
- **Made by Developers**: We know what actually breaks in production
|
|
82
|
-
- **Works Everywhere**: macOS, Linux, Windows, Docker, CI/CD - you name it
|
|
83
|
-
- **ARM64 Support**: Native support for Apple Silicon and ARM64 Linux
|
|
84
|
-
- **Cross-Platform**: Single binary for each platform, no dependencies
|
|
60
|
+
### Option 5: Docker
|
|
61
|
+
```bash
|
|
62
|
+
docker run --rm -v $(pwd):/code vibe-guard/vibe-guard:1.1.3 scan /code
|
|
63
|
+
```
|
|
85
64
|
|
|
86
|
-
##
|
|
65
|
+
## The 25 Security Rules (What It Actually Catches)
|
|
87
66
|
|
|
88
67
|
### 🚨 Critical Issues (7 Rules)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
- **
|
|
68
|
+
These will get you hacked. Fix them immediately.
|
|
69
|
+
|
|
70
|
+
- **Exposed Secrets**: API keys, tokens, credentials in code
|
|
71
|
+
- **Hardcoded Sensitive Data**: Database passwords, JWT secrets, encryption keys
|
|
72
|
+
- **XSS Detection**: Cross-site scripting vulnerabilities
|
|
92
73
|
|
|
93
74
|
### ⚠️ High-Risk Issues (12 Rules)
|
|
75
|
+
These are serious but won't immediately compromise your app.
|
|
76
|
+
|
|
94
77
|
- **Missing Authentication**: Unprotected admin routes and API endpoints
|
|
95
78
|
- **SQL Injection**: String concatenation in database queries
|
|
96
79
|
- **Directory Traversal**: Unsafe file path operations
|
|
97
80
|
- **Open CORS**: Wildcard origins that let anyone access your API
|
|
98
|
-
- **CSRF Protection**: Missing CSRF tokens in forms and unsafe
|
|
81
|
+
- **CSRF Protection**: Missing CSRF tokens in forms and unsafe cookies
|
|
99
82
|
- **Insecure Deserialization**: Unsafe JSON parsing and eval usage
|
|
100
83
|
- **Broken Access Control**: Missing authorization checks
|
|
101
84
|
- **Insecure File Upload**: Unsafe file handling and validation
|
|
102
85
|
- **Insecure Session Management**: Weak session secrets and insecure cookies
|
|
103
86
|
|
|
104
|
-
### 📋 Medium Issues (
|
|
87
|
+
### 📋 Medium Issues (13 Rules)
|
|
88
|
+
These are security best practices that should be addressed.
|
|
89
|
+
|
|
105
90
|
- **Unvalidated Input**: Direct use of user input without checks
|
|
106
91
|
- **Insecure HTTP**: Using HTTP instead of HTTPS
|
|
107
92
|
- **Insecure Dependencies**: Outdated packages with known security issues
|
|
@@ -110,33 +95,11 @@ vibe-guard scan .
|
|
|
110
95
|
- **Insecure Logging**: Sensitive data exposure in logs
|
|
111
96
|
- **Insecure Error Handling**: Stack trace and information disclosure
|
|
112
97
|
- **Insecure Configuration**: Debug mode and security features disabled
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
### 🎯 How Sensitivity Works
|
|
119
|
-
- **Critical & High Severity**: Very sensitive - catches real vulnerabilities
|
|
120
|
-
- **Medium & Low Severity**: Moderately sensitive - focuses on production-relevant issues
|
|
121
|
-
- **False Positive Prevention**: Automatically filters out:
|
|
122
|
-
- Comments and documentation
|
|
123
|
-
- Test files and development code
|
|
124
|
-
- Environment variables (`${VAR}`, `process.env.VAR`)
|
|
125
|
-
- Safe patterns (parameterized queries, HTTPS, etc.)
|
|
126
|
-
- Framework-specific safeguards
|
|
127
|
-
|
|
128
|
-
### 📊 Detection Characteristics
|
|
129
|
-
- **Detection Rate**: ~50-70% of potential issues (focused on real problems)
|
|
130
|
-
- **False Positive Rate**: Very low (designed for development workflows)
|
|
131
|
-
- **Performance**: Fast scanning without overwhelming noise
|
|
132
|
-
- **Actionable Results**: Every issue includes specific fix suggestions
|
|
133
|
-
|
|
134
|
-
### 🔧 For Different Use Cases
|
|
135
|
-
- **Development**: Current settings are well-balanced for daily use
|
|
136
|
-
- **Production Audits**: Consider running with verbose mode and manual review
|
|
137
|
-
- **Maximum Sensitivity**: Can be configured by modifying rule filters
|
|
138
|
-
|
|
139
|
-
*This approach ensures VibeGuard catches real security issues while remaining practical for development workflows.*
|
|
98
|
+
- **AI-Generated Code Validation**: Detecting potentially unsafe AI-generated code
|
|
99
|
+
- **AI Data Leakage Prevention**: Preventing sensitive data exposure in AI outputs
|
|
100
|
+
- **Prompt Injection Detection**: Detecting potential prompt injection vulnerabilities
|
|
101
|
+
- **AI Agent Access Control**: Ensuring proper access controls for AI agents
|
|
102
|
+
- **MCP Server Security**: Detecting insecure Model Context Protocol configurations
|
|
140
103
|
|
|
141
104
|
## Usage Examples
|
|
142
105
|
|
|
@@ -147,23 +110,31 @@ vibe-guard scan .
|
|
|
147
110
|
# Scan specific file
|
|
148
111
|
vibe-guard scan app.js
|
|
149
112
|
|
|
150
|
-
#
|
|
151
|
-
vibe-guard scan . --format json
|
|
113
|
+
# Multiple output formats
|
|
114
|
+
vibe-guard scan . --format json # JSON for CI/CD
|
|
115
|
+
vibe-guard scan . --format sarif # SARIF for GitHub/SonarQube
|
|
116
|
+
vibe-guard scan . --format html # HTML report
|
|
117
|
+
|
|
118
|
+
# Configuration file
|
|
119
|
+
vibe-guard scan . --config vibe-guard.json
|
|
152
120
|
|
|
153
121
|
# Quick syntax (same as scan)
|
|
154
122
|
vibe-guard .
|
|
155
123
|
|
|
156
124
|
# Show version
|
|
157
125
|
vibe-guard --version
|
|
126
|
+
|
|
127
|
+
# Run performance benchmarks
|
|
128
|
+
npm run benchmark
|
|
158
129
|
```
|
|
159
130
|
|
|
160
|
-
##
|
|
131
|
+
## CI/CD Integration
|
|
161
132
|
|
|
162
133
|
### GitHub Actions
|
|
163
134
|
```yaml
|
|
164
135
|
- name: Security Scan
|
|
165
136
|
run: |
|
|
166
|
-
curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.
|
|
137
|
+
curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.1.3/vibe-guard-linux-x64 -o vibe-guard
|
|
167
138
|
chmod +x vibe-guard
|
|
168
139
|
./vibe-guard scan .
|
|
169
140
|
```
|
|
@@ -172,7 +143,7 @@ vibe-guard --version
|
|
|
172
143
|
```yaml
|
|
173
144
|
security_scan:
|
|
174
145
|
script:
|
|
175
|
-
- curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.
|
|
146
|
+
- curl -L https://github.com/Devjosef/vibe-guard/releases/download/v1.1.3/vibe-guard-linux-x64 -o vibe-guard
|
|
176
147
|
- chmod +x vibe-guard
|
|
177
148
|
- ./vibe-guard scan .
|
|
178
149
|
```
|
|
@@ -180,19 +151,33 @@ security_scan:
|
|
|
180
151
|
### Docker in CI
|
|
181
152
|
```yaml
|
|
182
153
|
- name: Security Scan
|
|
183
|
-
run: docker run --rm -v $(pwd):/code vibe-guard/vibe-guard:1.
|
|
154
|
+
run: docker run --rm -v $(pwd):/code vibe-guard/vibe-guard:1.1.3 scan /code
|
|
184
155
|
```
|
|
185
156
|
|
|
186
|
-
##
|
|
157
|
+
## Scanner Sensitivity (How It Works)
|
|
187
158
|
|
|
188
|
-
-
|
|
189
|
-
- **Rapid prototyping** - Building something quick? Don't let security be an afterthought
|
|
190
|
-
- **No-code/Low-code folks** - Generated code can have issues, this catches them
|
|
191
|
-
- **Your CI/CD pipeline** - Catch problems before they hit production
|
|
192
|
-
- **Code reviews** - Run this before you submit that PR
|
|
193
|
-
- **Learning security** - Get real-time feedback on what can or is going wrong (and how to fix it)
|
|
159
|
+
Vibe-Guard is designed with **intelligent sensitivity** to balance detection accuracy with usability:
|
|
194
160
|
|
|
195
|
-
|
|
161
|
+
### Detection Characteristics
|
|
162
|
+
- **Detection Rate**: ~50-70% of potential issues (focused on real problems)
|
|
163
|
+
- **False Positive Rate**: Very low (designed for development workflows)
|
|
164
|
+
- **Performance**: Optimized scanning with streamlined detection patterns
|
|
165
|
+
- **Actionable Results**: Every issue includes specific fix suggestions
|
|
166
|
+
|
|
167
|
+
### Automatic Filtering
|
|
168
|
+
Vibe-Guard automatically filters out:
|
|
169
|
+
- Comments and documentation
|
|
170
|
+
- Test files and development code
|
|
171
|
+
- Environment variables (`${VAR}`, `process.env.VAR`)
|
|
172
|
+
- Safe patterns (parameterized queries, HTTPS, etc.)
|
|
173
|
+
- Framework-specific safeguards
|
|
174
|
+
|
|
175
|
+
### Use Cases
|
|
176
|
+
- **Development**: Current settings are well-balanced for daily use
|
|
177
|
+
- **Production Audits**: Consider running with verbose mode and manual review
|
|
178
|
+
- **Maximum Sensitivity**: Can be configured by modifying rule filters
|
|
179
|
+
|
|
180
|
+
## Language Support
|
|
196
181
|
|
|
197
182
|
Works with all the languages you actually use:
|
|
198
183
|
- **JavaScript/TypeScript**: .js, .jsx, .ts, .tsx
|
|
@@ -204,7 +189,7 @@ Works with all the languages you actually use:
|
|
|
204
189
|
- **C#**: .cs
|
|
205
190
|
- **Config files**: .json, .yaml, .yml, .env
|
|
206
191
|
|
|
207
|
-
##
|
|
192
|
+
## Development
|
|
208
193
|
|
|
209
194
|
Want to contribute or build from source?
|
|
210
195
|
|
|
@@ -220,17 +205,74 @@ npm run package
|
|
|
220
205
|
|
|
221
206
|
# Run tests
|
|
222
207
|
npm test
|
|
208
|
+
|
|
209
|
+
# Build documentation
|
|
210
|
+
npm run docs:build
|
|
211
|
+
|
|
212
|
+
# Start docs dev server
|
|
213
|
+
npm run docs:dev
|
|
223
214
|
```
|
|
224
215
|
|
|
225
216
|
### Project Structure
|
|
226
217
|
```
|
|
227
218
|
src/
|
|
228
219
|
├── types/ # TypeScript definitions
|
|
229
|
-
├── rules/ # All
|
|
220
|
+
├── rules/ # All 25 security rule implementations
|
|
230
221
|
├── bin/ # CLI interface
|
|
231
222
|
├── scanner.ts # File scanning engine
|
|
232
223
|
├── reporter.ts # Output formatting
|
|
224
|
+
├── config.ts # Configuration loader
|
|
233
225
|
└── index.ts # Main application
|
|
226
|
+
|
|
227
|
+
documents/ # Documentation website
|
|
228
|
+
├── index.html # Landing page
|
|
229
|
+
├── docs.html # Full documentation
|
|
230
|
+
├── performance.html # Performance benchmarks
|
|
231
|
+
├── rules.html # Security rules guide
|
|
232
|
+
└── styles.css # Styling
|
|
233
|
+
|
|
234
|
+
scripts/
|
|
235
|
+
├── benchmark.js # Performance testing
|
|
236
|
+
└── maintenance.js # Project maintenance
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## Why Choose Vibe-Guard?
|
|
240
|
+
|
|
241
|
+
### What You Get
|
|
242
|
+
- **Zero Setup**: Download and run, no dependencies
|
|
243
|
+
- **Fast Scanning**: Optimized patterns for speed
|
|
244
|
+
- **Real Issues**: Focused on actual vulnerabilities
|
|
245
|
+
- **Cross-Platform**: Works everywhere
|
|
246
|
+
- **CI/CD Ready**: Integrates seamlessly
|
|
247
|
+
- **Clear Fixes**: Every issue comes with specific solutions
|
|
248
|
+
|
|
249
|
+
### What You Don't Get
|
|
250
|
+
- Complex configuration files
|
|
251
|
+
- False positive spam
|
|
252
|
+
- Framework lock-in
|
|
253
|
+
- Slow scanning that kills your workflow
|
|
254
|
+
- Cryptic error messages
|
|
255
|
+
|
|
256
|
+
## Performance Benchmarks
|
|
257
|
+
|
|
258
|
+
Vibe-Guard is engineered for speed. Here's how it performs:
|
|
259
|
+
|
|
260
|
+
### ⚡ Speed Metrics
|
|
261
|
+
- **Startup Time**: ~41ms (near-instant)
|
|
262
|
+
- **Small Files (1KB)**: ~51ms (ultra-fast)
|
|
263
|
+
- **Medium Files (5KB)**: ~51ms (very fast)
|
|
264
|
+
- **Large Files (50KB)**: ~117ms (efficient)
|
|
265
|
+
- **Memory Usage**: ~56KB (ultra-low footprint)
|
|
266
|
+
|
|
267
|
+
### 🏃 Real-World Performance
|
|
268
|
+
- **Small Projects (1-10 files)**: Complete in under 200ms
|
|
269
|
+
- **Medium Projects (100-1000 files)**: Complete in 2-5 seconds
|
|
270
|
+
- **Large Projects (1000+ files)**: Complete in 8-20 seconds
|
|
271
|
+
- **Enterprise Codebases**: Handles 10,000+ files efficiently
|
|
272
|
+
|
|
273
|
+
### 📊 Run Your Own Benchmarks
|
|
274
|
+
```bash
|
|
275
|
+
npm run benchmark
|
|
234
276
|
```
|
|
235
277
|
|
|
236
278
|
## Comparison
|
|
@@ -238,16 +280,50 @@ src/
|
|
|
238
280
|
| Feature | Vibe-Guard | Other Tools |
|
|
239
281
|
|---------|------------|-------------|
|
|
240
282
|
| Setup Time | 0 seconds | Minutes |
|
|
241
|
-
|
|
|
283
|
+
| Startup Time | ~41ms | 2-5 seconds |
|
|
284
|
+
| Small File Scan | ~51ms | 500ms-2s |
|
|
285
|
+
| Large File Scan | ~117ms | 5-15s |
|
|
286
|
+
| Memory Usage | ~56KB | 50-200MB |
|
|
287
|
+
| Dependencies | Zero | 50-200 |
|
|
242
288
|
| False Positives | Minimal | High |
|
|
243
|
-
| Speed | ⚡ Fast | 🐌 Slow |
|
|
244
289
|
| Languages | All major ones | Limited |
|
|
245
290
|
| CI/CD Ready | ✅ Yes | ⚠️ Complex |
|
|
246
291
|
| Actually explains fixes | ✅ Yes | ❌ Cryptic |
|
|
247
292
|
| ARM64 Support | ✅ Yes | ❌ Limited |
|
|
248
|
-
| Security Rules |
|
|
293
|
+
| Security Rules | 25 comprehensive rules | Varies |
|
|
294
|
+
|
|
295
|
+
## Who This Is For
|
|
296
|
+
|
|
297
|
+
- **When you're coding with AI** - ChatGPT and Copilot are amazing, but they sometimes miss security basics
|
|
298
|
+
- **Rapid prototyping** - Building something quick? Don't let security be an afterthought
|
|
299
|
+
- **No-code/Low-code folks** - Generated code can have issues, this catches them
|
|
300
|
+
- **Your CI/CD pipeline** - Catch problems before they hit production
|
|
301
|
+
- **Code reviews** - Run this before you submit that PR
|
|
302
|
+
- **Learning security** - Get real-time feedback on what can or is going wrong (and how to fix it)
|
|
303
|
+
|
|
304
|
+
## Documentation & Resources
|
|
305
|
+
|
|
306
|
+
- **📖 [Full Documentation](https://devjosef.github.io/vibe-guard/)** - Complete guides and API reference
|
|
307
|
+
- **⚡ [Performance Benchmarks](https://devjosef.github.io/vibe-guard/performance.html)** - Detailed speed metrics
|
|
308
|
+
- **🛡️ [Security Rules](https://devjosef.github.io/vibe-guard/rules.html)** - All 25 rules explained
|
|
309
|
+
- **🚀 [Getting Started](https://devjosef.github.io/vibe-guard/getting-started.html)** - Quick setup guide
|
|
310
|
+
|
|
311
|
+
## Roadmap
|
|
312
|
+
|
|
313
|
+
### ✅ Completed Features
|
|
314
|
+
- **Configuration Files**: Full support for `vibe-guard.json` configuration
|
|
315
|
+
- **Multiple Output Formats**: Table, JSON, SARIF, and HTML reports
|
|
316
|
+
- **Documentation Site**: Beautiful, responsive documentation
|
|
317
|
+
- **Performance Benchmarks**: Comprehensive speed testing
|
|
318
|
+
- **GitHub Pages**: Automated deployment
|
|
319
|
+
|
|
320
|
+
### 🚧 Planned Features
|
|
321
|
+
- **Custom Rules**: User-defined security rules and patterns
|
|
322
|
+
- **CI/CD Integration**: GitHub Actions and other CI/CD examples
|
|
323
|
+
- **Performance Improvements**: Parallel processing, caching
|
|
324
|
+
- **IDE Integration**: VS Code extension, editor plugins
|
|
249
325
|
|
|
250
|
-
##
|
|
326
|
+
## Contributing
|
|
251
327
|
|
|
252
328
|
1. **Add Security Rules**: Extend the rule engine with new patterns
|
|
253
329
|
2. **Improve Detection**: Help reduce false positives
|
|
@@ -256,12 +332,12 @@ src/
|
|
|
256
332
|
|
|
257
333
|
See [SECURITY_RULES.md](SECURITY_RULES.md) for detailed rule documentation.
|
|
258
334
|
|
|
259
|
-
##
|
|
335
|
+
## License
|
|
260
336
|
|
|
261
337
|
MIT License - Use it anywhere, anytime!
|
|
262
338
|
|
|
263
339
|
---
|
|
264
340
|
|
|
265
|
-
**Built with
|
|
341
|
+
**Built with love by developers who got tired of slow, complex security tools.**
|
|
266
342
|
|
|
267
343
|
*Security shouldn't slow you down, but security holes definitely will.*
|
package/dist/bin/vibe-guard.js
CHANGED
|
@@ -1,5 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
3
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
38
|
};
|
|
@@ -13,13 +46,10 @@ program
|
|
|
13
46
|
.name('vibe-guard')
|
|
14
47
|
.description('🛡️ Vibe-Guard Security Scanner - Catch security issues before they catch you!')
|
|
15
48
|
.version(version_1.VERSION);
|
|
16
|
-
|
|
49
|
+
const fs = __importStar(require("fs"));
|
|
17
50
|
async function handleScan(target, options) {
|
|
18
51
|
try {
|
|
19
52
|
console.log(chalk_1.default.blue.bold('🛡️ Starting Vibe-Guard Security Scan...\n'));
|
|
20
|
-
// Debug logging
|
|
21
|
-
console.log('DEBUG: Format option:', options.format);
|
|
22
|
-
console.log('DEBUG: All options:', JSON.stringify(options, null, 2));
|
|
23
53
|
const scanOptions = {
|
|
24
54
|
target,
|
|
25
55
|
format: options.format,
|
|
@@ -29,8 +59,13 @@ async function handleScan(target, options) {
|
|
|
29
59
|
};
|
|
30
60
|
const vibeGuard = new index_1.default();
|
|
31
61
|
const output = await vibeGuard.scanAndFormat(scanOptions);
|
|
32
|
-
|
|
33
|
-
|
|
62
|
+
if (options.outputFile) {
|
|
63
|
+
fs.writeFileSync(options.outputFile, output);
|
|
64
|
+
console.log(chalk_1.default.green(`✅ Results written to: ${options.outputFile}`));
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
console.log(output);
|
|
68
|
+
}
|
|
34
69
|
const result = await vibeGuard.scan(scanOptions);
|
|
35
70
|
if (result.issuesFound > 0) {
|
|
36
71
|
process.exit(1);
|
|
@@ -41,20 +76,20 @@ async function handleScan(target, options) {
|
|
|
41
76
|
process.exit(1);
|
|
42
77
|
}
|
|
43
78
|
}
|
|
44
|
-
// Scan command (main functionality)
|
|
45
79
|
program
|
|
46
80
|
.command('scan')
|
|
47
81
|
.description('Scan files or directories for security issues')
|
|
48
82
|
.argument('<target>', 'File or directory to scan')
|
|
49
|
-
.option('-f, --format <format>', 'Output format (table, json
|
|
83
|
+
.option('-f, --format <format>', 'Output format (table, json, sarif, html)')
|
|
84
|
+
.option('-o, --output-file <file>', 'Write output to file')
|
|
50
85
|
.option('-v, --verbose', 'Verbose output', false)
|
|
51
86
|
.option('--exclude <patterns...>', 'Exclude patterns')
|
|
52
87
|
.option('--include <patterns...>', 'Include patterns')
|
|
53
88
|
.action(handleScan);
|
|
54
|
-
// Default scan command (for backward compatibility)
|
|
55
89
|
program
|
|
56
90
|
.argument('[target]', 'File or directory to scan')
|
|
57
|
-
.option('-f, --format <format>', 'Output format (table, json
|
|
91
|
+
.option('-f, --format <format>', 'Output format (table, json, sarif, html)')
|
|
92
|
+
.option('-o, --output-file <file>', 'Write output to file')
|
|
58
93
|
.option('-v, --verbose', 'Verbose output', false)
|
|
59
94
|
.option('--exclude <patterns...>', 'Exclude patterns')
|
|
60
95
|
.option('--include <patterns...>', 'Include patterns')
|
|
@@ -92,12 +127,25 @@ program
|
|
|
92
127
|
console.log('Built for developers who code fast and need security that keeps up! 🚀');
|
|
93
128
|
console.log(chalk_1.default.gray('TypeScript-powered, zero-dependency security scanning'));
|
|
94
129
|
});
|
|
95
|
-
|
|
130
|
+
program
|
|
131
|
+
.command('init')
|
|
132
|
+
.description('Create a default vibe-guard.json configuration file')
|
|
133
|
+
.action(() => {
|
|
134
|
+
const vibeGuard = new index_1.default();
|
|
135
|
+
vibeGuard.createConfigFile();
|
|
136
|
+
});
|
|
137
|
+
program
|
|
138
|
+
.command('config')
|
|
139
|
+
.description('Show sample configuration')
|
|
140
|
+
.action(() => {
|
|
141
|
+
const vibeGuard = new index_1.default();
|
|
142
|
+
console.log(chalk_1.default.blue.bold('📝 Sample vibe-guard.json Configuration:\n'));
|
|
143
|
+
console.log(vibeGuard.generateConfig());
|
|
144
|
+
});
|
|
96
145
|
process.on('unhandledRejection', (reason, promise) => {
|
|
97
146
|
console.error(chalk_1.default.red.bold('❌ Unhandled Rejection at:'), promise, chalk_1.default.red('reason:'), reason);
|
|
98
147
|
process.exit(1);
|
|
99
148
|
});
|
|
100
|
-
// Handle uncaught exceptions
|
|
101
149
|
process.on('uncaughtException', (error) => {
|
|
102
150
|
console.error(chalk_1.default.red.bold('❌ Uncaught Exception:'), error);
|
|
103
151
|
process.exit(1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vibe-guard.js","sourceRoot":"","sources":["../../src/bin/vibe-guard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vibe-guard.js","sourceRoot":"","sources":["../../src/bin/vibe-guard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAoC;AACpC,kDAA0B;AAC1B,qDAAiC;AAEjC,8CAA2C;AAE3C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,YAAY,CA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-0,0 +1,29 @@
|
|
|
1
|
+
import { VibeGuardConfig, ScanOptions } from './types';
|
|
2
|
+
export declare class ConfigLoader {
|
|
3
|
+
private static readonly CONFIG_FILES;
|
|
4
|
+
/**
|
|
5
|
+
* Load configuration from the nearest vibe-guard.json file
|
|
6
|
+
*/
|
|
7
|
+
static loadConfig(projectPath: string): VibeGuardConfig;
|
|
8
|
+
/**
|
|
9
|
+
* Find the nearest configuration file in the project hierarchy
|
|
10
|
+
*/
|
|
11
|
+
static findConfigFile(projectPath: string): string | null;
|
|
12
|
+
/**
|
|
13
|
+
* Validate and normalize configuration
|
|
14
|
+
*/
|
|
15
|
+
private static validateConfig;
|
|
16
|
+
/**
|
|
17
|
+
* Merge configuration with CLI options (CLI takes precedence)
|
|
18
|
+
*/
|
|
19
|
+
static mergeConfig(config: VibeGuardConfig, cliOptions: Partial<ScanOptions>): ScanOptions;
|
|
20
|
+
/**
|
|
21
|
+
* Create a default configuration file
|
|
22
|
+
*/
|
|
23
|
+
static createDefaultConfig(): VibeGuardConfig;
|
|
24
|
+
/**
|
|
25
|
+
* Generate a sample configuration file content
|
|
26
|
+
*/
|
|
27
|
+
static generateSampleConfig(): string;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAiB,MAAM,SAAS,CAAC;AAEtE,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAIlC;IAEF;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe;IAkBvD;;OAEG;IACH,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI;IAgBzD;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAgE7B;;OAEG;IACH,MAAM,CAAC,WAAW,CAAC,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW;IAU1F;;OAEG;IACH,MAAM,CAAC,mBAAmB,IAAI,eAAe;IAoB7C;;OAEG;IACH,MAAM,CAAC,oBAAoB,IAAI,MAAM;CAwCtC"}
|