@maverick006/vibeguard 1.0.8 → 1.0.10
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/dist/formatter.js +6 -4
- package/dist/index.js +43 -22
- package/package.json +1 -6
- package/src/formatter.ts +6 -4
- package/src/index.ts +45 -23
package/dist/formatter.js
CHANGED
|
@@ -39,6 +39,7 @@ function getGitInfo(cwd = process.cwd()) {
|
|
|
39
39
|
let name = path_1.default.basename(cwd);
|
|
40
40
|
let branch = 'main';
|
|
41
41
|
let commit = '4f2c1ab';
|
|
42
|
+
let remoteUrl = '';
|
|
42
43
|
try {
|
|
43
44
|
const branchOut = (0, child_process_1.execSync)('git rev-parse --abbrev-ref HEAD', { cwd, stdio: ['pipe', 'pipe', 'ignore'] }).toString().trim();
|
|
44
45
|
if (branchOut)
|
|
@@ -52,15 +53,16 @@ function getGitInfo(cwd = process.cwd()) {
|
|
|
52
53
|
}
|
|
53
54
|
catch { }
|
|
54
55
|
try {
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
|
|
56
|
+
const gitRemote = (0, child_process_1.execSync)('git config --get remote.origin.url', { cwd, stdio: ['pipe', 'pipe', 'ignore'] }).toString().trim();
|
|
57
|
+
if (gitRemote) {
|
|
58
|
+
remoteUrl = gitRemote;
|
|
59
|
+
const match = gitRemote.match(/\/([^/]+?)(\.git)?$/);
|
|
58
60
|
if (match && match[1])
|
|
59
61
|
name = match[1];
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
catch { }
|
|
63
|
-
return { name, branch, commit, policy: 'enterprise' };
|
|
65
|
+
return { name, branch, commit, remoteUrl, policy: 'enterprise' };
|
|
64
66
|
}
|
|
65
67
|
function calculateScore(findings) {
|
|
66
68
|
let critical = 0;
|
package/dist/index.js
CHANGED
|
@@ -17,7 +17,7 @@ const program = new commander_1.Command();
|
|
|
17
17
|
program
|
|
18
18
|
.name('vibeguard')
|
|
19
19
|
.description('AI-Powered DevSecOps Orchestrator CLI')
|
|
20
|
-
.version('1.0.
|
|
20
|
+
.version('1.0.10');
|
|
21
21
|
program
|
|
22
22
|
.command('scan [path]')
|
|
23
23
|
.description('Run a security scan on the current directory or target path')
|
|
@@ -39,20 +39,38 @@ program
|
|
|
39
39
|
try {
|
|
40
40
|
// Initialize the security orchestrator and scanners
|
|
41
41
|
const { Orchestrator } = require('@maverick006/security-engine');
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
new TrivyScanner()
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
42
|
+
const scanners = [];
|
|
43
|
+
try {
|
|
44
|
+
const { NpmAuditScanner } = require('@maverick006/scanner-npm-audit');
|
|
45
|
+
scanners.push(new NpmAuditScanner());
|
|
46
|
+
}
|
|
47
|
+
catch (e) { }
|
|
48
|
+
try {
|
|
49
|
+
const { TrivyScanner } = require('@maverick006/scanner-trivy');
|
|
50
|
+
scanners.push(new TrivyScanner());
|
|
51
|
+
}
|
|
52
|
+
catch (e) { }
|
|
53
|
+
try {
|
|
54
|
+
const { SemgrepScanner } = require('@maverick006/scanner-semgrep');
|
|
55
|
+
scanners.push(new SemgrepScanner());
|
|
56
|
+
}
|
|
57
|
+
catch (e) { }
|
|
58
|
+
try {
|
|
59
|
+
const { GitleaksScanner } = require('@maverick006/scanner-gitleaks');
|
|
60
|
+
scanners.push(new GitleaksScanner());
|
|
61
|
+
}
|
|
62
|
+
catch (e) { }
|
|
63
|
+
try {
|
|
64
|
+
const { CheckovScanner } = require('@maverick006/scanner-checkov');
|
|
65
|
+
scanners.push(new CheckovScanner());
|
|
66
|
+
}
|
|
67
|
+
catch (e) { }
|
|
68
|
+
try {
|
|
69
|
+
const { ZapScanner } = require('@maverick006/scanner-zap');
|
|
70
|
+
scanners.push(new ZapScanner());
|
|
71
|
+
}
|
|
72
|
+
catch (e) { }
|
|
73
|
+
const orchestrator = new Orchestrator(scanners);
|
|
56
74
|
const scanResult = await orchestrator.runScan({
|
|
57
75
|
scanId: `scan-${Date.now()}`,
|
|
58
76
|
repositoryUrl: 'local',
|
|
@@ -127,8 +145,10 @@ program
|
|
|
127
145
|
isSilent: options.ci
|
|
128
146
|
}).start();
|
|
129
147
|
try {
|
|
130
|
-
const API_URL = process.env.VIBEGUARD_API_URL || '
|
|
131
|
-
const API_KEY = process.env.VIBEGUARD_API_KEY;
|
|
148
|
+
const API_URL = process.env.VIBEGUARD_API_URL || 'https://vibeguard-eep3.onrender.com';
|
|
149
|
+
const API_KEY = process.env.VIBEGUARD_API_KEY || 'dev-api-key-123';
|
|
150
|
+
const repoName = gitInfo.name || 'Local Project';
|
|
151
|
+
const repoUrl = gitInfo.remoteUrl || gitInfo.name || 'local';
|
|
132
152
|
const response = await fetch(`${API_URL}/api/scans/upload`, {
|
|
133
153
|
method: 'POST',
|
|
134
154
|
headers: {
|
|
@@ -136,22 +156,23 @@ program
|
|
|
136
156
|
'Authorization': `Bearer ${API_KEY}`
|
|
137
157
|
},
|
|
138
158
|
body: JSON.stringify({
|
|
139
|
-
repositoryName:
|
|
140
|
-
repositoryUrl:
|
|
159
|
+
repositoryName: repoName,
|
|
160
|
+
repositoryUrl: repoUrl,
|
|
141
161
|
numericScore: stats.score,
|
|
142
162
|
score: stats.riskLevel,
|
|
143
163
|
findings: findings
|
|
144
164
|
})
|
|
145
165
|
});
|
|
146
166
|
if (response.ok) {
|
|
147
|
-
|
|
167
|
+
const dashboardUrl = `https://vibeguard-web-eight.vercel.app/dashboard?repo=${encodeURIComponent(repoName)}`;
|
|
168
|
+
syncSpinner.succeed(chalk_1.default.green(`Results synced to dashboard: ${chalk_1.default.cyan.underline(dashboardUrl)}`));
|
|
148
169
|
}
|
|
149
170
|
else {
|
|
150
|
-
syncSpinner.fail(chalk_1.default.
|
|
171
|
+
syncSpinner.fail(chalk_1.default.red(`Failed to sync results to dashboard (${response.status} ${response.statusText}).`));
|
|
151
172
|
}
|
|
152
173
|
}
|
|
153
174
|
catch (e) {
|
|
154
|
-
syncSpinner.warn(chalk_1.default.
|
|
175
|
+
syncSpinner.warn(chalk_1.default.yellow('Dashboard API unreachable. Skipping sync.'));
|
|
155
176
|
}
|
|
156
177
|
// Exit codes
|
|
157
178
|
if (hasSystemError) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maverick006/vibeguard",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.10",
|
|
4
4
|
"description": "VibeGuard CLI",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -15,11 +15,6 @@
|
|
|
15
15
|
"@maverick006/ai-engine": "*",
|
|
16
16
|
"@maverick006/security-engine": "*",
|
|
17
17
|
"@maverick006/scanner-npm-audit": "*",
|
|
18
|
-
"@maverick006/scanner-trivy": "*",
|
|
19
|
-
"@maverick006/scanner-semgrep": "*",
|
|
20
|
-
"@maverick006/scanner-gitleaks": "*",
|
|
21
|
-
"@maverick006/scanner-checkov": "*",
|
|
22
|
-
"@maverick006/scanner-zap": "*",
|
|
23
18
|
"@maverick006/types": "*",
|
|
24
19
|
"chalk": "^4.1.2",
|
|
25
20
|
"commander": "^11.1.0",
|
package/src/formatter.ts
CHANGED
|
@@ -43,6 +43,7 @@ export function getGitInfo(cwd: string = process.cwd()) {
|
|
|
43
43
|
let name = path.basename(cwd);
|
|
44
44
|
let branch = 'main';
|
|
45
45
|
let commit = '4f2c1ab';
|
|
46
|
+
let remoteUrl = '';
|
|
46
47
|
|
|
47
48
|
try {
|
|
48
49
|
const branchOut = execSync('git rev-parse --abbrev-ref HEAD', { cwd, stdio: ['pipe', 'pipe', 'ignore'] }).toString().trim();
|
|
@@ -55,14 +56,15 @@ export function getGitInfo(cwd: string = process.cwd()) {
|
|
|
55
56
|
} catch {}
|
|
56
57
|
|
|
57
58
|
try {
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
|
|
59
|
+
const gitRemote = execSync('git config --get remote.origin.url', { cwd, stdio: ['pipe', 'pipe', 'ignore'] }).toString().trim();
|
|
60
|
+
if (gitRemote) {
|
|
61
|
+
remoteUrl = gitRemote;
|
|
62
|
+
const match = gitRemote.match(/\/([^/]+?)(\.git)?$/);
|
|
61
63
|
if (match && match[1]) name = match[1];
|
|
62
64
|
}
|
|
63
65
|
} catch {}
|
|
64
66
|
|
|
65
|
-
return { name, branch, commit, policy: 'enterprise' };
|
|
67
|
+
return { name, branch, commit, remoteUrl, policy: 'enterprise' };
|
|
66
68
|
}
|
|
67
69
|
|
|
68
70
|
export function calculateScore(findings: NormalizedFinding[]): ScanStats {
|
package/src/index.ts
CHANGED
|
@@ -14,7 +14,7 @@ const program = new Command();
|
|
|
14
14
|
program
|
|
15
15
|
.name('vibeguard')
|
|
16
16
|
.description('AI-Powered DevSecOps Orchestrator CLI')
|
|
17
|
-
.version('1.0.
|
|
17
|
+
.version('1.0.10');
|
|
18
18
|
|
|
19
19
|
program
|
|
20
20
|
.command('scan [path]')
|
|
@@ -40,21 +40,39 @@ program
|
|
|
40
40
|
try {
|
|
41
41
|
// Initialize the security orchestrator and scanners
|
|
42
42
|
const { Orchestrator } = require('@maverick006/security-engine');
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
new TrivyScanner()
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
const scanners: any[] = [];
|
|
44
|
+
|
|
45
|
+
try {
|
|
46
|
+
const { NpmAuditScanner } = require('@maverick006/scanner-npm-audit');
|
|
47
|
+
scanners.push(new NpmAuditScanner());
|
|
48
|
+
} catch (e) {}
|
|
49
|
+
|
|
50
|
+
try {
|
|
51
|
+
const { TrivyScanner } = require('@maverick006/scanner-trivy');
|
|
52
|
+
scanners.push(new TrivyScanner());
|
|
53
|
+
} catch (e) {}
|
|
54
|
+
|
|
55
|
+
try {
|
|
56
|
+
const { SemgrepScanner } = require('@maverick006/scanner-semgrep');
|
|
57
|
+
scanners.push(new SemgrepScanner());
|
|
58
|
+
} catch (e) {}
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
const { GitleaksScanner } = require('@maverick006/scanner-gitleaks');
|
|
62
|
+
scanners.push(new GitleaksScanner());
|
|
63
|
+
} catch (e) {}
|
|
64
|
+
|
|
65
|
+
try {
|
|
66
|
+
const { CheckovScanner } = require('@maverick006/scanner-checkov');
|
|
67
|
+
scanners.push(new CheckovScanner());
|
|
68
|
+
} catch (e) {}
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
const { ZapScanner } = require('@maverick006/scanner-zap');
|
|
72
|
+
scanners.push(new ZapScanner());
|
|
73
|
+
} catch (e) {}
|
|
74
|
+
|
|
75
|
+
const orchestrator = new Orchestrator(scanners);
|
|
58
76
|
|
|
59
77
|
const scanResult = await orchestrator.runScan({
|
|
60
78
|
scanId: `scan-${Date.now()}`,
|
|
@@ -139,8 +157,11 @@ program
|
|
|
139
157
|
}).start();
|
|
140
158
|
|
|
141
159
|
try {
|
|
142
|
-
const API_URL = process.env.VIBEGUARD_API_URL || '
|
|
143
|
-
const API_KEY = process.env.VIBEGUARD_API_KEY;
|
|
160
|
+
const API_URL = process.env.VIBEGUARD_API_URL || 'https://vibeguard-eep3.onrender.com';
|
|
161
|
+
const API_KEY = process.env.VIBEGUARD_API_KEY || 'dev-api-key-123';
|
|
162
|
+
const repoName = gitInfo.name || 'Local Project';
|
|
163
|
+
const repoUrl = (gitInfo as any).remoteUrl || gitInfo.name || 'local';
|
|
164
|
+
|
|
144
165
|
const response = await fetch(`${API_URL}/api/scans/upload`, {
|
|
145
166
|
method: 'POST',
|
|
146
167
|
headers: {
|
|
@@ -148,8 +169,8 @@ program
|
|
|
148
169
|
'Authorization': `Bearer ${API_KEY}`
|
|
149
170
|
},
|
|
150
171
|
body: JSON.stringify({
|
|
151
|
-
repositoryName:
|
|
152
|
-
repositoryUrl:
|
|
172
|
+
repositoryName: repoName,
|
|
173
|
+
repositoryUrl: repoUrl,
|
|
153
174
|
numericScore: stats.score,
|
|
154
175
|
score: stats.riskLevel,
|
|
155
176
|
findings: findings
|
|
@@ -157,12 +178,13 @@ program
|
|
|
157
178
|
});
|
|
158
179
|
|
|
159
180
|
if (response.ok) {
|
|
160
|
-
|
|
181
|
+
const dashboardUrl = `https://vibeguard-web-eight.vercel.app/dashboard?repo=${encodeURIComponent(repoName)}`;
|
|
182
|
+
syncSpinner.succeed(chalk.green(`Results synced to dashboard: ${chalk.cyan.underline(dashboardUrl)}`));
|
|
161
183
|
} else {
|
|
162
|
-
syncSpinner.fail(chalk.
|
|
184
|
+
syncSpinner.fail(chalk.red(`Failed to sync results to dashboard (${response.status} ${response.statusText}).`));
|
|
163
185
|
}
|
|
164
186
|
} catch (e) {
|
|
165
|
-
syncSpinner.warn(chalk.
|
|
187
|
+
syncSpinner.warn(chalk.yellow('Dashboard API unreachable. Skipping sync.'));
|
|
166
188
|
}
|
|
167
189
|
|
|
168
190
|
// Exit codes
|