vibesafe-scanner 0.1.2
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 +106 -0
- package/bin/vibesafe.js +60 -0
- package/install.js +165 -0
- package/package.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# VibeSafe - Security Scanner for Vibe-Coded Applications
|
|
2
|
+
|
|
3
|
+
VibeSafe is a security scanner designed for AI-generated and vibe-coded applications. It helps identify common security issues in projects built with tools like Claude, ChatGPT, and other AI assistants.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Global Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g vibesafe-scanner
|
|
11
|
+
vibesafe scan
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
### One-Time Usage with npx
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npx vibesafe-scanner scan
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
### Local Project Installation
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install --save-dev vibesafe
|
|
24
|
+
npx vibesafe-scanner scan
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
Scan the current directory:
|
|
30
|
+
```bash
|
|
31
|
+
vibesafe scan
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Scan a specific directory:
|
|
35
|
+
```bash
|
|
36
|
+
vibesafe scan --path ./my-project
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Output as JSON:
|
|
40
|
+
```bash
|
|
41
|
+
vibesafe scan --json
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## What It Checks
|
|
45
|
+
|
|
46
|
+
VibeSafe scans for common security issues in vibe-coded projects:
|
|
47
|
+
|
|
48
|
+
- **Secrets & Credentials**: Hardcoded API keys, passwords, tokens
|
|
49
|
+
- **Authentication Issues**: Missing auth, insecure patterns
|
|
50
|
+
- **Infrastructure Misconfigurations**: Exposed admin panels, debugging enabled
|
|
51
|
+
- **AI Spend Risks**: Unbounded API calls, missing rate limits
|
|
52
|
+
|
|
53
|
+
## Requirements
|
|
54
|
+
|
|
55
|
+
- **No Python required!** The npm package includes a standalone binary.
|
|
56
|
+
- Node.js 14+ (for the npm wrapper only)
|
|
57
|
+
|
|
58
|
+
## Platform Support
|
|
59
|
+
|
|
60
|
+
- ✅ Windows (x64, arm64)
|
|
61
|
+
- ✅ macOS (x64, arm64)
|
|
62
|
+
- ✅ Linux (x64, arm64)
|
|
63
|
+
|
|
64
|
+
## CI/CD Integration
|
|
65
|
+
|
|
66
|
+
### GitHub Actions
|
|
67
|
+
|
|
68
|
+
```yaml
|
|
69
|
+
name: Security Scan
|
|
70
|
+
on: [push, pull_request]
|
|
71
|
+
|
|
72
|
+
jobs:
|
|
73
|
+
vibesafe:
|
|
74
|
+
runs-on: ubuntu-latest
|
|
75
|
+
steps:
|
|
76
|
+
- uses: actions/checkout@v3
|
|
77
|
+
- uses: actions/setup-node@v3
|
|
78
|
+
with:
|
|
79
|
+
node-version: '18'
|
|
80
|
+
- run: npx vibesafe-scanner scan
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### GitLab CI
|
|
84
|
+
|
|
85
|
+
```yaml
|
|
86
|
+
vibesafe:
|
|
87
|
+
stage: test
|
|
88
|
+
image: node:18
|
|
89
|
+
script:
|
|
90
|
+
- npx vibesafe-scanner scan
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Exit Codes
|
|
94
|
+
|
|
95
|
+
- `0`: No security issues found
|
|
96
|
+
- `1`: Security issues detected or scan error
|
|
97
|
+
|
|
98
|
+
## Links
|
|
99
|
+
|
|
100
|
+
- [GitHub Repository](https://github.com/CodAngels/vibesafe)
|
|
101
|
+
- [Report Issues](https://github.com/CodAngels/vibesafe/issues)
|
|
102
|
+
- [Website](https://vibesafe.ai)
|
|
103
|
+
|
|
104
|
+
## License
|
|
105
|
+
|
|
106
|
+
MIT License - see LICENSE file for details.
|
package/bin/vibesafe.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* VibeSafe CLI entry point.
|
|
4
|
+
* Executes the downloaded binary with forwarded arguments.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const { spawn } = require('child_process');
|
|
8
|
+
const path = require('path');
|
|
9
|
+
const fs = require('fs');
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Find the binary path
|
|
13
|
+
*/
|
|
14
|
+
function getBinaryPath() {
|
|
15
|
+
const ext = process.platform === 'win32' ? '.exe' : '';
|
|
16
|
+
const binaryName = `vibesafe${ext}`;
|
|
17
|
+
const binaryPath = path.join(__dirname, binaryName);
|
|
18
|
+
|
|
19
|
+
if (!fs.existsSync(binaryPath)) {
|
|
20
|
+
console.error('❌ VibeSafe binary not found!');
|
|
21
|
+
console.error('');
|
|
22
|
+
console.error('This usually means the installation failed.');
|
|
23
|
+
console.error('Try reinstalling: npm install -g vibesafe');
|
|
24
|
+
console.error('');
|
|
25
|
+
console.error('If the problem persists, report it at:');
|
|
26
|
+
console.error('https://github.com/CodAngels/vibesafe/issues');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return binaryPath;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Execute the binary
|
|
35
|
+
*/
|
|
36
|
+
function runBinary() {
|
|
37
|
+
const binaryPath = getBinaryPath();
|
|
38
|
+
const args = process.argv.slice(2);
|
|
39
|
+
|
|
40
|
+
const child = spawn(binaryPath, args, {
|
|
41
|
+
stdio: 'inherit',
|
|
42
|
+
windowsHide: true,
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
child.on('error', (error) => {
|
|
46
|
+
console.error('❌ Failed to execute VibeSafe:', error.message);
|
|
47
|
+
process.exit(1);
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
child.on('close', (code) => {
|
|
51
|
+
process.exit(code || 0);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
// Handle termination signals
|
|
55
|
+
process.on('SIGINT', () => child.kill('SIGINT'));
|
|
56
|
+
process.on('SIGTERM', () => child.kill('SIGTERM'));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Run the binary
|
|
60
|
+
runBinary();
|
package/install.js
ADDED
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Post-install script for VibeSafe npm package.
|
|
4
|
+
* Downloads the appropriate binary for the user's platform.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const https = require('https');
|
|
8
|
+
const fs = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const { pipeline } = require('stream');
|
|
11
|
+
const { promisify } = require('util');
|
|
12
|
+
|
|
13
|
+
const streamPipeline = promisify(pipeline);
|
|
14
|
+
|
|
15
|
+
// Read version from package.json
|
|
16
|
+
const packageJson = require('./package.json');
|
|
17
|
+
const VERSION = packageJson.version;
|
|
18
|
+
|
|
19
|
+
// GitHub release settings
|
|
20
|
+
const GITHUB_REPO = 'CodAngels/vibesafe';
|
|
21
|
+
const RELEASE_URL_TEMPLATE = `https://github.com/${GITHUB_REPO}/releases/download/v${VERSION}/vibesafe-{PLATFORM}-{ARCH}{EXT}`;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Get platform-specific binary information
|
|
25
|
+
*/
|
|
26
|
+
function getPlatformInfo() {
|
|
27
|
+
const platform = process.platform;
|
|
28
|
+
const arch = process.arch;
|
|
29
|
+
|
|
30
|
+
let platformName, archName, ext;
|
|
31
|
+
|
|
32
|
+
// Map Node.js platform to our naming
|
|
33
|
+
switch (platform) {
|
|
34
|
+
case 'win32':
|
|
35
|
+
platformName = 'windows';
|
|
36
|
+
ext = '.exe';
|
|
37
|
+
break;
|
|
38
|
+
case 'darwin':
|
|
39
|
+
platformName = 'darwin';
|
|
40
|
+
ext = '';
|
|
41
|
+
break;
|
|
42
|
+
case 'linux':
|
|
43
|
+
platformName = 'linux';
|
|
44
|
+
ext = '';
|
|
45
|
+
break;
|
|
46
|
+
default:
|
|
47
|
+
throw new Error(`Unsupported platform: ${platform}`);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
// Map Node.js arch to our naming
|
|
51
|
+
switch (arch) {
|
|
52
|
+
case 'x64':
|
|
53
|
+
// Intel Macs use ARM64 binary via Rosetta 2
|
|
54
|
+
archName = (platform === 'darwin') ? 'arm64' : 'x64';
|
|
55
|
+
break;
|
|
56
|
+
case 'arm64':
|
|
57
|
+
archName = 'arm64';
|
|
58
|
+
break;
|
|
59
|
+
default:
|
|
60
|
+
throw new Error(`Unsupported architecture: ${arch}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
return { platform: platformName, arch: archName, ext };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Download file from URL
|
|
68
|
+
*/
|
|
69
|
+
async function downloadFile(url, destPath) {
|
|
70
|
+
return new Promise((resolve, reject) => {
|
|
71
|
+
console.log(`[DOWNLOAD] Downloading from: ${url}`);
|
|
72
|
+
|
|
73
|
+
https.get(url, (response) => {
|
|
74
|
+
// Handle redirects
|
|
75
|
+
if (response.statusCode === 301 || response.statusCode === 302) {
|
|
76
|
+
const redirectUrl = response.headers.location;
|
|
77
|
+
console.log(`[REDIRECT] Following redirect to: ${redirectUrl}`);
|
|
78
|
+
return downloadFile(redirectUrl, destPath).then(resolve).catch(reject);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
if (response.statusCode !== 200) {
|
|
82
|
+
reject(new Error(`Failed to download: HTTP ${response.statusCode}`));
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const fileStream = fs.createWriteStream(destPath);
|
|
87
|
+
|
|
88
|
+
response.pipe(fileStream);
|
|
89
|
+
|
|
90
|
+
fileStream.on('finish', () => {
|
|
91
|
+
fileStream.close();
|
|
92
|
+
resolve();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
fileStream.on('error', (err) => {
|
|
96
|
+
fs.unlink(destPath, () => {});
|
|
97
|
+
reject(err);
|
|
98
|
+
});
|
|
99
|
+
}).on('error', reject);
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Main installation logic
|
|
105
|
+
*/
|
|
106
|
+
async function install() {
|
|
107
|
+
console.log('[INSTALL] Installing VibeSafe binary...');
|
|
108
|
+
|
|
109
|
+
try {
|
|
110
|
+
// Get platform info
|
|
111
|
+
const { platform, arch, ext } = getPlatformInfo();
|
|
112
|
+
console.log(`[INFO] Platform: ${platform}-${arch}`);
|
|
113
|
+
|
|
114
|
+
// Warn about unsupported platforms
|
|
115
|
+
if (platform === 'linux' && arch === 'arm64') {
|
|
116
|
+
console.warn('[WARNING] Linux ARM64 binaries are not yet available.');
|
|
117
|
+
console.warn(' Please use the Python version: pip install vibesafe-scanner');
|
|
118
|
+
process.exit(1);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
// Construct download URL
|
|
122
|
+
const binaryName = `vibesafe-${platform}-${arch}${ext}`;
|
|
123
|
+
const downloadUrl = RELEASE_URL_TEMPLATE
|
|
124
|
+
.replace('{PLATFORM}', platform)
|
|
125
|
+
.replace('{ARCH}', arch)
|
|
126
|
+
.replace('{EXT}', ext);
|
|
127
|
+
|
|
128
|
+
// Prepare destination
|
|
129
|
+
const binDir = path.join(__dirname, 'bin');
|
|
130
|
+
if (!fs.existsSync(binDir)) {
|
|
131
|
+
fs.mkdirSync(binDir, { recursive: true });
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
const binaryPath = path.join(binDir, `vibesafe${ext}`);
|
|
135
|
+
|
|
136
|
+
// Download binary
|
|
137
|
+
await downloadFile(downloadUrl, binaryPath);
|
|
138
|
+
|
|
139
|
+
// Make executable (Unix-like systems)
|
|
140
|
+
if (ext === '') {
|
|
141
|
+
fs.chmodSync(binaryPath, 0o755);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
console.log(`[SUCCESS] VibeSafe v${VERSION} installed successfully!`);
|
|
145
|
+
console.log(` Binary location: ${binaryPath}`);
|
|
146
|
+
console.log('');
|
|
147
|
+
console.log('Try it out: npx vibesafe scan');
|
|
148
|
+
|
|
149
|
+
} catch (error) {
|
|
150
|
+
console.error('[ERROR] Installation failed:', error.message);
|
|
151
|
+
console.error('');
|
|
152
|
+
console.error('Troubleshooting:');
|
|
153
|
+
console.error(' 1. Check your internet connection');
|
|
154
|
+
console.error(' 2. Verify the release exists: https://github.com/' + GITHUB_REPO + '/releases/tag/v' + VERSION);
|
|
155
|
+
console.error(' 3. Report issues: https://github.com/' + GITHUB_REPO + '/issues');
|
|
156
|
+
process.exit(1);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Run installation
|
|
161
|
+
if (require.main === module) {
|
|
162
|
+
install();
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
module.exports = { install };
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "vibesafe-scanner",
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Security scanner for vibe-coded applications (Node.js wrapper)",
|
|
5
|
+
"bin": {
|
|
6
|
+
"vibesafe": "bin/vibesafe.js"
|
|
7
|
+
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"postinstall": "node install.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [
|
|
12
|
+
"security",
|
|
13
|
+
"scanner",
|
|
14
|
+
"ai",
|
|
15
|
+
"devtools",
|
|
16
|
+
"vibesafe",
|
|
17
|
+
"vibe-check"
|
|
18
|
+
],
|
|
19
|
+
"author": "VibeSafe <hello@vibesafe.ai>",
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/CodAngels/vibesafe.git"
|
|
24
|
+
},
|
|
25
|
+
"homepage": "https://github.com/CodAngels/vibesafe",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/CodAngels/vibesafe/issues"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"bin/",
|
|
31
|
+
"install.js",
|
|
32
|
+
"README.md"
|
|
33
|
+
]
|
|
34
|
+
}
|