@kevinrabun/judges 3.45.0 → 3.47.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/CHANGELOG.md +24 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +112 -0
- package/dist/cli.js.map +1 -1
- package/dist/commands/adoption-report.d.ts +8 -0
- package/dist/commands/adoption-report.d.ts.map +1 -0
- package/dist/commands/adoption-report.js +219 -0
- package/dist/commands/adoption-report.js.map +1 -0
- package/dist/commands/ai-model-trust.d.ts +17 -0
- package/dist/commands/ai-model-trust.d.ts.map +1 -0
- package/dist/commands/ai-model-trust.js +235 -0
- package/dist/commands/ai-model-trust.js.map +1 -0
- package/dist/commands/ai-prompt-audit.d.ts +23 -0
- package/dist/commands/ai-prompt-audit.d.ts.map +1 -0
- package/dist/commands/ai-prompt-audit.js +255 -0
- package/dist/commands/ai-prompt-audit.js.map +1 -0
- package/dist/commands/audit-bundle.d.ts +29 -0
- package/dist/commands/audit-bundle.d.ts.map +1 -0
- package/dist/commands/audit-bundle.js +235 -0
- package/dist/commands/audit-bundle.js.map +1 -0
- package/dist/commands/code-owner-suggest.d.ts +17 -0
- package/dist/commands/code-owner-suggest.d.ts.map +1 -0
- package/dist/commands/code-owner-suggest.js +215 -0
- package/dist/commands/code-owner-suggest.js.map +1 -0
- package/dist/commands/config-drift.d.ts +25 -0
- package/dist/commands/config-drift.d.ts.map +1 -0
- package/dist/commands/config-drift.js +214 -0
- package/dist/commands/config-drift.js.map +1 -0
- package/dist/commands/cost-forecast.d.ts +19 -0
- package/dist/commands/cost-forecast.d.ts.map +1 -0
- package/dist/commands/cost-forecast.js +194 -0
- package/dist/commands/cost-forecast.js.map +1 -0
- package/dist/commands/dev-score.d.ts +37 -0
- package/dist/commands/dev-score.d.ts.map +1 -0
- package/dist/commands/dev-score.js +204 -0
- package/dist/commands/dev-score.js.map +1 -0
- package/dist/commands/generate.d.ts +8 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +404 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/learn.d.ts +27 -0
- package/dist/commands/learn.d.ts.map +1 -0
- package/dist/commands/learn.js +289 -0
- package/dist/commands/learn.js.map +1 -0
- package/dist/commands/model-risk.d.ts +28 -0
- package/dist/commands/model-risk.d.ts.map +1 -0
- package/dist/commands/model-risk.js +221 -0
- package/dist/commands/model-risk.js.map +1 -0
- package/dist/commands/pr-quality-gate.d.ts +29 -0
- package/dist/commands/pr-quality-gate.d.ts.map +1 -0
- package/dist/commands/pr-quality-gate.js +208 -0
- package/dist/commands/pr-quality-gate.js.map +1 -0
- package/dist/commands/reg-watch.d.ts +21 -0
- package/dist/commands/reg-watch.d.ts.map +1 -0
- package/dist/commands/reg-watch.js +220 -0
- package/dist/commands/reg-watch.js.map +1 -0
- package/dist/commands/retro.d.ts +23 -0
- package/dist/commands/retro.d.ts.map +1 -0
- package/dist/commands/retro.js +217 -0
- package/dist/commands/retro.js.map +1 -0
- package/dist/commands/team-leaderboard.d.ts +25 -0
- package/dist/commands/team-leaderboard.d.ts.map +1 -0
- package/dist/commands/team-leaderboard.js +228 -0
- package/dist/commands/team-leaderboard.js.map +1 -0
- package/dist/commands/team-rules-sync.d.ts +8 -0
- package/dist/commands/team-rules-sync.d.ts.map +1 -0
- package/dist/commands/team-rules-sync.js +251 -0
- package/dist/commands/team-rules-sync.js.map +1 -0
- package/package.json +1 -1
- package/server.json +2 -2
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AI prompt audit — scans AI-generated code for prompt injection
|
|
3
|
+
* risks: user input echoed into SQL, shell, config, etc.
|
|
4
|
+
*
|
|
5
|
+
* Pattern-based analysis only — no data stored externally.
|
|
6
|
+
*/
|
|
7
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync } from "fs";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
const AUDIT_DIR = ".judges-prompt-audit";
|
|
10
|
+
const AUDIT_FILE = join(AUDIT_DIR, "audit-history.json");
|
|
11
|
+
const RISK_PATTERNS = [
|
|
12
|
+
{
|
|
13
|
+
id: "sql-template-literal",
|
|
14
|
+
regex: /`[^`]*\$\{[^}]*(?:user|input|param|query|req\.|request|body|args)[^}]*\}[^`]*(?:SELECT|INSERT|UPDATE|DELETE|FROM|WHERE)/i,
|
|
15
|
+
severity: "critical",
|
|
16
|
+
description: "Template literal with user input in SQL context",
|
|
17
|
+
recommendation: "Use parameterized queries ($1, $2) instead of string interpolation",
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "sql-concat",
|
|
21
|
+
regex: /(?:query|sql|execute|prepare)\s*\([^)]*(?:\+|\bconcat)\s*[^)]*(?:user|input|param|req\.|request|body)/i,
|
|
22
|
+
severity: "critical",
|
|
23
|
+
description: "String concatenation with user input in SQL query",
|
|
24
|
+
recommendation: "Use parameterized queries with placeholder values",
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
id: "shell-injection",
|
|
28
|
+
regex: /(?:exec|spawn|execSync|execFile|system|popen)\s*\([^)]*(?:\$\{|[\s+].*(?:user|input|param|req\.|args))/i,
|
|
29
|
+
severity: "critical",
|
|
30
|
+
description: "User input in shell command execution",
|
|
31
|
+
recommendation: "Use execFile with argument array, or validate against an allowlist",
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: "eval-user-input",
|
|
35
|
+
regex: /(?:eval|Function|setTimeout|setInterval)\s*\([^)]*(?:user|input|param|req\.|request|body|query)/i,
|
|
36
|
+
severity: "critical",
|
|
37
|
+
description: "User input passed to eval or dynamic code execution",
|
|
38
|
+
recommendation: "Never use eval with user input; use safe parsers instead",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "innerHTML-assignment",
|
|
42
|
+
regex: /\.innerHTML\s*=\s*(?).*(?:user|input|param|data|response|result)/i,
|
|
43
|
+
severity: "high",
|
|
44
|
+
description: "Dynamic content assigned to innerHTML without sanitization",
|
|
45
|
+
recommendation: "Use textContent for text or a sanitization library (DOMPurify) for HTML",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
id: "hardcoded-secret",
|
|
49
|
+
regex: /(?:password|secret|api_key|apiKey|token|auth)\s*[:=]\s*['"][^'"]{8,}['"]/i,
|
|
50
|
+
severity: "high",
|
|
51
|
+
description: "Hardcoded credential or secret in source code",
|
|
52
|
+
recommendation: "Use environment variables or a secrets manager",
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: "url-user-input",
|
|
56
|
+
regex: /(?:fetch|axios|http\.get|request|got)\s*\([^)]*(?:\$\{|[\s+].*(?:user|input|param|req\.|url|host))/i,
|
|
57
|
+
severity: "high",
|
|
58
|
+
description: "User-controlled URL in HTTP request (SSRF risk)",
|
|
59
|
+
recommendation: "Validate URLs against an allowlist and block private IP ranges",
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
id: "path-traversal",
|
|
63
|
+
regex: /(?:readFile|readFileSync|createReadStream|writeFile|writeFileSync|unlink|rmdir)\s*\([^)]*(?:\$\{|[\s+].*(?:user|input|param|req\.|path|file|name))/i,
|
|
64
|
+
severity: "high",
|
|
65
|
+
description: "User input in file system operation (path traversal risk)",
|
|
66
|
+
recommendation: "Sanitize paths with path.resolve and validate within allowed directory",
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
id: "prompt-echo",
|
|
70
|
+
regex: /(?:\/\/|#)\s*(?:TODO|FIXME|HACK|generated|copilot|cursor|claude|gpt|ai)[:\s].*(?:user|implement|replace|change)/i,
|
|
71
|
+
severity: "medium",
|
|
72
|
+
description: "AI prompt remnant in code comment — may expose intent or instructions",
|
|
73
|
+
recommendation: "Remove AI generation comments and prompt artifacts before committing",
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
id: "cors-wildcard",
|
|
77
|
+
regex: /(?:Access-Control-Allow-Origin|cors|origin)\s*[:=]\s*['"`]\*['"`]/i,
|
|
78
|
+
severity: "medium",
|
|
79
|
+
description: "Wildcard CORS allows any origin to access the API",
|
|
80
|
+
recommendation: "Restrict CORS to specific trusted origins",
|
|
81
|
+
},
|
|
82
|
+
];
|
|
83
|
+
// ─── Core ───────────────────────────────────────────────────────────────────
|
|
84
|
+
function ensureDir() {
|
|
85
|
+
if (!existsSync(AUDIT_DIR))
|
|
86
|
+
mkdirSync(AUDIT_DIR, { recursive: true });
|
|
87
|
+
}
|
|
88
|
+
function loadStore() {
|
|
89
|
+
if (!existsSync(AUDIT_FILE))
|
|
90
|
+
return { results: [], updatedAt: new Date().toISOString() };
|
|
91
|
+
try {
|
|
92
|
+
return JSON.parse(readFileSync(AUDIT_FILE, "utf-8"));
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return { results: [], updatedAt: new Date().toISOString() };
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function saveStore(store) {
|
|
99
|
+
ensureDir();
|
|
100
|
+
store.updatedAt = new Date().toISOString();
|
|
101
|
+
writeFileSync(AUDIT_FILE, JSON.stringify(store, null, 2));
|
|
102
|
+
}
|
|
103
|
+
export function auditFile(filePath) {
|
|
104
|
+
const content = readFileSync(filePath, "utf-8");
|
|
105
|
+
const lines = content.split("\n");
|
|
106
|
+
const risks = [];
|
|
107
|
+
for (let i = 0; i < lines.length; i++) {
|
|
108
|
+
const line = lines[i];
|
|
109
|
+
for (const pattern of RISK_PATTERNS) {
|
|
110
|
+
if (pattern.regex.test(line)) {
|
|
111
|
+
risks.push({
|
|
112
|
+
line: i + 1,
|
|
113
|
+
pattern: pattern.id,
|
|
114
|
+
severity: pattern.severity,
|
|
115
|
+
description: pattern.description,
|
|
116
|
+
recommendation: pattern.recommendation,
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
// Risk score: critical=30, high=15, medium=5
|
|
122
|
+
const riskScore = risks.reduce((sum, r) => {
|
|
123
|
+
if (r.severity === "critical")
|
|
124
|
+
return sum + 30;
|
|
125
|
+
if (r.severity === "high")
|
|
126
|
+
return sum + 15;
|
|
127
|
+
return sum + 5;
|
|
128
|
+
}, 0);
|
|
129
|
+
const result = {
|
|
130
|
+
file: filePath,
|
|
131
|
+
risks,
|
|
132
|
+
riskScore: Math.min(100, riskScore),
|
|
133
|
+
timestamp: new Date().toISOString(),
|
|
134
|
+
};
|
|
135
|
+
// Persist
|
|
136
|
+
const store = loadStore();
|
|
137
|
+
store.results.push(result);
|
|
138
|
+
if (store.results.length > 200)
|
|
139
|
+
store.results = store.results.slice(-200);
|
|
140
|
+
saveStore(store);
|
|
141
|
+
return result;
|
|
142
|
+
}
|
|
143
|
+
// ─── CLI ────────────────────────────────────────────────────────────────────
|
|
144
|
+
export function runAiPromptAudit(argv) {
|
|
145
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
146
|
+
console.log(`
|
|
147
|
+
judges ai-prompt-audit — Scan for prompt injection risks in AI-generated code
|
|
148
|
+
|
|
149
|
+
Usage:
|
|
150
|
+
judges ai-prompt-audit --file src/app.ts
|
|
151
|
+
judges ai-prompt-audit --patterns
|
|
152
|
+
judges ai-prompt-audit --history
|
|
153
|
+
judges ai-prompt-audit --summary
|
|
154
|
+
|
|
155
|
+
Options:
|
|
156
|
+
--file <path> Scan a file for prompt injection risks
|
|
157
|
+
--patterns Show all detection patterns
|
|
158
|
+
--history Show audit history
|
|
159
|
+
--summary Show risk summary across all audits
|
|
160
|
+
--format json JSON output
|
|
161
|
+
--help, -h Show this help
|
|
162
|
+
`);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
const format = argv.find((_a, i) => argv[i - 1] === "--format") || "text";
|
|
166
|
+
// Patterns
|
|
167
|
+
if (argv.includes("--patterns")) {
|
|
168
|
+
const patterns = RISK_PATTERNS.map(({ id, severity, description, recommendation }) => ({
|
|
169
|
+
id,
|
|
170
|
+
severity,
|
|
171
|
+
description,
|
|
172
|
+
recommendation,
|
|
173
|
+
}));
|
|
174
|
+
if (format === "json") {
|
|
175
|
+
console.log(JSON.stringify(patterns, null, 2));
|
|
176
|
+
}
|
|
177
|
+
else {
|
|
178
|
+
console.log(`\n Prompt Audit Patterns (${patterns.length})\n ──────────────────────────`);
|
|
179
|
+
for (const p of patterns) {
|
|
180
|
+
console.log(` [${p.severity.padEnd(8)}] ${p.id.padEnd(25)} ${p.description}`);
|
|
181
|
+
}
|
|
182
|
+
console.log("");
|
|
183
|
+
}
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
// History
|
|
187
|
+
if (argv.includes("--history")) {
|
|
188
|
+
const store = loadStore();
|
|
189
|
+
if (format === "json") {
|
|
190
|
+
console.log(JSON.stringify(store, null, 2));
|
|
191
|
+
}
|
|
192
|
+
else {
|
|
193
|
+
console.log(`\n Audit History (${store.results.length} scans)\n ──────────────────────────`);
|
|
194
|
+
for (const r of store.results.slice(-15)) {
|
|
195
|
+
const icon = r.riskScore === 0 ? "✅" : r.riskScore >= 50 ? "🔴" : "⚠️";
|
|
196
|
+
console.log(` ${icon} ${r.timestamp.slice(0, 16)} risk:${r.riskScore.toString().padEnd(4)} ${r.risks.length} issues ${r.file}`);
|
|
197
|
+
}
|
|
198
|
+
console.log("");
|
|
199
|
+
}
|
|
200
|
+
return;
|
|
201
|
+
}
|
|
202
|
+
// Summary
|
|
203
|
+
if (argv.includes("--summary")) {
|
|
204
|
+
const store = loadStore();
|
|
205
|
+
const totalRisks = store.results.reduce((s, r) => s + r.risks.length, 0);
|
|
206
|
+
const critCount = store.results.reduce((s, r) => s + r.risks.filter((x) => x.severity === "critical").length, 0);
|
|
207
|
+
const highCount = store.results.reduce((s, r) => s + r.risks.filter((x) => x.severity === "high").length, 0);
|
|
208
|
+
const avgScore = store.results.length > 0
|
|
209
|
+
? Math.round(store.results.reduce((s, r) => s + r.riskScore, 0) / store.results.length)
|
|
210
|
+
: 0;
|
|
211
|
+
if (format === "json") {
|
|
212
|
+
console.log(JSON.stringify({ totalScans: store.results.length, totalRisks, critCount, highCount, avgScore }, null, 2));
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
console.log(`\n Prompt Audit Summary\n ──────────────────────────`);
|
|
216
|
+
console.log(` Scans: ${store.results.length}`);
|
|
217
|
+
console.log(` Risks: ${totalRisks} (${critCount} critical, ${highCount} high)`);
|
|
218
|
+
console.log(` Avg risk: ${avgScore}/100`);
|
|
219
|
+
console.log("");
|
|
220
|
+
}
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
// Scan file
|
|
224
|
+
const filePath = argv.find((_a, i) => argv[i - 1] === "--file");
|
|
225
|
+
if (!filePath) {
|
|
226
|
+
console.error(" Use --file <path>, --patterns, --history, or --summary. --help for usage.");
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
if (!existsSync(filePath)) {
|
|
230
|
+
console.error(` File not found: ${filePath}`);
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
const result = auditFile(filePath);
|
|
234
|
+
if (format === "json") {
|
|
235
|
+
console.log(JSON.stringify(result, null, 2));
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
const icon = result.riskScore === 0 ? "✅" : result.riskScore >= 50 ? "🔴" : "⚠️";
|
|
239
|
+
console.log(`\n ${icon} Prompt Audit — ${filePath}`);
|
|
240
|
+
console.log(` Risk score: ${result.riskScore}/100 | Issues: ${result.risks.length}`);
|
|
241
|
+
console.log(` ──────────────────────────`);
|
|
242
|
+
if (result.risks.length === 0) {
|
|
243
|
+
console.log(" No prompt injection risks detected.");
|
|
244
|
+
}
|
|
245
|
+
else {
|
|
246
|
+
for (const r of result.risks) {
|
|
247
|
+
console.log(` L${r.line.toString().padEnd(5)} [${r.severity.padEnd(8)}] ${r.pattern}`);
|
|
248
|
+
console.log(` ${r.description}`);
|
|
249
|
+
console.log(` Fix: ${r.recommendation}`);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
console.log("");
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
//# sourceMappingURL=ai-pr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,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC;YACrD,CAAC;QACH,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit evidence bundle — assemble a complete, auditor-ready evidence
|
|
3
|
+
* package from local scan history, suppressions, votes, SLA data, and config.
|
|
4
|
+
*
|
|
5
|
+
* Outputs a structured directory or JSON manifest.
|
|
6
|
+
*/
|
|
7
|
+
interface AuditArtifact {
|
|
8
|
+
type: string;
|
|
9
|
+
source: string;
|
|
10
|
+
description: string;
|
|
11
|
+
controlMapping?: string[];
|
|
12
|
+
present: boolean;
|
|
13
|
+
}
|
|
14
|
+
interface AuditBundle {
|
|
15
|
+
standard: string;
|
|
16
|
+
generatedAt: string;
|
|
17
|
+
period: string;
|
|
18
|
+
artifacts: AuditArtifact[];
|
|
19
|
+
summary: {
|
|
20
|
+
present: number;
|
|
21
|
+
missing: number;
|
|
22
|
+
coveragePercent: number;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export declare function generateBundle(standard: string, periodDays: number): AuditBundle;
|
|
26
|
+
export declare function exportBundle(bundle: AuditBundle, outputDir: string): void;
|
|
27
|
+
export declare function runAuditBundle(argv: string[]): void;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=audit-bundle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-bundle.d.ts","sourceRoot":"","sources":["../../src/commands/audit-bundle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,UAAU,aAAa;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,WAAW;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;QAChB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AA4FD,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,WAAW,CAyChF;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,CA4CzE;AAID,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CA+DnD"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audit evidence bundle — assemble a complete, auditor-ready evidence
|
|
3
|
+
* package from local scan history, suppressions, votes, SLA data, and config.
|
|
4
|
+
*
|
|
5
|
+
* Outputs a structured directory or JSON manifest.
|
|
6
|
+
*/
|
|
7
|
+
import { readFileSync, writeFileSync, existsSync, mkdirSync, readdirSync } from "fs";
|
|
8
|
+
import { join } from "path";
|
|
9
|
+
const EVIDENCE_SOURCES = [
|
|
10
|
+
{
|
|
11
|
+
file: ".judgesrc",
|
|
12
|
+
type: "config",
|
|
13
|
+
description: "Security policy configuration",
|
|
14
|
+
controls: ["SOC2-CC6.1", "ISO27001-A.8.28"],
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
file: ".judges-results.json",
|
|
18
|
+
type: "scan-results",
|
|
19
|
+
description: "Latest evaluation findings",
|
|
20
|
+
controls: ["SOC2-CC7.1", "ISO27001-A.8.8"],
|
|
21
|
+
},
|
|
22
|
+
{ file: ".judges-baseline.json", type: "baseline", description: "Accepted risk baseline", controls: ["SOC2-CC3.2"] },
|
|
23
|
+
{
|
|
24
|
+
file: ".judges-suppressions.json",
|
|
25
|
+
type: "suppressions",
|
|
26
|
+
description: "Suppressed finding audit trail",
|
|
27
|
+
controls: ["SOC2-CC3.3", "ISO27001-A.8.28"],
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
file: ".judges-votes.json",
|
|
31
|
+
type: "review-decisions",
|
|
32
|
+
description: "Team consensus on findings",
|
|
33
|
+
controls: ["SOC2-CC4.1"],
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
file: ".judges-sla.json",
|
|
37
|
+
type: "sla-policy",
|
|
38
|
+
description: "SLA policies and violation tracking",
|
|
39
|
+
controls: ["SOC2-CC7.2", "ISO27001-A.8.8"],
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
file: ".judges-burndown.json",
|
|
43
|
+
type: "resolution-tracking",
|
|
44
|
+
description: "Finding resolution timeline",
|
|
45
|
+
controls: ["SOC2-CC7.3"],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
file: ".judges-kb.json",
|
|
49
|
+
type: "knowledge-base",
|
|
50
|
+
description: "Team rule decisions and exceptions",
|
|
51
|
+
controls: ["SOC2-CC3.2", "ISO27001-A.5.1"],
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
file: ".judges-owners.json",
|
|
55
|
+
type: "ownership",
|
|
56
|
+
description: "Rule-to-owner accountability mapping",
|
|
57
|
+
controls: ["SOC2-CC1.3"],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
file: ".judges-reputation.json",
|
|
61
|
+
type: "tool-effectiveness",
|
|
62
|
+
description: "Judge accuracy and FP tracking",
|
|
63
|
+
controls: ["SOC2-CC4.2"],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
file: ".judges-audit.json",
|
|
67
|
+
type: "policy-snapshots",
|
|
68
|
+
description: "Policy audit trail with SHA-256 hashes",
|
|
69
|
+
controls: ["SOC2-CC8.1", "ISO27001-A.8.25"],
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
file: ".judges-review-queue.json",
|
|
73
|
+
type: "manual-review",
|
|
74
|
+
description: "Manual review queue decisions",
|
|
75
|
+
controls: ["SOC2-CC4.1"],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
file: ".judges-correlations.json",
|
|
79
|
+
type: "root-cause",
|
|
80
|
+
description: "Root cause analysis records",
|
|
81
|
+
controls: ["SOC2-CC7.4"],
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
file: ".judges-digest.json",
|
|
85
|
+
type: "trend-data",
|
|
86
|
+
description: "Historical trend snapshots",
|
|
87
|
+
controls: ["SOC2-CC4.2", "ISO27001-A.8.16"],
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
file: ".judges-false-negatives.json",
|
|
91
|
+
type: "fn-tracking",
|
|
92
|
+
description: "False negative tracking",
|
|
93
|
+
controls: ["SOC2-CC7.1"],
|
|
94
|
+
},
|
|
95
|
+
];
|
|
96
|
+
// ─── Core ───────────────────────────────────────────────────────────────────
|
|
97
|
+
export function generateBundle(standard, periodDays) {
|
|
98
|
+
const artifacts = [];
|
|
99
|
+
for (const src of EVIDENCE_SOURCES) {
|
|
100
|
+
const present = existsSync(src.file);
|
|
101
|
+
artifacts.push({
|
|
102
|
+
type: src.type,
|
|
103
|
+
source: src.file,
|
|
104
|
+
description: src.description,
|
|
105
|
+
controlMapping: src.controls,
|
|
106
|
+
present,
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
// Check for run history
|
|
110
|
+
const runsDir = ".judges-runs";
|
|
111
|
+
if (existsSync(runsDir)) {
|
|
112
|
+
const runs = readdirSync(runsDir).filter((f) => f.endsWith(".json"));
|
|
113
|
+
artifacts.push({
|
|
114
|
+
type: "scan-history",
|
|
115
|
+
source: runsDir,
|
|
116
|
+
description: `${runs.length} historical scan snapshot(s)`,
|
|
117
|
+
controlMapping: ["SOC2-CC7.1", "ISO27001-A.8.8"],
|
|
118
|
+
present: runs.length > 0,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const present = artifacts.filter((a) => a.present).length;
|
|
122
|
+
const total = artifacts.length;
|
|
123
|
+
return {
|
|
124
|
+
standard,
|
|
125
|
+
generatedAt: new Date().toISOString(),
|
|
126
|
+
period: `${periodDays} days`,
|
|
127
|
+
artifacts,
|
|
128
|
+
summary: {
|
|
129
|
+
present,
|
|
130
|
+
missing: total - present,
|
|
131
|
+
coveragePercent: Math.round((present / total) * 100),
|
|
132
|
+
},
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
export function exportBundle(bundle, outputDir) {
|
|
136
|
+
mkdirSync(outputDir, { recursive: true });
|
|
137
|
+
// Copy present artifacts
|
|
138
|
+
for (const artifact of bundle.artifacts) {
|
|
139
|
+
if (artifact.present && existsSync(artifact.source)) {
|
|
140
|
+
try {
|
|
141
|
+
const content = readFileSync(artifact.source, "utf-8");
|
|
142
|
+
const destName = artifact.source.replace(/^\./, "").replace(/\//g, "_");
|
|
143
|
+
writeFileSync(join(outputDir, destName), content);
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
// Skip files that can't be read (directories handled separately)
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
// Write manifest
|
|
151
|
+
writeFileSync(join(outputDir, "audit-manifest.json"), JSON.stringify(bundle, null, 2));
|
|
152
|
+
// Write human-readable summary
|
|
153
|
+
const lines = [];
|
|
154
|
+
lines.push(`# Audit Evidence Bundle — ${bundle.standard}`);
|
|
155
|
+
lines.push(`Generated: ${bundle.generatedAt}`);
|
|
156
|
+
lines.push(`Period: ${bundle.period}\n`);
|
|
157
|
+
lines.push(`## Coverage: ${bundle.summary.coveragePercent}% (${bundle.summary.present}/${bundle.summary.present + bundle.summary.missing})\n`);
|
|
158
|
+
lines.push("| Status | Type | Source | Controls |");
|
|
159
|
+
lines.push("|--------|------|--------|----------|");
|
|
160
|
+
for (const a of bundle.artifacts) {
|
|
161
|
+
const icon = a.present ? "✅" : "❌";
|
|
162
|
+
const controls = (a.controlMapping || []).join(", ");
|
|
163
|
+
lines.push(`| ${icon} | ${a.type} | ${a.source} | ${controls} |`);
|
|
164
|
+
}
|
|
165
|
+
lines.push("\n## Missing Evidence");
|
|
166
|
+
const missing = bundle.artifacts.filter((a) => !a.present);
|
|
167
|
+
if (missing.length === 0) {
|
|
168
|
+
lines.push("All evidence artifacts present.");
|
|
169
|
+
}
|
|
170
|
+
else {
|
|
171
|
+
for (const m of missing) {
|
|
172
|
+
lines.push(`- **${m.type}**: ${m.description} (${m.source})`);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
writeFileSync(join(outputDir, "audit-summary.md"), lines.join("\n"));
|
|
176
|
+
}
|
|
177
|
+
// ─── CLI ────────────────────────────────────────────────────────────────────
|
|
178
|
+
export function runAuditBundle(argv) {
|
|
179
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
180
|
+
console.log(`
|
|
181
|
+
judges audit-bundle — Assemble auditor-ready evidence package
|
|
182
|
+
|
|
183
|
+
Usage:
|
|
184
|
+
judges audit-bundle --standard soc2
|
|
185
|
+
judges audit-bundle --standard iso27001 --period 90
|
|
186
|
+
judges audit-bundle --standard soc2 --output ./audit-evidence/
|
|
187
|
+
judges audit-bundle --check
|
|
188
|
+
|
|
189
|
+
Options:
|
|
190
|
+
--standard <name> Standard: soc2 | iso27001 | hitrust | generic (default: generic)
|
|
191
|
+
--period <days> Evidence period in days (default: 90)
|
|
192
|
+
--output <dir> Export evidence to directory
|
|
193
|
+
--check Check evidence coverage without exporting
|
|
194
|
+
--format json JSON output
|
|
195
|
+
--help, -h Show this help
|
|
196
|
+
`);
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
const format = argv.find((_a, i) => argv[i - 1] === "--format") || "text";
|
|
200
|
+
const standard = argv.find((_a, i) => argv[i - 1] === "--standard") || "generic";
|
|
201
|
+
const periodStr = argv.find((_a, i) => argv[i - 1] === "--period");
|
|
202
|
+
const periodDays = periodStr ? parseInt(periodStr, 10) : 90;
|
|
203
|
+
const bundle = generateBundle(standard, periodDays);
|
|
204
|
+
// Export
|
|
205
|
+
const outputDir = argv.find((_a, i) => argv[i - 1] === "--output");
|
|
206
|
+
if (outputDir) {
|
|
207
|
+
exportBundle(bundle, outputDir);
|
|
208
|
+
console.log(` ✅ Audit bundle exported to ${outputDir}/`);
|
|
209
|
+
console.log(` Standard: ${standard}, Coverage: ${bundle.summary.coveragePercent}%`);
|
|
210
|
+
console.log(` ${bundle.summary.present} present, ${bundle.summary.missing} missing`);
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
// Check or display
|
|
214
|
+
if (format === "json") {
|
|
215
|
+
console.log(JSON.stringify(bundle, null, 2));
|
|
216
|
+
}
|
|
217
|
+
else {
|
|
218
|
+
console.log(`\n Audit Evidence — ${standard.toUpperCase()} (${bundle.period})\n ────────────────────────────────────`);
|
|
219
|
+
console.log(` Coverage: ${bundle.summary.coveragePercent}% (${bundle.summary.present}/${bundle.summary.present + bundle.summary.missing})\n`);
|
|
220
|
+
for (const a of bundle.artifacts) {
|
|
221
|
+
const icon = a.present ? "✅" : "❌";
|
|
222
|
+
const controls = (a.controlMapping || []).slice(0, 2).join(", ");
|
|
223
|
+
console.log(` ${icon} ${a.type.padEnd(22)} ${controls}`);
|
|
224
|
+
}
|
|
225
|
+
const missing = bundle.artifacts.filter((a) => !a.present);
|
|
226
|
+
if (missing.length > 0) {
|
|
227
|
+
console.log(`\n Missing (${missing.length}):`);
|
|
228
|
+
for (const m of missing) {
|
|
229
|
+
console.log(` ⚠️ ${m.description} (${m.source})`);
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
console.log("");
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
//# sourceMappingURL=audit-bundle.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audit-bundle.js","sourceRoot":"","sources":["../../src/commands/audit-bundle.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,Y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AK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;gBACxB,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,WAAW,KAAK,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;QACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Code owner suggest — auto-recommend CODEOWNERS entries
|
|
3
|
+
* based on finding patterns and resolution history.
|
|
4
|
+
*
|
|
5
|
+
* All analysis uses local data only.
|
|
6
|
+
*/
|
|
7
|
+
interface OwnerSuggestion {
|
|
8
|
+
path: string;
|
|
9
|
+
suggestedOwner: string;
|
|
10
|
+
reason: string;
|
|
11
|
+
confidence: number;
|
|
12
|
+
ruleCategories: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function suggestOwner(path: string, author: string, ruleCategories: string[]): OwnerSuggestion;
|
|
15
|
+
export declare function runCodeOwnerSuggest(argv: string[]): void;
|
|
16
|
+
export {};
|
|
17
|
+
//# sourceMappingURL=code-owner-suggest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"code-owner-suggest.d.ts","sourceRoot":"","sources":["../../src/commands/code-owner-suggest.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,UAAU,eAAe;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,EAAE,CAAC;CAC1B;AAuDD,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,EAAE,GAAG,eAAe,CAkBpG;AAwBD,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,CA2HxD"}
|