hackmyagent 0.1.0
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/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +447 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;GAGG"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* HackMyAgent CLI
|
|
5
|
+
* Security scanning tool for AI agents
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const commander_1 = require("commander");
|
|
9
|
+
const hackmyagent_core_1 = require("hackmyagent-core");
|
|
10
|
+
const program = new commander_1.Command();
|
|
11
|
+
// Check for NO_COLOR env or non-TTY to disable colors by default
|
|
12
|
+
const noColorEnv = process.env.NO_COLOR !== undefined || process.stdout.isTTY === false;
|
|
13
|
+
// Color codes - will be cleared if --no-color is passed
|
|
14
|
+
let colors = {
|
|
15
|
+
green: '\x1b[32m',
|
|
16
|
+
yellow: '\x1b[33m',
|
|
17
|
+
red: '\x1b[31m',
|
|
18
|
+
brightRed: '\x1b[91m',
|
|
19
|
+
cyan: '\x1b[36m',
|
|
20
|
+
reset: '\x1b[0m',
|
|
21
|
+
};
|
|
22
|
+
if (noColorEnv) {
|
|
23
|
+
colors = { green: '', yellow: '', red: '', brightRed: '', cyan: '', reset: '' };
|
|
24
|
+
}
|
|
25
|
+
program
|
|
26
|
+
.name('hackmyagent')
|
|
27
|
+
.description(`Security toolkit for AI agents
|
|
28
|
+
|
|
29
|
+
HackMyAgent helps you secure AI agent deployments with 100+ security checks
|
|
30
|
+
across credential exposure, MCP configurations, prompt injection defenses,
|
|
31
|
+
and infrastructure hardening.
|
|
32
|
+
|
|
33
|
+
Documentation: https://github.com/ecolibria/hackmyagent
|
|
34
|
+
|
|
35
|
+
Examples:
|
|
36
|
+
$ hackmyagent check @anthropic/claude-mcp Verify skill before installing
|
|
37
|
+
$ hackmyagent secure Scan current directory
|
|
38
|
+
$ hackmyagent secure --fix Auto-fix security issues
|
|
39
|
+
$ hackmyagent secure --fix --dry-run Preview fixes without applying
|
|
40
|
+
$ hackmyagent scan example.com Scan external infrastructure`)
|
|
41
|
+
.version(hackmyagent_core_1.VERSION, '-V, --version', 'Output the version number')
|
|
42
|
+
.option('--no-color', 'Disable colored output (also respects NO_COLOR env)')
|
|
43
|
+
.hook('preAction', (thisCommand) => {
|
|
44
|
+
const opts = thisCommand.opts();
|
|
45
|
+
if (opts.color === false) {
|
|
46
|
+
colors = { green: '', yellow: '', red: '', brightRed: '', cyan: '', reset: '' };
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
// Risk level colors and symbols
|
|
50
|
+
const RISK_DISPLAY = {
|
|
51
|
+
low: { symbol: 'ā
', color: () => colors.green },
|
|
52
|
+
medium: { symbol: 'ā ļø', color: () => colors.yellow },
|
|
53
|
+
high: { symbol: 'š“', color: () => colors.red },
|
|
54
|
+
critical: { symbol: 'šØ', color: () => colors.brightRed },
|
|
55
|
+
};
|
|
56
|
+
const RESET = () => colors.reset;
|
|
57
|
+
program
|
|
58
|
+
.command('check')
|
|
59
|
+
.description(`Verify a skill before installing
|
|
60
|
+
|
|
61
|
+
Analyzes skill safety by checking:
|
|
62
|
+
⢠Publisher identity via DNS TXT records
|
|
63
|
+
⢠Permissions requested (filesystem, network, shell)
|
|
64
|
+
⢠Revocation status against global blocklist
|
|
65
|
+
|
|
66
|
+
Risk levels: low, medium, high, critical
|
|
67
|
+
Exit code 1 if high/critical risk detected.
|
|
68
|
+
|
|
69
|
+
Examples:
|
|
70
|
+
$ hackmyagent check @anthropic/claude-mcp
|
|
71
|
+
$ hackmyagent check @publisher/skill --verbose
|
|
72
|
+
$ hackmyagent check @publisher/skill --json`)
|
|
73
|
+
.argument('<skill>', 'Skill identifier (e.g., @publisher/skill)')
|
|
74
|
+
.option('-v, --verbose', 'Show detailed verification info')
|
|
75
|
+
.option('--json', 'Output as JSON (for scripting/CI)')
|
|
76
|
+
.option('--offline', 'Skip DNS verification (offline mode)')
|
|
77
|
+
.action(async (skill, options) => {
|
|
78
|
+
try {
|
|
79
|
+
const result = await (0, hackmyagent_core_1.checkSkill)(skill, {
|
|
80
|
+
skipDnsVerification: options.offline,
|
|
81
|
+
});
|
|
82
|
+
if (options.json) {
|
|
83
|
+
console.log(JSON.stringify(result, null, 2));
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const risk = RISK_DISPLAY[result.risk];
|
|
87
|
+
console.log(`\n${risk.color()}${risk.symbol} ${result.risk.toUpperCase()} RISK${RESET()}\n`);
|
|
88
|
+
// Publisher info
|
|
89
|
+
console.log(`Publisher: @${result.publisher.name}`);
|
|
90
|
+
if (result.publisher.verified) {
|
|
91
|
+
console.log(`āā ā
Verified via DNS`);
|
|
92
|
+
if (result.publisher.domain) {
|
|
93
|
+
console.log(`āā š Domain: ${result.publisher.domain}`);
|
|
94
|
+
}
|
|
95
|
+
if (result.publisher.verifiedAt && options.verbose) {
|
|
96
|
+
console.log(`āā š
Verified at: ${result.publisher.verifiedAt.toISOString()}`);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
console.log(`āā Method: DNS TXT record`);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
console.log(`āā ā Not verified`);
|
|
104
|
+
if (result.publisher.failureReason && options.verbose) {
|
|
105
|
+
console.log(`āā Reason: ${result.publisher.failureReason}`);
|
|
106
|
+
}
|
|
107
|
+
else if (options.offline) {
|
|
108
|
+
console.log(`āā (DNS verification skipped - offline mode)`);
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
console.log(`āā No valid DNS TXT record found`);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
console.log();
|
|
115
|
+
// Permissions
|
|
116
|
+
console.log('Permissions:');
|
|
117
|
+
if (result.permissions.requested.length === 0) {
|
|
118
|
+
console.log('āā None declared');
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
for (const perm of result.permissions.safe) {
|
|
122
|
+
console.log(`āā ā
${perm}`);
|
|
123
|
+
}
|
|
124
|
+
for (const perm of result.permissions.reviewNeeded) {
|
|
125
|
+
console.log(`āā ā ļø ${perm} (review needed)`);
|
|
126
|
+
}
|
|
127
|
+
for (const perm of result.permissions.dangerous) {
|
|
128
|
+
console.log(`āā ā ${perm} (DANGEROUS)`);
|
|
129
|
+
}
|
|
130
|
+
console.log(`āā Risk score: ${result.permissions.riskScore}/100`);
|
|
131
|
+
}
|
|
132
|
+
console.log();
|
|
133
|
+
// Revocation
|
|
134
|
+
console.log('Revocation:');
|
|
135
|
+
if (result.revocation.revoked) {
|
|
136
|
+
console.log(`āā šØ REVOKED: ${result.revocation.reason}`);
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
console.log(`āā ā
Not on blocklist`);
|
|
140
|
+
}
|
|
141
|
+
console.log();
|
|
142
|
+
// Verbose details
|
|
143
|
+
if (options.verbose) {
|
|
144
|
+
console.log('Details:');
|
|
145
|
+
console.log(`āā Checked at: ${result.revocation.checkedAt.toISOString()}`);
|
|
146
|
+
}
|
|
147
|
+
// Exit with non-zero for high/critical risk
|
|
148
|
+
if (result.risk === 'critical' || result.risk === 'high') {
|
|
149
|
+
process.exit(1);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
console.error(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
154
|
+
process.exit(1);
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
// Severity colors and symbols for secure command
|
|
158
|
+
const SEVERITY_DISPLAY = {
|
|
159
|
+
critical: { symbol: 'š“', color: () => colors.brightRed },
|
|
160
|
+
high: { symbol: 'š ', color: () => colors.red },
|
|
161
|
+
medium: { symbol: 'š”', color: () => colors.yellow },
|
|
162
|
+
low: { symbol: 'š¢', color: () => colors.green },
|
|
163
|
+
};
|
|
164
|
+
function groupFindingsBySeverity(findings) {
|
|
165
|
+
const grouped = {
|
|
166
|
+
critical: [],
|
|
167
|
+
high: [],
|
|
168
|
+
medium: [],
|
|
169
|
+
low: [],
|
|
170
|
+
};
|
|
171
|
+
for (const finding of findings) {
|
|
172
|
+
grouped[finding.severity].push(finding);
|
|
173
|
+
}
|
|
174
|
+
return grouped;
|
|
175
|
+
}
|
|
176
|
+
program
|
|
177
|
+
.command('secure')
|
|
178
|
+
.description(`Scan and harden your agent setup
|
|
179
|
+
|
|
180
|
+
Performs 100 security checks across 24 categories:
|
|
181
|
+
⢠Credentials: API key exposure, secrets in configs
|
|
182
|
+
⢠MCP: Server configs, tool permissions, secrets
|
|
183
|
+
⢠Network: TLS, interface bindings, CORS
|
|
184
|
+
⢠Prompt: Injection defenses, role protection
|
|
185
|
+
⢠Encryption: At-rest encryption, secure hashing
|
|
186
|
+
⢠And 19 more categories...
|
|
187
|
+
|
|
188
|
+
Severities: critical, high, medium, low
|
|
189
|
+
Exit code 1 if critical/high issues found.
|
|
190
|
+
|
|
191
|
+
Examples:
|
|
192
|
+
$ hackmyagent secure Scan current directory
|
|
193
|
+
$ hackmyagent secure ./my-project Scan specific directory
|
|
194
|
+
$ hackmyagent secure --fix Auto-fix issues
|
|
195
|
+
$ hackmyagent secure --fix --dry-run Preview fixes
|
|
196
|
+
$ hackmyagent secure --ignore CRED-001 Skip specific checks
|
|
197
|
+
$ hackmyagent secure --json JSON output for CI`)
|
|
198
|
+
.argument('[directory]', 'Directory to scan (defaults to current directory)', '.')
|
|
199
|
+
.option('--fix', 'Automatically fix issues where possible')
|
|
200
|
+
.option('--dry-run', 'Preview fixes without applying them (use with --fix)')
|
|
201
|
+
.option('--ignore <checks>', 'Comma-separated check IDs to skip (e.g., CRED-001,GIT-002)')
|
|
202
|
+
.option('--json', 'Output as JSON (for scripting/CI)')
|
|
203
|
+
.option('-v, --verbose', 'Show all checks including passed ones')
|
|
204
|
+
.action(async (directory, options) => {
|
|
205
|
+
try {
|
|
206
|
+
const targetDir = directory.startsWith('/') ? directory : process.cwd() + '/' + directory;
|
|
207
|
+
// Parse ignore list
|
|
208
|
+
const ignoreList = options.ignore
|
|
209
|
+
? options.ignore.split(',').map((s) => s.trim()).filter(Boolean)
|
|
210
|
+
: [];
|
|
211
|
+
if (options.dryRun) {
|
|
212
|
+
console.log(`\nš Scanning ${targetDir} (dry-run)...\n`);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
console.log(`\nš Scanning ${targetDir}...\n`);
|
|
216
|
+
}
|
|
217
|
+
const scanner = new hackmyagent_core_1.HardeningScanner();
|
|
218
|
+
const result = await scanner.scan({
|
|
219
|
+
targetDir,
|
|
220
|
+
autoFix: options.fix ?? false,
|
|
221
|
+
dryRun: options.dryRun ?? false,
|
|
222
|
+
ignore: ignoreList,
|
|
223
|
+
});
|
|
224
|
+
if (options.json) {
|
|
225
|
+
console.log(JSON.stringify(result, null, 2));
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
// Group findings by severity
|
|
229
|
+
const failedFindings = result.findings.filter((f) => !f.passed && !f.fixed && !f.wouldFix);
|
|
230
|
+
const fixedFindings = result.findings.filter((f) => f.fixed);
|
|
231
|
+
const wouldFixFindings = result.findings.filter((f) => f.wouldFix);
|
|
232
|
+
const passedFindings = result.findings.filter((f) => f.passed);
|
|
233
|
+
const grouped = groupFindingsBySeverity(failedFindings);
|
|
234
|
+
// Print header
|
|
235
|
+
console.log(`Platform: ${result.platform}`);
|
|
236
|
+
console.log(`Security Score: ${result.score}/${result.maxScore}\n`);
|
|
237
|
+
// Print failed findings by severity
|
|
238
|
+
let hasIssues = false;
|
|
239
|
+
for (const severity of ['critical', 'high', 'medium', 'low']) {
|
|
240
|
+
const findings = grouped[severity];
|
|
241
|
+
if (findings.length === 0)
|
|
242
|
+
continue;
|
|
243
|
+
hasIssues = true;
|
|
244
|
+
const display = SEVERITY_DISPLAY[severity];
|
|
245
|
+
console.log(`${display.color()}${display.symbol} ${severity.toUpperCase()} (${findings.length})${RESET()}`);
|
|
246
|
+
for (const finding of findings) {
|
|
247
|
+
console.log(` ⢠[${finding.checkId}] ${finding.name}`);
|
|
248
|
+
console.log(` ${finding.message}`);
|
|
249
|
+
if (finding.fixable && !options.fix) {
|
|
250
|
+
console.log(` š” Auto-fixable with --fix`);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
console.log();
|
|
254
|
+
}
|
|
255
|
+
// Print fixed findings
|
|
256
|
+
if (fixedFindings.length > 0) {
|
|
257
|
+
console.log(`${colors.green}ā
FIXED (${fixedFindings.length})${RESET()}`);
|
|
258
|
+
for (const finding of fixedFindings) {
|
|
259
|
+
console.log(` ⢠[${finding.checkId}] ${finding.name}`);
|
|
260
|
+
if (finding.fixMessage) {
|
|
261
|
+
console.log(` ${finding.fixMessage}`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
console.log();
|
|
265
|
+
// Show backup info
|
|
266
|
+
if (result.backupPath) {
|
|
267
|
+
console.log(`š¦ Backup created: ${result.backupPath}`);
|
|
268
|
+
console.log(` Run 'hackmyagent rollback ${directory}' to undo changes\n`);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
// Print would-fix findings (dry-run mode)
|
|
272
|
+
if (wouldFixFindings.length > 0) {
|
|
273
|
+
console.log(`${colors.cyan}š® WOULD FIX (${wouldFixFindings.length})${RESET()}`);
|
|
274
|
+
for (const finding of wouldFixFindings) {
|
|
275
|
+
console.log(` ⢠[${finding.checkId}] ${finding.name}`);
|
|
276
|
+
console.log(` ${finding.message}`);
|
|
277
|
+
}
|
|
278
|
+
console.log();
|
|
279
|
+
console.log(`š” Run with --fix (without --dry-run) to apply these fixes\n`);
|
|
280
|
+
}
|
|
281
|
+
// Print passed findings in verbose mode
|
|
282
|
+
if (options.verbose && passedFindings.length > 0) {
|
|
283
|
+
console.log(`${colors.green}ā
PASSED (${passedFindings.length})${RESET()}`);
|
|
284
|
+
for (const finding of passedFindings) {
|
|
285
|
+
console.log(` ⢠[${finding.checkId}] ${finding.name}`);
|
|
286
|
+
}
|
|
287
|
+
console.log();
|
|
288
|
+
}
|
|
289
|
+
// Show ignored checks
|
|
290
|
+
if (result.ignored && result.ignored.length > 0) {
|
|
291
|
+
console.log(`š« Ignored: ${result.ignored.join(', ')}\n`);
|
|
292
|
+
}
|
|
293
|
+
// Summary
|
|
294
|
+
if (!hasIssues && fixedFindings.length === 0 && wouldFixFindings.length === 0) {
|
|
295
|
+
console.log(`${colors.green}ā
No security issues found!${RESET()}\n`);
|
|
296
|
+
}
|
|
297
|
+
else if (hasIssues && !options.fix) {
|
|
298
|
+
const fixableCount = failedFindings.filter((f) => f.fixable).length;
|
|
299
|
+
if (fixableCount > 0) {
|
|
300
|
+
console.log(`š” Run with --fix to automatically fix ${fixableCount} issue(s)\n`);
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
// Exit with non-zero if critical/high issues remain
|
|
304
|
+
const criticalOrHigh = failedFindings.filter((f) => f.severity === 'critical' || f.severity === 'high');
|
|
305
|
+
if (criticalOrHigh.length > 0) {
|
|
306
|
+
process.exit(1);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
console.error(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
311
|
+
process.exit(1);
|
|
312
|
+
}
|
|
313
|
+
});
|
|
314
|
+
// Severity display for external scan findings
|
|
315
|
+
const FINDING_SEVERITY_DISPLAY = {
|
|
316
|
+
critical: { symbol: 'š“', color: () => colors.brightRed },
|
|
317
|
+
high: { symbol: 'š ', color: () => colors.red },
|
|
318
|
+
medium: { symbol: 'š”', color: () => colors.yellow },
|
|
319
|
+
low: { symbol: 'š¢', color: () => colors.green },
|
|
320
|
+
};
|
|
321
|
+
function groupExternalFindingsBySeverity(findings) {
|
|
322
|
+
const grouped = {
|
|
323
|
+
critical: [],
|
|
324
|
+
high: [],
|
|
325
|
+
medium: [],
|
|
326
|
+
low: [],
|
|
327
|
+
};
|
|
328
|
+
for (const finding of findings) {
|
|
329
|
+
grouped[finding.severity].push(finding);
|
|
330
|
+
}
|
|
331
|
+
return grouped;
|
|
332
|
+
}
|
|
333
|
+
program
|
|
334
|
+
.command('scan')
|
|
335
|
+
.description(`Scan external target for exposed MCP endpoints
|
|
336
|
+
|
|
337
|
+
Detects externally exposed:
|
|
338
|
+
⢠MCP SSE/tools endpoints
|
|
339
|
+
⢠Configuration files (mcp.json, settings)
|
|
340
|
+
⢠API keys in responses
|
|
341
|
+
⢠Debug/admin interfaces
|
|
342
|
+
|
|
343
|
+
Scoring: A (90-100), B (80-89), C (70-79), D (60-69), F (<60)
|
|
344
|
+
Exit code 1 if critical/high issues found.
|
|
345
|
+
|
|
346
|
+
Examples:
|
|
347
|
+
$ hackmyagent scan example.com
|
|
348
|
+
$ hackmyagent scan 192.168.1.100 -p 3000,8080
|
|
349
|
+
$ hackmyagent scan example.com --verbose
|
|
350
|
+
$ hackmyagent scan example.com --json`)
|
|
351
|
+
.argument('<target>', 'Target hostname or IP address')
|
|
352
|
+
.option('--json', 'Output as JSON (for scripting/CI)')
|
|
353
|
+
.option('-p, --ports <ports>', 'Comma-separated ports to scan (default: common MCP ports)')
|
|
354
|
+
.option('-t, --timeout <ms>', 'Connection timeout in milliseconds', '5000')
|
|
355
|
+
.option('-v, --verbose', 'Show detailed finding information')
|
|
356
|
+
.action(async (target, options) => {
|
|
357
|
+
try {
|
|
358
|
+
console.log(`\nš Scanning ${target}...\n`);
|
|
359
|
+
const scanner = new hackmyagent_core_1.ExternalScanner();
|
|
360
|
+
const customPorts = options.ports
|
|
361
|
+
? options.ports.split(',').map((p) => parseInt(p.trim(), 10))
|
|
362
|
+
: undefined;
|
|
363
|
+
const result = await scanner.scan(target, {
|
|
364
|
+
ports: customPorts,
|
|
365
|
+
timeout: parseInt(options.timeout ?? '5000', 10),
|
|
366
|
+
});
|
|
367
|
+
if (options.json) {
|
|
368
|
+
console.log(JSON.stringify(result, null, 2));
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
// Print header
|
|
372
|
+
const gradeColor = result.grade === 'A'
|
|
373
|
+
? colors.green
|
|
374
|
+
: result.grade === 'B'
|
|
375
|
+
? colors.green
|
|
376
|
+
: result.grade === 'C'
|
|
377
|
+
? colors.yellow
|
|
378
|
+
: colors.red;
|
|
379
|
+
console.log(`Target: ${result.target}`);
|
|
380
|
+
console.log(`Score: ${gradeColor}${result.score}/100 (${result.grade})${RESET()}`);
|
|
381
|
+
console.log(`Open Ports: ${result.openPorts.length > 0 ? result.openPorts.join(', ') : 'None detected'}`);
|
|
382
|
+
console.log(`Duration: ${result.duration}ms\n`);
|
|
383
|
+
if (result.findings.length === 0) {
|
|
384
|
+
console.log(`${colors.green}ā
No security issues found!${RESET()}\n`);
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
// Group findings by severity
|
|
388
|
+
const grouped = groupExternalFindingsBySeverity(result.findings);
|
|
389
|
+
// Print findings by severity
|
|
390
|
+
for (const severity of ['critical', 'high', 'medium', 'low']) {
|
|
391
|
+
const findings = grouped[severity];
|
|
392
|
+
if (findings.length === 0)
|
|
393
|
+
continue;
|
|
394
|
+
const display = FINDING_SEVERITY_DISPLAY[severity];
|
|
395
|
+
console.log(`${display.color()}${display.symbol} ${severity.toUpperCase()} (${findings.length})${RESET()}`);
|
|
396
|
+
for (const finding of findings) {
|
|
397
|
+
console.log(` ⢠[${finding.checkId}] ${finding.title}`);
|
|
398
|
+
if (finding.port) {
|
|
399
|
+
console.log(` Port: ${finding.port}${finding.path ? `, Path: ${finding.path}` : ''}`);
|
|
400
|
+
}
|
|
401
|
+
if (options.verbose) {
|
|
402
|
+
console.log(` ${finding.description}`);
|
|
403
|
+
console.log(` Evidence: ${finding.evidence}`);
|
|
404
|
+
console.log(` Impact: ${finding.impact}`);
|
|
405
|
+
console.log(` Fix: ${finding.fix}`);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
console.log();
|
|
409
|
+
}
|
|
410
|
+
// Exit with non-zero if critical/high issues found
|
|
411
|
+
const criticalOrHigh = result.findings.filter((f) => f.severity === 'critical' || f.severity === 'high');
|
|
412
|
+
if (criticalOrHigh.length > 0) {
|
|
413
|
+
process.exit(1);
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
catch (error) {
|
|
417
|
+
console.error(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
418
|
+
process.exit(1);
|
|
419
|
+
}
|
|
420
|
+
});
|
|
421
|
+
program
|
|
422
|
+
.command('rollback')
|
|
423
|
+
.description(`Rollback auto-fix changes to the most recent backup
|
|
424
|
+
|
|
425
|
+
Restores files to their state before the last --fix operation.
|
|
426
|
+
Backups are stored in .hackmyagent-backup/ with timestamps.
|
|
427
|
+
|
|
428
|
+
Examples:
|
|
429
|
+
$ hackmyagent rollback Rollback current directory
|
|
430
|
+
$ hackmyagent rollback ./my-project Rollback specific directory`)
|
|
431
|
+
.argument('[directory]', 'Directory to rollback (defaults to current directory)', '.')
|
|
432
|
+
.action(async (directory) => {
|
|
433
|
+
try {
|
|
434
|
+
const targetDir = directory.startsWith('/') ? directory : process.cwd() + '/' + directory;
|
|
435
|
+
console.log(`\nš Rolling back changes in ${targetDir}...\n`);
|
|
436
|
+
const scanner = new hackmyagent_core_1.HardeningScanner();
|
|
437
|
+
await scanner.rollback(targetDir);
|
|
438
|
+
console.log(`${colors.green}ā
Rollback successful!${RESET()}`);
|
|
439
|
+
console.log(' All auto-fix changes have been reverted.\n');
|
|
440
|
+
}
|
|
441
|
+
catch (error) {
|
|
442
|
+
console.error(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
443
|
+
process.exit(1);
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
program.parse();
|
|
447
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA;;;GAGG;;AAEH,yCAAoC;AACpC,uDAU0B;AAE1B,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,iEAAiE;AACjE,MAAM,UAAU,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,KAAK,KAAK,KAAK,CAAC;AAExF,wDAAwD;AACxD,IAAI,MAAM,GAAG;IACX,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,UAAU;IAClB,GAAG,EAAE,UAAU;IACf,SAAS,EAAE,UAAU;IACrB,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,IAAI,UAAU,EAAE,CAAC;IACf,MAAM,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAClF,CAAC;AAED,OAAO;KACJ,IAAI,CAAC,aAAa,CAAC;KACnB,WAAW,CAAC;;;;;;;;;;;;;4EAa6D,CAAC;KAC1E,OAAO,CAAC,0BAAO,EAAE,eAAe,EAAE,2BAA2B,CAAC;KAC9D,MAAM,CAAC,YAAY,EAAE,qDAAqD,CAAC;KAC3E,IAAI,CAAC,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE;IACjC,MAAM,IAAI,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC;IAChC,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK,EAAE,CAAC;QACzB,MAAM,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,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 -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "hackmyagent",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Security toolkit for AI agents - verify skills, harden setups, scan for exposures",
|
|
5
|
+
"bin": {
|
|
6
|
+
"hackmyagent": "dist/index.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "tsc",
|
|
14
|
+
"test": "echo 'No CLI tests yet'",
|
|
15
|
+
"lint": "eslint src --ext .ts"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"commander": "^12.0.0",
|
|
19
|
+
"hackmyagent-core": "^0.1.0"
|
|
20
|
+
},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"typescript": "^5.3.3"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"ai",
|
|
26
|
+
"agent",
|
|
27
|
+
"security",
|
|
28
|
+
"mcp",
|
|
29
|
+
"claude",
|
|
30
|
+
"cursor",
|
|
31
|
+
"skills",
|
|
32
|
+
"hardening",
|
|
33
|
+
"scanner"
|
|
34
|
+
],
|
|
35
|
+
"author": "OpenA2A",
|
|
36
|
+
"license": "Apache-2.0",
|
|
37
|
+
"repository": {
|
|
38
|
+
"type": "git",
|
|
39
|
+
"url": "https://github.com/opena2a-org/hackmyagent.git"
|
|
40
|
+
},
|
|
41
|
+
"homepage": "https://github.com/opena2a-org/hackmyagent#readme",
|
|
42
|
+
"bugs": {
|
|
43
|
+
"url": "https://github.com/opena2a-org/hackmyagent/issues"
|
|
44
|
+
},
|
|
45
|
+
"engines": {
|
|
46
|
+
"node": ">=18.0.0"
|
|
47
|
+
}
|
|
48
|
+
}
|