devarmor 1.0.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/LICENSE +21 -0
- package/README.md +35 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +140 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/agent-residue.d.ts +11 -0
- package/dist/modules/agent-residue.d.ts.map +1 -0
- package/dist/modules/agent-residue.js +283 -0
- package/dist/modules/agent-residue.js.map +1 -0
- package/dist/modules/mcp-auditor.d.ts +12 -0
- package/dist/modules/mcp-auditor.d.ts.map +1 -0
- package/dist/modules/mcp-auditor.js +290 -0
- package/dist/modules/mcp-auditor.js.map +1 -0
- package/dist/modules/posture-checker.d.ts +11 -0
- package/dist/modules/posture-checker.d.ts.map +1 -0
- package/dist/modules/posture-checker.js +315 -0
- package/dist/modules/posture-checker.js.map +1 -0
- package/dist/modules/secret-scanner.d.ts +11 -0
- package/dist/modules/secret-scanner.d.ts.map +1 -0
- package/dist/modules/secret-scanner.js +321 -0
- package/dist/modules/secret-scanner.js.map +1 -0
- package/dist/modules/skill-scanner.d.ts +12 -0
- package/dist/modules/skill-scanner.d.ts.map +1 -0
- package/dist/modules/skill-scanner.js +294 -0
- package/dist/modules/skill-scanner.js.map +1 -0
- package/dist/report/html.d.ts +6 -0
- package/dist/report/html.d.ts.map +1 -0
- package/dist/report/html.js +116 -0
- package/dist/report/html.js.map +1 -0
- package/dist/report/json.d.ts +9 -0
- package/dist/report/json.d.ts.map +1 -0
- package/dist/report/json.js +69 -0
- package/dist/report/json.js.map +1 -0
- package/dist/report/terminal.d.ts +6 -0
- package/dist/report/terminal.d.ts.map +1 -0
- package/dist/report/terminal.js +162 -0
- package/dist/report/terminal.js.map +1 -0
- package/dist/scanner.d.ts +9 -0
- package/dist/scanner.d.ts.map +1 -0
- package/dist/scanner.js +145 -0
- package/dist/scanner.js.map +1 -0
- package/dist/types.d.ts +91 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +17 -0
- package/dist/types.js.map +1 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 amaju
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# DevArmor
|
|
2
|
+
|
|
3
|
+
**One CLI command to secure your entire AI-powered developer workstation.**
|
|
4
|
+
|
|
5
|
+
DevArmor is an integrated security scanner built specifically for modern developer workflows involving autonomous AI agents, Local LLMs, and Model Context Protocol (MCP) integrations. It identifies secrets, agent residue, overly permissive skills, and workstation misconfigurations.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install -g devarmor
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **SecretScanner**: Detects hardcoded API keys, tokens, and credentials.
|
|
16
|
+
- **AgentResidueScanner**: Finds leftover artifacts from AI agent sessions.
|
|
17
|
+
- **MCPAuditor**: Analyzes your MCP configuration for security risks.
|
|
18
|
+
- **SkillScanner**: Inspects agent skills for dangerous permissions.
|
|
19
|
+
- **PostureChecker**: Validates your overall workstation security posture.
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
Run a full security scan on your current directory:
|
|
24
|
+
```bash
|
|
25
|
+
devarmor scan .
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Generate an HTML report:
|
|
29
|
+
```bash
|
|
30
|
+
devarmor scan . --report html
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## License
|
|
34
|
+
|
|
35
|
+
MIT
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AA4DA,gCAAgC;AAChC,wBAAsB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,CAiEzC"}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// DevArmor — CLI Interface
|
|
4
|
+
// One CLI command to secure your AI-powered developer workstation.
|
|
5
|
+
// ============================================================
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.cli = cli;
|
|
41
|
+
const commander_1 = require("commander");
|
|
42
|
+
const scanner_1 = require("./scanner");
|
|
43
|
+
const terminal_1 = require("./report/terminal");
|
|
44
|
+
const json_1 = require("./report/json");
|
|
45
|
+
const html_1 = require("./report/html");
|
|
46
|
+
/** Dynamic import helper for ESM-only chalk. */
|
|
47
|
+
async function getChalk() { return (await Promise.resolve().then(() => __importStar(require('chalk')))).default; }
|
|
48
|
+
/** Valid module names for --modules flag validation. */
|
|
49
|
+
const VALID_MODULES = [
|
|
50
|
+
'SecretScanner',
|
|
51
|
+
'AgentResidueScanner',
|
|
52
|
+
'MCPAuditor',
|
|
53
|
+
'SkillScanner',
|
|
54
|
+
'PostureChecker',
|
|
55
|
+
];
|
|
56
|
+
/** Prints the ASCII art banner. */
|
|
57
|
+
async function printBanner() {
|
|
58
|
+
const chalk = await getChalk();
|
|
59
|
+
const banner = `
|
|
60
|
+
${chalk.cyan.bold(' ╔══════════════════════════════════════════════╗')}
|
|
61
|
+
${chalk.cyan.bold(' ║')}${chalk.white.bold(' ██████╗ ███████╗██╗ ██╗ █████╗ ██████╗ ')}${chalk.cyan.bold('║')}
|
|
62
|
+
${chalk.cyan.bold(' ║')}${chalk.white.bold(' ██╔══██╗██╔════╝██║ ██║██╔══██╗██╔══██╗ ')}${chalk.cyan.bold('║')}
|
|
63
|
+
${chalk.cyan.bold(' ║')}${chalk.white.bold(' ██║ ██║█████╗ ██║ ██║███████║██████╔╝ ')}${chalk.cyan.bold('║')}
|
|
64
|
+
${chalk.cyan.bold(' ║')}${chalk.white.bold(' ██║ ██║██╔══╝ ╚██╗ ██╔╝██╔══██║██╔══██╗ ')}${chalk.cyan.bold('║')}
|
|
65
|
+
${chalk.cyan.bold(' ║')}${chalk.white.bold(' ██████╔╝███████╗ ╚████╔╝ ██║ ██║██║ ██║ ')}${chalk.cyan.bold('║')}
|
|
66
|
+
${chalk.cyan.bold(' ║')}${chalk.white.bold(' ╚═════╝ ╚══════╝ ╚═══╝ ╚═╝ ╚═╝╚═╝ ╚═╝ ')}${chalk.cyan.bold('║')}
|
|
67
|
+
${chalk.cyan.bold(' ║')}${chalk.yellow.bold(' ─── ARMOR ───────────────────────────')}${chalk.cyan.bold('║')}
|
|
68
|
+
${chalk.cyan.bold(' ╚══════════════════════════════════════════════╝')}
|
|
69
|
+
${chalk.dim(' One CLI command to secure your AI-powered workstation.')}
|
|
70
|
+
${chalk.dim(' v1.0.0')}
|
|
71
|
+
`;
|
|
72
|
+
console.log(banner);
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Parses a comma-separated module list and validates module names.
|
|
76
|
+
*/
|
|
77
|
+
function parseModules(value) {
|
|
78
|
+
if (!value)
|
|
79
|
+
return [];
|
|
80
|
+
const names = value.split(',').map((s) => s.trim());
|
|
81
|
+
const invalid = names.filter((n) => !VALID_MODULES.includes(n));
|
|
82
|
+
if (invalid.length > 0) {
|
|
83
|
+
console.error(`Error: Unknown module(s): ${invalid.join(', ')}`);
|
|
84
|
+
console.error(`Valid modules: ${VALID_MODULES.join(', ')}`);
|
|
85
|
+
process.exit(1);
|
|
86
|
+
}
|
|
87
|
+
return names;
|
|
88
|
+
}
|
|
89
|
+
/** Sets up and runs the CLI. */
|
|
90
|
+
async function cli() {
|
|
91
|
+
await printBanner();
|
|
92
|
+
const program = new commander_1.Command();
|
|
93
|
+
program
|
|
94
|
+
.name('devarmor')
|
|
95
|
+
.description('One CLI command to secure your entire AI-powered developer workstation.')
|
|
96
|
+
.version('1.0.0');
|
|
97
|
+
program
|
|
98
|
+
.command('scan')
|
|
99
|
+
.description('Scan your workstation for security issues')
|
|
100
|
+
.option('-p, --path <dir>', 'Root directory to scan', '.')
|
|
101
|
+
.option('-r, --report <format>', 'Report format: terminal, html, or json', 'terminal')
|
|
102
|
+
.option('-f, --fix', 'Attempt to auto-fix certain issues', false)
|
|
103
|
+
.option('-v, --verbose', 'Enable verbose logging', false)
|
|
104
|
+
.option('-m, --modules <list>', 'Comma-separated list of modules to run (e.g. SecretScanner,MCPAuditor)', '')
|
|
105
|
+
.action(async (opts) => {
|
|
106
|
+
const scanOptions = {
|
|
107
|
+
path: opts.path,
|
|
108
|
+
report: opts.report,
|
|
109
|
+
fix: opts.fix,
|
|
110
|
+
verbose: opts.verbose,
|
|
111
|
+
modules: parseModules(opts.modules),
|
|
112
|
+
};
|
|
113
|
+
// Validate report format
|
|
114
|
+
if (!['terminal', 'html', 'json'].includes(scanOptions.report)) {
|
|
115
|
+
console.error(`Error: Invalid report format "${scanOptions.report}". Use terminal, html, or json.`);
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
const report = await (0, scanner_1.runScan)(scanOptions);
|
|
119
|
+
// Render the requested report format
|
|
120
|
+
switch (scanOptions.report) {
|
|
121
|
+
case 'json':
|
|
122
|
+
await (0, json_1.renderJsonReport)(report);
|
|
123
|
+
break;
|
|
124
|
+
case 'html':
|
|
125
|
+
(0, html_1.generateHtmlReport)(report, 'devarmor-report.html');
|
|
126
|
+
console.log('\nHTML report generated at devarmor-report.html');
|
|
127
|
+
break;
|
|
128
|
+
case 'terminal':
|
|
129
|
+
default:
|
|
130
|
+
await (0, terminal_1.renderTerminalReport)(report);
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
// Exit with non-zero code if critical findings exist
|
|
134
|
+
if (report.summary.critical > 0) {
|
|
135
|
+
process.exit(1);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
await program.parseAsync(process.argv);
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,2BAA2B;AAC3B,mEAAmE;AACnE,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0D/D,kBAiEC;AAzHD,yCAAoC;AACpC,uCAAoC;AACpC,gDAAyD;AACzD,wCAAiD;AACjD,wCAAmD;AAGnD,gDAAgD;AAChD,KAAK,UAAU,QAAQ,KAAK,OAAO,CAAC,wDAAa,OAAO,GAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;AAErE,wDAAwD;AACxD,MAAM,aAAa,GAAiB;IAClC,eAAe;IACf,qBAAqB;IACrB,YAAY;IACZ,cAAc;IAC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nD,OAAO,CAAC,GAAG,CAAC,iDAAiD,CAAC,CAAC;gBAC/D,MAAM;YACR,KAAK,UAAU,CAAC;YAChB;gBACE,MAAM,IAAA,+BAAoB,EAAC,MAAM,CAAC,CAAC;gBACnC,MAAM;QACV,CAAC;QAED,qDAAqD;QACrD,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,GAAG,CAAC,EAAE,CAAC;YAChC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,MAAM,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
// ============================================================
|
|
4
|
+
// DevArmor — Entry Point
|
|
5
|
+
// One CLI command to secure your AI-powered developer workstation.
|
|
6
|
+
// ============================================================
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
const cli_1 = require("./cli");
|
|
9
|
+
(0, cli_1.cli)().catch((err) => {
|
|
10
|
+
console.error('Fatal error:', err);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;AACA,+DAA+D;AAC/D,yBAAyB;AACzB,mEAAmE;AACnE,+DAA+D;;AAE/D,+BAA4B;AAE5B,IAAA,SAAG,GAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;IAClB,OAAO,CAAC,KAAK,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACnC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ScannerModule, ModuleResult, ScanOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* AgentResidueScanner — Detects credentials leaked in AI agent
|
|
4
|
+
* conversation history, config files, and cache directories.
|
|
5
|
+
*/
|
|
6
|
+
export declare class AgentResidueScanner implements ScannerModule {
|
|
7
|
+
name: "AgentResidueScanner";
|
|
8
|
+
label: string;
|
|
9
|
+
scan(options: ScanOptions): Promise<ModuleResult>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=agent-residue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-residue.d.ts","sourceRoot":"","sources":["../../src/modules/agent-residue.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,aAAa,EACb,YAAY,EAEZ,WAAW,EAEZ,MAAM,UAAU,CAAC;AA0HlB;;;GAGG;AACH,qBAAa,mBAAoB,YAAW,aAAa;IACvD,IAAI,EAAG,qBAAqB,CAAU;IACtC,KAAK,SAA8B;IAE7B,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CA8HxD"}
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// DevArmor — Agent Residue Scanner Module
|
|
4
|
+
// Scans AI agent history directories for leaked credentials.
|
|
5
|
+
// ============================================================
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
23
|
+
var ownKeys = function(o) {
|
|
24
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
25
|
+
var ar = [];
|
|
26
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
27
|
+
return ar;
|
|
28
|
+
};
|
|
29
|
+
return ownKeys(o);
|
|
30
|
+
};
|
|
31
|
+
return function (mod) {
|
|
32
|
+
if (mod && mod.__esModule) return mod;
|
|
33
|
+
var result = {};
|
|
34
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
35
|
+
__setModuleDefault(result, mod);
|
|
36
|
+
return result;
|
|
37
|
+
};
|
|
38
|
+
})();
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
exports.AgentResidueScanner = void 0;
|
|
41
|
+
const fs = __importStar(require("fs"));
|
|
42
|
+
const path = __importStar(require("path"));
|
|
43
|
+
const os = __importStar(require("os"));
|
|
44
|
+
const types_1 = require("../types");
|
|
45
|
+
/** Known AI agent directories relative to user home. */
|
|
46
|
+
const AGENT_DIRS = [
|
|
47
|
+
{ name: 'Claude Code', dir: '.claude' },
|
|
48
|
+
{ name: 'Cursor', dir: '.cursor' },
|
|
49
|
+
{ name: 'Codex (OpenAI)', dir: '.codex' },
|
|
50
|
+
{ name: 'Gemini (Google)', dir: '.gemini' },
|
|
51
|
+
{ name: 'GitHub Copilot', dir: '.github-copilot' },
|
|
52
|
+
{ name: 'Windsurf', dir: '.windsurf' },
|
|
53
|
+
{ name: 'Aider', dir: '.aider' },
|
|
54
|
+
{ name: 'Continue', dir: '.continue' },
|
|
55
|
+
];
|
|
56
|
+
/** Sensitive file patterns within agent directories. */
|
|
57
|
+
const SENSITIVE_FILE_PATTERNS = [
|
|
58
|
+
'config.json',
|
|
59
|
+
'auth.json',
|
|
60
|
+
'credentials.json',
|
|
61
|
+
'mcp.json',
|
|
62
|
+
'settings.json',
|
|
63
|
+
'claude_desktop_config.json',
|
|
64
|
+
];
|
|
65
|
+
/** Patterns that indicate credential leakage in conversation logs. */
|
|
66
|
+
const RESIDUE_PATTERNS = [
|
|
67
|
+
{
|
|
68
|
+
id: 'api-key-in-log',
|
|
69
|
+
label: 'API Key in Conversation Log',
|
|
70
|
+
regex: /(?:sk-[A-Za-z0-9_-]{20,}|sk-ant-[A-Za-z0-9_-]{20,}|AIza[A-Za-z0-9_-]{35}|AKIA[0-9A-Z]{16}|ghp_[A-Za-z0-9]{36,})/g,
|
|
71
|
+
severity: types_1.Severity.CRITICAL,
|
|
72
|
+
remediation: 'Clear agent history and rotate any exposed keys immediately',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'env-var-in-log',
|
|
76
|
+
label: 'Environment Variable Value in Log',
|
|
77
|
+
regex: /(?:API_KEY|SECRET_KEY|ACCESS_TOKEN|AUTH_TOKEN|DATABASE_URL|PRIVATE_KEY)\s*[=:]\s*["']?[A-Za-z0-9_/+=.-]{10,}/gi,
|
|
78
|
+
severity: types_1.Severity.HIGH,
|
|
79
|
+
remediation: 'Rotate the exposed credential and clear agent conversation history',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
id: 'password-in-log',
|
|
83
|
+
label: 'Password Leaked in Conversation',
|
|
84
|
+
regex: /(?:password|passwd|pwd)\s*[=:]\s*["'][^"']{6,}["']/gi,
|
|
85
|
+
severity: types_1.Severity.HIGH,
|
|
86
|
+
remediation: 'Change the password immediately and clear agent history',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
id: 'connection-string-in-log',
|
|
90
|
+
label: 'Database Connection String in Log',
|
|
91
|
+
regex: /(?:postgres|mongodb|mysql|redis):\/\/[^:]+:[^@]+@[^\s"']+/gi,
|
|
92
|
+
severity: types_1.Severity.HIGH,
|
|
93
|
+
remediation: 'Rotate database credentials and clear agent history',
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
id: 'private-key-in-log',
|
|
97
|
+
label: 'Private Key Material in Log',
|
|
98
|
+
regex: /-----BEGIN (?:RSA |EC |DSA |OPENSSH )?PRIVATE KEY-----/g,
|
|
99
|
+
severity: types_1.Severity.CRITICAL,
|
|
100
|
+
remediation: 'Regenerate the keypair immediately — the private key is compromised',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: 'jwt-in-log',
|
|
104
|
+
label: 'JWT Token in Conversation Log',
|
|
105
|
+
regex: /eyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}/g,
|
|
106
|
+
severity: types_1.Severity.MEDIUM,
|
|
107
|
+
remediation: 'Verify if the JWT is still valid and revoke if necessary',
|
|
108
|
+
},
|
|
109
|
+
];
|
|
110
|
+
/** Maximum file size to scan (5MB — logs can be large). */
|
|
111
|
+
const MAX_LOG_SIZE = 5 * 1024 * 1024;
|
|
112
|
+
/**
|
|
113
|
+
* Redacts sensitive content for safe display.
|
|
114
|
+
*/
|
|
115
|
+
function redact(value) {
|
|
116
|
+
if (value.length <= 12)
|
|
117
|
+
return '****';
|
|
118
|
+
return value.substring(0, 4) + '****' + value.substring(value.length - 4);
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Recursively find files in a directory (shallow depth for logs).
|
|
122
|
+
*/
|
|
123
|
+
function findFiles(dir, maxDepth = 4, currentDepth = 0) {
|
|
124
|
+
const results = [];
|
|
125
|
+
if (currentDepth > maxDepth || !fs.existsSync(dir))
|
|
126
|
+
return results;
|
|
127
|
+
let entries;
|
|
128
|
+
try {
|
|
129
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
130
|
+
}
|
|
131
|
+
catch {
|
|
132
|
+
return results;
|
|
133
|
+
}
|
|
134
|
+
for (const entry of entries) {
|
|
135
|
+
const fullPath = path.join(dir, entry.name);
|
|
136
|
+
if (entry.isDirectory()) {
|
|
137
|
+
// Skip very deep or large directories
|
|
138
|
+
if (entry.name !== 'node_modules' && entry.name !== '.git') {
|
|
139
|
+
results.push(...findFiles(fullPath, maxDepth, currentDepth + 1));
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else if (entry.isFile()) {
|
|
143
|
+
const ext = path.extname(entry.name).toLowerCase();
|
|
144
|
+
if (['.json', '.jsonl', '.log', '.txt', '.yaml', '.yml', '.toml'].includes(ext) ||
|
|
145
|
+
SENSITIVE_FILE_PATTERNS.includes(entry.name.toLowerCase())) {
|
|
146
|
+
try {
|
|
147
|
+
const stat = fs.statSync(fullPath);
|
|
148
|
+
if (stat.size <= MAX_LOG_SIZE && stat.size > 0) {
|
|
149
|
+
results.push(fullPath);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
catch {
|
|
153
|
+
// Skip inaccessible files
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return results;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* AgentResidueScanner — Detects credentials leaked in AI agent
|
|
162
|
+
* conversation history, config files, and cache directories.
|
|
163
|
+
*/
|
|
164
|
+
class AgentResidueScanner {
|
|
165
|
+
name = 'AgentResidueScanner';
|
|
166
|
+
label = '🤖 Agent Residue Scanner';
|
|
167
|
+
async scan(options) {
|
|
168
|
+
const startTime = Date.now();
|
|
169
|
+
const findings = [];
|
|
170
|
+
const homeDir = os.homedir();
|
|
171
|
+
let totalFilesScanned = 0;
|
|
172
|
+
// Phase 1: Check which agent directories exist
|
|
173
|
+
for (const agent of AGENT_DIRS) {
|
|
174
|
+
const agentPath = path.join(homeDir, agent.dir);
|
|
175
|
+
if (!fs.existsSync(agentPath)) {
|
|
176
|
+
continue; // Agent not installed, skip
|
|
177
|
+
}
|
|
178
|
+
// Report agent directory discovery
|
|
179
|
+
findings.push({
|
|
180
|
+
module: this.name,
|
|
181
|
+
severity: types_1.Severity.INFO,
|
|
182
|
+
title: `${agent.name} Directory Found`,
|
|
183
|
+
description: `AI agent directory detected at ${agentPath}. This directory may contain conversation history with sensitive data.`,
|
|
184
|
+
filePath: agentPath,
|
|
185
|
+
remediation: 'Periodically review and clean agent history directories',
|
|
186
|
+
});
|
|
187
|
+
// Phase 2: Scan files within agent directory for leaked secrets
|
|
188
|
+
const files = findFiles(agentPath);
|
|
189
|
+
totalFilesScanned += files.length;
|
|
190
|
+
for (const filePath of files) {
|
|
191
|
+
let content;
|
|
192
|
+
try {
|
|
193
|
+
content = fs.readFileSync(filePath, 'utf-8');
|
|
194
|
+
}
|
|
195
|
+
catch {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
// Check for credential patterns in conversation logs
|
|
199
|
+
for (const pattern of RESIDUE_PATTERNS) {
|
|
200
|
+
pattern.regex.lastIndex = 0;
|
|
201
|
+
let match;
|
|
202
|
+
while ((match = pattern.regex.exec(content)) !== null) {
|
|
203
|
+
findings.push({
|
|
204
|
+
module: this.name,
|
|
205
|
+
severity: pattern.severity,
|
|
206
|
+
title: `${pattern.label} — ${agent.name}`,
|
|
207
|
+
description: `Found credential residue in ${agent.name} history file.`,
|
|
208
|
+
filePath,
|
|
209
|
+
evidence: redact(match[0]),
|
|
210
|
+
remediation: pattern.remediation,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// Check for sensitive config files with hardcoded secrets
|
|
215
|
+
const basename = path.basename(filePath).toLowerCase();
|
|
216
|
+
if (SENSITIVE_FILE_PATTERNS.includes(basename)) {
|
|
217
|
+
// Check for common dangerous patterns in config files
|
|
218
|
+
if (content.includes('"apiKey"') || content.includes('"api_key"') ||
|
|
219
|
+
content.includes('"secret"') || content.includes('"token"')) {
|
|
220
|
+
// Only flag if it looks like it has an actual value (not empty/placeholder)
|
|
221
|
+
const hasRealValue = /(?:apiKey|api_key|secret|token)\s*["']?\s*:\s*["'][A-Za-z0-9_/+=.-]{10,}["']/i.test(content);
|
|
222
|
+
if (hasRealValue) {
|
|
223
|
+
findings.push({
|
|
224
|
+
module: this.name,
|
|
225
|
+
severity: types_1.Severity.HIGH,
|
|
226
|
+
title: `Hardcoded Credentials in ${agent.name} Config`,
|
|
227
|
+
description: `Configuration file contains what appears to be hardcoded API keys or tokens.`,
|
|
228
|
+
filePath,
|
|
229
|
+
remediation: 'Move secrets to environment variables or a secrets manager',
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
// Phase 3: Also scan the project directory for agent-generated residue
|
|
237
|
+
const projectAgentDirs = [
|
|
238
|
+
path.join(options.path, '.claude'),
|
|
239
|
+
path.join(options.path, '.cursor'),
|
|
240
|
+
path.join(options.path, '.codex'),
|
|
241
|
+
];
|
|
242
|
+
for (const agentDir of projectAgentDirs) {
|
|
243
|
+
if (!fs.existsSync(agentDir))
|
|
244
|
+
continue;
|
|
245
|
+
const files = findFiles(agentDir, 2);
|
|
246
|
+
totalFilesScanned += files.length;
|
|
247
|
+
for (const filePath of files) {
|
|
248
|
+
let content;
|
|
249
|
+
try {
|
|
250
|
+
content = fs.readFileSync(filePath, 'utf-8');
|
|
251
|
+
}
|
|
252
|
+
catch {
|
|
253
|
+
continue;
|
|
254
|
+
}
|
|
255
|
+
for (const pattern of RESIDUE_PATTERNS) {
|
|
256
|
+
pattern.regex.lastIndex = 0;
|
|
257
|
+
let match;
|
|
258
|
+
while ((match = pattern.regex.exec(content)) !== null) {
|
|
259
|
+
findings.push({
|
|
260
|
+
module: this.name,
|
|
261
|
+
severity: pattern.severity,
|
|
262
|
+
title: `${pattern.label} — Project Agent Files`,
|
|
263
|
+
description: `Found credential residue in project-level agent history.`,
|
|
264
|
+
filePath,
|
|
265
|
+
evidence: redact(match[0]),
|
|
266
|
+
remediation: pattern.remediation,
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return {
|
|
273
|
+
module: this.name,
|
|
274
|
+
label: this.label,
|
|
275
|
+
success: true,
|
|
276
|
+
durationMs: Date.now() - startTime,
|
|
277
|
+
itemsScanned: totalFilesScanned,
|
|
278
|
+
findings,
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
exports.AgentResidueScanner = AgentResidueScanner;
|
|
283
|
+
//# sourceMappingURL=agent-residue.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-residue.js","sourceRoot":"","sources":["../../src/modules/agent-residue.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,0CAA0C;AAC1C,6DAA6D;AAC7D,+DAA+D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAE/D,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AACzB,oCAMkB;AAElB,wDAAwD;AACxD,MAAM,UAAU,GAAG;IACjB,EAAE,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,SAAS,EAAE;IACvC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,SAAS,EAAE;IAClC,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,QAAQ,EAAE;IACzC,EAAE,IAAI,EAAE,iBAAiB,EAAE,GAAG,EAAE,SAAS,EAAE;IAC3C,EAAE,IAAI,EAAE,gBAAgB,EAAE,GAAG,EAAE,iBAAiB,EAAE;IAClD,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE;IACtC,EAAE,IAAI,EAA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AC;IACJ,CAAC;CACF;AAlID,kDAkIC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ScannerModule, ModuleResult, ScanOptions } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* MCPAuditor — Audits MCP server configurations for shell injection,
|
|
4
|
+
* over-privileged tool access, hardcoded secrets, insecure transport,
|
|
5
|
+
* and overly broad filesystem access.
|
|
6
|
+
*/
|
|
7
|
+
export declare class MCPAuditor implements ScannerModule {
|
|
8
|
+
name: "MCPAuditor";
|
|
9
|
+
label: string;
|
|
10
|
+
scan(options: ScanOptions): Promise<ModuleResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=mcp-auditor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mcp-auditor.d.ts","sourceRoot":"","sources":["../../src/modules/mcp-auditor.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,aAAa,EACb,YAAY,EAEZ,WAAW,EAEZ,MAAM,UAAU,CAAC;AAoGlB;;;;GAIG;AACH,qBAAa,UAAW,YAAW,aAAa;IAC9C,IAAI,EAAG,YAAY,CAAU;IAC7B,KAAK,SAAoB;IAEnB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;CAiKxD"}
|