project-shield 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/README.md +440 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +151 -0
- package/dist/index.js.map +1 -0
- package/dist/integrity/failsafe.d.ts +17 -0
- package/dist/integrity/failsafe.d.ts.map +1 -0
- package/dist/integrity/failsafe.js +45 -0
- package/dist/integrity/failsafe.js.map +1 -0
- package/dist/integrity/ruleset.d.ts +12 -0
- package/dist/integrity/ruleset.d.ts.map +1 -0
- package/dist/integrity/ruleset.js +77 -0
- package/dist/integrity/ruleset.js.map +1 -0
- package/dist/integrity/seal.d.ts +12 -0
- package/dist/integrity/seal.d.ts.map +1 -0
- package/dist/integrity/seal.js +77 -0
- package/dist/integrity/seal.js.map +1 -0
- package/dist/output/badge.d.ts +16 -0
- package/dist/output/badge.d.ts.map +1 -0
- package/dist/output/badge.js +112 -0
- package/dist/output/badge.js.map +1 -0
- package/dist/output/evidence.d.ts +18 -0
- package/dist/output/evidence.d.ts.map +1 -0
- package/dist/output/evidence.js +205 -0
- package/dist/output/evidence.js.map +1 -0
- package/dist/output/fixit.d.ts +32 -0
- package/dist/output/fixit.d.ts.map +1 -0
- package/dist/output/fixit.js +387 -0
- package/dist/output/fixit.js.map +1 -0
- package/dist/output/terminal.d.ts +10 -0
- package/dist/output/terminal.d.ts.map +1 -0
- package/dist/output/terminal.js +190 -0
- package/dist/output/terminal.js.map +1 -0
- package/dist/scanner/engine.d.ts +6 -0
- package/dist/scanner/engine.d.ts.map +1 -0
- package/dist/scanner/engine.js +155 -0
- package/dist/scanner/engine.js.map +1 -0
- package/dist/scanner/ignore.d.ts +20 -0
- package/dist/scanner/ignore.d.ts.map +1 -0
- package/dist/scanner/ignore.js +125 -0
- package/dist/scanner/ignore.js.map +1 -0
- package/dist/scanner/injection.d.ts +15 -0
- package/dist/scanner/injection.d.ts.map +1 -0
- package/dist/scanner/injection.js +234 -0
- package/dist/scanner/injection.js.map +1 -0
- package/dist/scanner/mcp.d.ts +6 -0
- package/dist/scanner/mcp.d.ts.map +1 -0
- package/dist/scanner/mcp.js +322 -0
- package/dist/scanner/mcp.js.map +1 -0
- package/dist/scanner/pii.d.ts +21 -0
- package/dist/scanner/pii.d.ts.map +1 -0
- package/dist/scanner/pii.js +161 -0
- package/dist/scanner/pii.js.map +1 -0
- package/dist/scanner/secrets.d.ts +10 -0
- package/dist/scanner/secrets.d.ts.map +1 -0
- package/dist/scanner/secrets.js +224 -0
- package/dist/scanner/secrets.js.map +1 -0
- package/dist/scoring/lock.d.ts +12 -0
- package/dist/scoring/lock.d.ts.map +1 -0
- package/dist/scoring/lock.js +58 -0
- package/dist/scoring/lock.js.map +1 -0
- package/dist/scoring/score.d.ts +14 -0
- package/dist/scoring/score.d.ts.map +1 -0
- package/dist/scoring/score.js +74 -0
- package/dist/scoring/score.js.map +1 -0
- package/dist/types/index.d.ts +205 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +52 -0
- package/rules/v1.0.0.json +248 -0
|
@@ -0,0 +1,387 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getFixitGuides = getFixitGuides;
|
|
4
|
+
exports.formatFixitTerminal = formatFixitTerminal;
|
|
5
|
+
exports.formatFixitJson = formatFixitJson;
|
|
6
|
+
/**
|
|
7
|
+
* Fix-it guide database: 10 types covering secrets, PII, MCP, and injection.
|
|
8
|
+
*/
|
|
9
|
+
const FIXIT_GUIDES = {
|
|
10
|
+
aws_access_key: {
|
|
11
|
+
title: 'Rotate AWS Access Key',
|
|
12
|
+
steps: [
|
|
13
|
+
'Go to AWS IAM Console → Users → Security credentials',
|
|
14
|
+
'Create a new access key pair',
|
|
15
|
+
'Update all services using the old key',
|
|
16
|
+
'Deactivate the old access key',
|
|
17
|
+
'Delete the old access key after confirming everything works',
|
|
18
|
+
'Store new keys in AWS Secrets Manager or environment variables',
|
|
19
|
+
],
|
|
20
|
+
code: `# Using AWS CLI to rotate keys
|
|
21
|
+
aws iam create-access-key --user-name YOUR_USER
|
|
22
|
+
aws iam update-access-key --access-key-id OLD_KEY_ID --status Inactive
|
|
23
|
+
aws iam delete-access-key --access-key-id OLD_KEY_ID`,
|
|
24
|
+
severity: 'critical',
|
|
25
|
+
references: [
|
|
26
|
+
'https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_access-keys.html',
|
|
27
|
+
'https://docs.aws.amazon.com/secretsmanager/latest/userguide/intro.html',
|
|
28
|
+
],
|
|
29
|
+
},
|
|
30
|
+
stripe_live_key: {
|
|
31
|
+
title: 'Rotate Stripe Live Key',
|
|
32
|
+
steps: [
|
|
33
|
+
'Go to Stripe Dashboard → Developers → API keys',
|
|
34
|
+
'Click "Roll key" on the exposed live key',
|
|
35
|
+
'Update your application with the new key',
|
|
36
|
+
'Use environment variables, never hardcode keys',
|
|
37
|
+
],
|
|
38
|
+
code: `# Store in environment variable
|
|
39
|
+
export STRIPE_SECRET_KEY=sk_live_new_key_here
|
|
40
|
+
|
|
41
|
+
# In your app, read from env
|
|
42
|
+
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY);`,
|
|
43
|
+
severity: 'critical',
|
|
44
|
+
references: [
|
|
45
|
+
'https://stripe.com/docs/keys',
|
|
46
|
+
'https://stripe.com/docs/security',
|
|
47
|
+
],
|
|
48
|
+
},
|
|
49
|
+
private_key_file: {
|
|
50
|
+
title: 'Remove Private Key from Repository',
|
|
51
|
+
steps: [
|
|
52
|
+
'Remove the private key file from the repository immediately',
|
|
53
|
+
'Add the file pattern to .gitignore',
|
|
54
|
+
'Generate a new key pair (the exposed key is compromised)',
|
|
55
|
+
'Revoke the old key from all services that used it',
|
|
56
|
+
'Use a secrets manager for key storage',
|
|
57
|
+
],
|
|
58
|
+
code: `# Remove from git history
|
|
59
|
+
git rm --cached path/to/private_key.pem
|
|
60
|
+
echo "*.pem" >> .gitignore
|
|
61
|
+
echo "*.key" >> .gitignore
|
|
62
|
+
|
|
63
|
+
# Generate new key
|
|
64
|
+
openssl genrsa -out new_private_key.pem 4096`,
|
|
65
|
+
severity: 'critical',
|
|
66
|
+
references: [
|
|
67
|
+
'https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository',
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
generic_secret: {
|
|
71
|
+
title: 'Remove Hardcoded Secret',
|
|
72
|
+
steps: [
|
|
73
|
+
'Move the secret to an environment variable or secrets manager',
|
|
74
|
+
'Update code to read from the environment',
|
|
75
|
+
'Add the file to .gitignore if it contains secrets',
|
|
76
|
+
'Rotate the exposed secret',
|
|
77
|
+
],
|
|
78
|
+
code: `# .env file (add to .gitignore!)
|
|
79
|
+
SECRET_VALUE=your_secret_here
|
|
80
|
+
|
|
81
|
+
# In your code
|
|
82
|
+
const secret = process.env.SECRET_VALUE;`,
|
|
83
|
+
severity: 'warning',
|
|
84
|
+
references: [
|
|
85
|
+
'https://12factor.net/config',
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
korean_rrn: {
|
|
89
|
+
title: 'Remove Korean Resident Registration Number',
|
|
90
|
+
steps: [
|
|
91
|
+
'Remove or mask the RRN immediately (법적 의무사항)',
|
|
92
|
+
'Replace with a masked version: 900101-1******',
|
|
93
|
+
'If this is test data, use the official test RRN range',
|
|
94
|
+
'Review data handling for 개인정보보호법 compliance',
|
|
95
|
+
],
|
|
96
|
+
code: `// Masking function
|
|
97
|
+
function maskRRN(rrn: string): string {
|
|
98
|
+
return rrn.replace(/(\\d{6}[-]?\\d)\\d{6}/, '$1******');
|
|
99
|
+
}`,
|
|
100
|
+
severity: 'critical',
|
|
101
|
+
references: [
|
|
102
|
+
'https://www.law.go.kr/법령/개인정보보호법',
|
|
103
|
+
],
|
|
104
|
+
},
|
|
105
|
+
credit_card: {
|
|
106
|
+
title: 'Remove Credit Card Number',
|
|
107
|
+
steps: [
|
|
108
|
+
'Remove the credit card number from source code immediately',
|
|
109
|
+
'If this is test data, use standard test card numbers (4111 1111 1111 1111)',
|
|
110
|
+
'Never store full card numbers — use tokenization',
|
|
111
|
+
'Review PCI-DSS compliance requirements',
|
|
112
|
+
],
|
|
113
|
+
code: `// Use test card numbers for development
|
|
114
|
+
const TEST_CARDS = {
|
|
115
|
+
visa: '4111111111111111',
|
|
116
|
+
mastercard: '5555555555554444',
|
|
117
|
+
};`,
|
|
118
|
+
severity: 'critical',
|
|
119
|
+
references: [
|
|
120
|
+
'https://www.pcisecuritystandards.org/',
|
|
121
|
+
],
|
|
122
|
+
},
|
|
123
|
+
mcp_no_auth: {
|
|
124
|
+
title: 'Add Authentication to MCP Configuration',
|
|
125
|
+
steps: [
|
|
126
|
+
'Add an auth/authentication section to your MCP config',
|
|
127
|
+
'Use OAuth 2.0 or API key authentication',
|
|
128
|
+
'Never expose MCP endpoints without authentication',
|
|
129
|
+
],
|
|
130
|
+
code: `{
|
|
131
|
+
"auth": {
|
|
132
|
+
"type": "oauth2",
|
|
133
|
+
"clientId": "\${MCP_CLIENT_ID}",
|
|
134
|
+
"clientSecret": "\${MCP_CLIENT_SECRET}"
|
|
135
|
+
}
|
|
136
|
+
}`,
|
|
137
|
+
severity: 'critical',
|
|
138
|
+
references: [
|
|
139
|
+
'https://modelcontextprotocol.io/docs/concepts/authentication',
|
|
140
|
+
],
|
|
141
|
+
},
|
|
142
|
+
mcp_hardcoded_secret: {
|
|
143
|
+
title: 'Remove Hardcoded Secrets from MCP Config',
|
|
144
|
+
steps: [
|
|
145
|
+
'Replace hardcoded secrets with environment variable references',
|
|
146
|
+
'Use ${ENV_VAR} syntax in MCP configuration',
|
|
147
|
+
'Store actual values in .env (added to .gitignore)',
|
|
148
|
+
],
|
|
149
|
+
code: `// Before (BAD)
|
|
150
|
+
{ "apiKey": "sk-live-abc123" }
|
|
151
|
+
|
|
152
|
+
// After (GOOD)
|
|
153
|
+
{ "apiKey": "\${OPENAI_API_KEY}" }`,
|
|
154
|
+
severity: 'critical',
|
|
155
|
+
},
|
|
156
|
+
mcp_wide_permissions: {
|
|
157
|
+
title: 'Restrict MCP Permissions',
|
|
158
|
+
steps: [
|
|
159
|
+
'Apply principle of least privilege',
|
|
160
|
+
'Replace wildcard (*) and root (/) paths with specific paths',
|
|
161
|
+
'Limit network access to required endpoints only',
|
|
162
|
+
'Remove --privileged mode if not absolutely necessary',
|
|
163
|
+
],
|
|
164
|
+
code: `// Before (BAD)
|
|
165
|
+
{ "allowedPaths": ["/"] }
|
|
166
|
+
|
|
167
|
+
// After (GOOD)
|
|
168
|
+
{ "allowedPaths": ["/home/user/project"] }`,
|
|
169
|
+
severity: 'critical',
|
|
170
|
+
},
|
|
171
|
+
prompt_injection: {
|
|
172
|
+
title: 'Remove Prompt Injection Pattern',
|
|
173
|
+
steps: [
|
|
174
|
+
'Review the flagged content — is it legitimate documentation or an attack?',
|
|
175
|
+
'If in user-facing content: sanitize or remove the injection pattern',
|
|
176
|
+
'If in AI tool descriptions: ensure descriptions are concise and factual',
|
|
177
|
+
'Add input validation for any user-provided text that reaches AI models',
|
|
178
|
+
],
|
|
179
|
+
code: `// Input sanitization example
|
|
180
|
+
function sanitizeForAI(input: string): string {
|
|
181
|
+
// Remove common injection patterns
|
|
182
|
+
return input
|
|
183
|
+
.replace(/ignore\\s+(all\\s+)?previous\\s+instructions/gi, '[FILTERED]')
|
|
184
|
+
.replace(/you\\s+are\\s+now/gi, '[FILTERED]');
|
|
185
|
+
}`,
|
|
186
|
+
severity: 'critical',
|
|
187
|
+
references: [
|
|
188
|
+
'https://owasp.org/www-project-top-10-for-large-language-model-applications/',
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
};
|
|
192
|
+
/**
|
|
193
|
+
* Map a finding to a fix-it guide key.
|
|
194
|
+
*/
|
|
195
|
+
function mapFindingToGuideKey(findingType) {
|
|
196
|
+
// Direct mappings
|
|
197
|
+
if (findingType === 'aws_access_key')
|
|
198
|
+
return 'aws_access_key';
|
|
199
|
+
if (findingType === 'stripe_live')
|
|
200
|
+
return 'stripe_live_key';
|
|
201
|
+
if (findingType === 'private_key')
|
|
202
|
+
return 'private_key_file';
|
|
203
|
+
if (findingType === 'korean_rrn_hyphen' || findingType === 'korean_rrn_no_hyphen')
|
|
204
|
+
return 'korean_rrn';
|
|
205
|
+
if (findingType === 'credit_card')
|
|
206
|
+
return 'credit_card';
|
|
207
|
+
// MCP mappings
|
|
208
|
+
if (findingType === 'mcp_no_auth')
|
|
209
|
+
return 'mcp_no_auth';
|
|
210
|
+
if (findingType === 'mcp_hardcoded_secret')
|
|
211
|
+
return 'mcp_hardcoded_secret';
|
|
212
|
+
if (findingType === 'mcp_wide_permissions')
|
|
213
|
+
return 'mcp_wide_permissions';
|
|
214
|
+
// Injection
|
|
215
|
+
if (findingType === 'prompt_injection')
|
|
216
|
+
return 'prompt_injection';
|
|
217
|
+
// Fallback
|
|
218
|
+
return 'generic_secret';
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Get fix-it guides for all findings in the scan result.
|
|
222
|
+
*/
|
|
223
|
+
function getFixitGuides(result, options) {
|
|
224
|
+
const entries = [];
|
|
225
|
+
// Secrets
|
|
226
|
+
for (const finding of result.secrets) {
|
|
227
|
+
const key = mapFindingToGuideKey(finding.type);
|
|
228
|
+
const guide = FIXIT_GUIDES[key];
|
|
229
|
+
if (guide) {
|
|
230
|
+
entries.push({
|
|
231
|
+
findingType: finding.type,
|
|
232
|
+
file: finding.file,
|
|
233
|
+
line: finding.line,
|
|
234
|
+
severity: finding.severity === 'critical' ? 'critical' : 'warning',
|
|
235
|
+
guide,
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
// PII
|
|
240
|
+
for (const finding of result.pii) {
|
|
241
|
+
const key = mapFindingToGuideKey(finding.type);
|
|
242
|
+
const guide = FIXIT_GUIDES[key];
|
|
243
|
+
if (guide) {
|
|
244
|
+
entries.push({
|
|
245
|
+
findingType: finding.type,
|
|
246
|
+
file: finding.file,
|
|
247
|
+
line: finding.line,
|
|
248
|
+
severity: finding.severity === 'confirmed' ? 'critical' : 'warning',
|
|
249
|
+
guide,
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// MCP
|
|
254
|
+
for (const finding of result.mcp) {
|
|
255
|
+
// Map each failed item to a guide
|
|
256
|
+
const items = finding.items;
|
|
257
|
+
if (items.auth.status === 'critical') {
|
|
258
|
+
entries.push({
|
|
259
|
+
findingType: 'mcp_no_auth',
|
|
260
|
+
file: finding.file,
|
|
261
|
+
line: 0,
|
|
262
|
+
severity: 'critical',
|
|
263
|
+
guide: FIXIT_GUIDES['mcp_no_auth'],
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
if (items.secrets.status === 'critical') {
|
|
267
|
+
entries.push({
|
|
268
|
+
findingType: 'mcp_hardcoded_secret',
|
|
269
|
+
file: finding.file,
|
|
270
|
+
line: 0,
|
|
271
|
+
severity: 'critical',
|
|
272
|
+
guide: FIXIT_GUIDES['mcp_hardcoded_secret'],
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
if (items.permissions.status === 'critical') {
|
|
276
|
+
entries.push({
|
|
277
|
+
findingType: 'mcp_wide_permissions',
|
|
278
|
+
file: finding.file,
|
|
279
|
+
line: 0,
|
|
280
|
+
severity: 'critical',
|
|
281
|
+
guide: FIXIT_GUIDES['mcp_wide_permissions'],
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
// Injection
|
|
286
|
+
for (const finding of result.injection) {
|
|
287
|
+
entries.push({
|
|
288
|
+
findingType: 'prompt_injection',
|
|
289
|
+
file: finding.file,
|
|
290
|
+
line: finding.line,
|
|
291
|
+
severity: finding.severity === 'critical' ? 'critical' : 'warning',
|
|
292
|
+
guide: FIXIT_GUIDES['prompt_injection'],
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
// Sort by severity (critical first)
|
|
296
|
+
entries.sort((a, b) => {
|
|
297
|
+
if (a.severity === 'critical' && b.severity !== 'critical')
|
|
298
|
+
return -1;
|
|
299
|
+
if (a.severity !== 'critical' && b.severity === 'critical')
|
|
300
|
+
return 1;
|
|
301
|
+
return 0;
|
|
302
|
+
});
|
|
303
|
+
// Free: top 3 only
|
|
304
|
+
if (!options.isPro) {
|
|
305
|
+
return entries.slice(0, 3);
|
|
306
|
+
}
|
|
307
|
+
return entries;
|
|
308
|
+
}
|
|
309
|
+
/**
|
|
310
|
+
* Format fix-it guides for terminal output.
|
|
311
|
+
*/
|
|
312
|
+
function formatFixitTerminal(guides, isPro) {
|
|
313
|
+
const lines = [];
|
|
314
|
+
const colors = {
|
|
315
|
+
red: (s) => `\x1b[31m${s}\x1b[0m`,
|
|
316
|
+
yellow: (s) => `\x1b[33m${s}\x1b[0m`,
|
|
317
|
+
cyan: (s) => `\x1b[36m${s}\x1b[0m`,
|
|
318
|
+
bold: (s) => `\x1b[1m${s}\x1b[0m`,
|
|
319
|
+
dim: (s) => `\x1b[2m${s}\x1b[0m`,
|
|
320
|
+
};
|
|
321
|
+
lines.push(colors.bold('━━━ Fix-it Guide ━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
322
|
+
lines.push('');
|
|
323
|
+
if (guides.length === 0) {
|
|
324
|
+
lines.push(' No issues to fix.');
|
|
325
|
+
lines.push('');
|
|
326
|
+
return lines.join('\n');
|
|
327
|
+
}
|
|
328
|
+
for (const entry of guides) {
|
|
329
|
+
const icon = entry.severity === 'critical' ? colors.red('CRITICAL') : colors.yellow('WARNING');
|
|
330
|
+
lines.push(` ${icon} ${colors.bold(entry.guide.title)}`);
|
|
331
|
+
lines.push(` ${colors.dim(`${entry.file}:${entry.line}`)}`);
|
|
332
|
+
if (isPro) {
|
|
333
|
+
// Pro: full steps + code + references
|
|
334
|
+
for (let i = 0; i < entry.guide.steps.length; i++) {
|
|
335
|
+
lines.push(` ${i + 1}. ${entry.guide.steps[i]}`);
|
|
336
|
+
}
|
|
337
|
+
if (entry.guide.code) {
|
|
338
|
+
lines.push('');
|
|
339
|
+
lines.push(colors.dim(' Code:'));
|
|
340
|
+
for (const codeLine of entry.guide.code.split('\n')) {
|
|
341
|
+
lines.push(` ${colors.cyan(codeLine)}`);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (entry.guide.references && entry.guide.references.length > 0) {
|
|
345
|
+
lines.push('');
|
|
346
|
+
lines.push(colors.dim(' References:'));
|
|
347
|
+
for (const ref of entry.guide.references) {
|
|
348
|
+
lines.push(` - ${ref}`);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
// Free: title + step 1 only
|
|
354
|
+
lines.push(` 1. ${entry.guide.steps[0]}`);
|
|
355
|
+
if (entry.guide.steps.length > 1) {
|
|
356
|
+
lines.push(colors.dim(` ... ${entry.guide.steps.length - 1} more steps (Pro)`));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
lines.push('');
|
|
360
|
+
}
|
|
361
|
+
if (!isPro) {
|
|
362
|
+
lines.push(colors.dim(` Showing 3 of ${guides.length} guides. Upgrade to Pro for all guides with code examples.`));
|
|
363
|
+
lines.push('');
|
|
364
|
+
}
|
|
365
|
+
return lines.join('\n');
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Format fix-it guides as JSON-compatible objects.
|
|
369
|
+
*/
|
|
370
|
+
function formatFixitJson(guides, isPro) {
|
|
371
|
+
return guides.map(entry => {
|
|
372
|
+
const base = {
|
|
373
|
+
findingType: entry.findingType,
|
|
374
|
+
file: entry.file,
|
|
375
|
+
line: entry.line,
|
|
376
|
+
severity: entry.severity,
|
|
377
|
+
title: entry.guide.title,
|
|
378
|
+
steps: isPro ? entry.guide.steps : [entry.guide.steps[0]],
|
|
379
|
+
};
|
|
380
|
+
if (isPro && entry.guide.code)
|
|
381
|
+
base.code = entry.guide.code;
|
|
382
|
+
if (isPro && entry.guide.references)
|
|
383
|
+
base.references = entry.guide.references;
|
|
384
|
+
return base;
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
//# sourceMappingURL=fixit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fixit.js","sourceRoot":"","sources":["../../src/output/fixit.ts"],"names":[],"mappings":";;AAwOA,wCA6FC;AAKD,kDA2DC;AAKD,0CAmCC;AAnaD;;GAEG;AACH,MAAM,YAAY,GAA+B;IAC/C,cAAc,EAAE;QACd,KAAK,EAAE,uBAAuB;QAC9B,KAAK,EAAE;YACL,sDAAsD;YACtD,8BAA8B;YAC9B,uCAAuC;YACvC,+BAA+B;YAC/B,6DAA6D;YAC7D,gEAAgE;SACjE;QACD,IAAI,EAAE;;;qDAG2C;QACjD,QAAQ,EAAE,UAAU;QACpB,UAAU,EAAE;YACV,kFAAkF;YAClF,wEAAwE;SACzE;KACF;IAED,eAAe,EAAE;QACf,KAAK,EAAE,wBAAwB;QAC/B,KAAK,EAAE;YACL,gDAAgD;YAChD,0CAA0C;YAC1C,0CAA0C;YAC1C,gDAAgD;SACjD;QACD,IAAI,EAAE;;;;0DAIgD;QACtD,QAAQ,EAAE,UAAU;QACpB,UAAU,EAAE;YACV,8BAA8B;YAC9B,kCAAkC;SACnC;KACF;IAED,gBAAgB,EAAE;QAChB,KAAK,EAAE,oCAAoC;QAC3C,KAAK,EAAE;YACL,6DAA6D;YAC7D,oCAAoC;YACpC,0DAA0D;YAC1D,mDAAmD;YACnD,uCAAuC;SACxC;QACD,IAAI,EAAE;;;;;;6CAMmC;QACzC,QAAQ,EAAE,UAAU;QACpB,UAAU,EAAE;YACV,0HAA0H;SAC3H;KACF;IAED,cAAc,EAAE;QACd,KAAK,EAAE,yBAAyB;QAChC,KAAK,EAAE;YACL,+DAA+D;YAC/D,0CAA0C;YAC1C,mDAAmD;YACnD,2BAA2B;SAC5B;QACD,IAAI,EAAE;;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AAC;QACF,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI;YAAE,IAAI,CAAC,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;QAC5D,IAAI,KAAK,IAAI,KAAK,CAAC,KAAK,CAAC,UAAU;YAAE,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,UAAU,CAAC;QAC9E,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ScanResult, ScanScore, LockStatus, SealedResult } from '../types/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Format scan results for terminal output.
|
|
4
|
+
*/
|
|
5
|
+
export declare function formatTerminalOutput(result: ScanResult, rulesetVersion: string, rulesetHash: string, score?: ScanScore, lockStatus?: LockStatus): string;
|
|
6
|
+
/**
|
|
7
|
+
* Format scan results as JSON.
|
|
8
|
+
*/
|
|
9
|
+
export declare function formatJsonOutput(result: ScanResult, score?: ScanScore, seal?: SealedResult): string;
|
|
10
|
+
//# sourceMappingURL=terminal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.d.ts","sourceRoot":"","sources":["../../src/output/terminal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EAKV,SAAS,EACT,UAAU,EACV,YAAY,EACb,MAAM,mBAAmB,CAAC;AAiG3B;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,UAAU,EAClB,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,SAAS,EACjB,UAAU,CAAC,EAAE,UAAU,GACtB,MAAM,CA+FR;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,UAAU,EAClB,KAAK,CAAC,EAAE,SAAS,EACjB,IAAI,CAAC,EAAE,YAAY,GAClB,MAAM,CASR"}
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatTerminalOutput = formatTerminalOutput;
|
|
4
|
+
exports.formatJsonOutput = formatJsonOutput;
|
|
5
|
+
// chalk v5 is ESM-only, so we use a simple color implementation for CJS compatibility
|
|
6
|
+
const colors = {
|
|
7
|
+
red: (s) => `\x1b[31m${s}\x1b[0m`,
|
|
8
|
+
yellow: (s) => `\x1b[33m${s}\x1b[0m`,
|
|
9
|
+
green: (s) => `\x1b[32m${s}\x1b[0m`,
|
|
10
|
+
cyan: (s) => `\x1b[36m${s}\x1b[0m`,
|
|
11
|
+
bold: (s) => `\x1b[1m${s}\x1b[0m`,
|
|
12
|
+
dim: (s) => `\x1b[2m${s}\x1b[0m`,
|
|
13
|
+
};
|
|
14
|
+
function formatSecretFinding(finding) {
|
|
15
|
+
const icon = finding.severity === 'critical' ? colors.red('CRITICAL') : colors.yellow('WARNING');
|
|
16
|
+
const location = colors.dim(`${finding.file}:${finding.line}`);
|
|
17
|
+
const layerInfo = [
|
|
18
|
+
`regex ${finding.layers.regex ? '✓' : '✗'}`,
|
|
19
|
+
`entropy ${finding.layers.entropy > 4.5 ? '✓' : '✗'}`,
|
|
20
|
+
`context ${finding.layers.context ? '✓' : '✗'}`,
|
|
21
|
+
].join(' ');
|
|
22
|
+
return [
|
|
23
|
+
` ${icon} ${location}`,
|
|
24
|
+
` ${finding.description} (${finding.matched})`,
|
|
25
|
+
` Layers: ${layerInfo}`,
|
|
26
|
+
].join('\n');
|
|
27
|
+
}
|
|
28
|
+
function formatPIIFinding(finding) {
|
|
29
|
+
const icon = finding.severity === 'confirmed'
|
|
30
|
+
? colors.red('CONFIRMED')
|
|
31
|
+
: colors.yellow('POSSIBLE');
|
|
32
|
+
const location = colors.dim(`${finding.file}:${finding.line}`);
|
|
33
|
+
const checksumStr = finding.layers.checksum === null
|
|
34
|
+
? 'N/A'
|
|
35
|
+
: finding.layers.checksum ? '✓' : '✗';
|
|
36
|
+
const layerInfo = [
|
|
37
|
+
`regex ${finding.layers.regex ? '✓' : '✗'}`,
|
|
38
|
+
`checksum ${checksumStr}`,
|
|
39
|
+
].join(' ');
|
|
40
|
+
return [
|
|
41
|
+
` ${icon} ${location}`,
|
|
42
|
+
` ${finding.description} (${finding.matched})`,
|
|
43
|
+
` Layers: ${layerInfo}`,
|
|
44
|
+
].join('\n');
|
|
45
|
+
}
|
|
46
|
+
function formatMCPFinding(finding) {
|
|
47
|
+
const severityLabel = finding.overallSeverity === 'critical'
|
|
48
|
+
? colors.red('CRITICAL')
|
|
49
|
+
: finding.overallSeverity === 'warning'
|
|
50
|
+
? colors.yellow('WARNING')
|
|
51
|
+
: colors.green('PASS');
|
|
52
|
+
const lines = [
|
|
53
|
+
` ${severityLabel} ${colors.dim(finding.file)} (${finding.failedCount}/5 failed)`,
|
|
54
|
+
];
|
|
55
|
+
const checks = [
|
|
56
|
+
{ name: 'Auth', item: finding.items.auth },
|
|
57
|
+
{ name: 'Secrets', item: finding.items.secrets },
|
|
58
|
+
{ name: 'Tool Meta', item: finding.items.toolMeta },
|
|
59
|
+
{ name: 'Permissions', item: finding.items.permissions },
|
|
60
|
+
{ name: 'Logging', item: finding.items.logging },
|
|
61
|
+
];
|
|
62
|
+
for (const check of checks) {
|
|
63
|
+
const icon = check.item.status === 'pass'
|
|
64
|
+
? colors.green('✓')
|
|
65
|
+
: check.item.status === 'critical'
|
|
66
|
+
? colors.red('✗')
|
|
67
|
+
: colors.yellow('!');
|
|
68
|
+
lines.push(` ${icon} ${check.name}: ${check.item.detail}`);
|
|
69
|
+
}
|
|
70
|
+
return lines.join('\n');
|
|
71
|
+
}
|
|
72
|
+
function formatInjectionFinding(finding) {
|
|
73
|
+
const icon = finding.severity === 'critical' ? colors.red('CRITICAL') : colors.yellow('WARNING');
|
|
74
|
+
const location = colors.dim(`${finding.file}:${finding.line}`);
|
|
75
|
+
const layerInfo = [
|
|
76
|
+
`keyword ${finding.layers.keyword ? '✓' : '✗'}`,
|
|
77
|
+
`structure ${finding.layers.structure ? '✓' : '✗'}`,
|
|
78
|
+
].join(' ');
|
|
79
|
+
return [
|
|
80
|
+
` ${icon} ${location}`,
|
|
81
|
+
` ${finding.description} [${finding.type}]`,
|
|
82
|
+
` Pattern: ${finding.pattern} | Layers: ${layerInfo}`,
|
|
83
|
+
` Context: "${finding.context}"`,
|
|
84
|
+
].join('\n');
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Format scan results for terminal output.
|
|
88
|
+
*/
|
|
89
|
+
function formatTerminalOutput(result, rulesetVersion, rulesetHash, score, lockStatus) {
|
|
90
|
+
const lines = [];
|
|
91
|
+
lines.push('');
|
|
92
|
+
lines.push(colors.bold('Project Shield v1.0.0'));
|
|
93
|
+
lines.push(`Ruleset: v${rulesetVersion} (SHA-256: ${rulesetHash.substring(0, 8)}...)`);
|
|
94
|
+
lines.push(`Scanning: ${result.summary.filesScanned} files (${result.summary.filesExcluded} excluded)`);
|
|
95
|
+
lines.push('');
|
|
96
|
+
// Secrets section
|
|
97
|
+
lines.push(colors.bold('━━━ Secrets ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
98
|
+
lines.push('');
|
|
99
|
+
if (result.secrets.length === 0) {
|
|
100
|
+
lines.push(colors.green(' No secrets detected.'));
|
|
101
|
+
}
|
|
102
|
+
else {
|
|
103
|
+
for (const finding of result.secrets) {
|
|
104
|
+
lines.push(formatSecretFinding(finding));
|
|
105
|
+
lines.push('');
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
// PII section
|
|
109
|
+
lines.push(colors.bold('━━━ PII ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
110
|
+
lines.push('');
|
|
111
|
+
if (result.pii.length === 0) {
|
|
112
|
+
lines.push(colors.green(' No PII detected.'));
|
|
113
|
+
}
|
|
114
|
+
else {
|
|
115
|
+
for (const finding of result.pii) {
|
|
116
|
+
lines.push(formatPIIFinding(finding));
|
|
117
|
+
lines.push('');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
// MCP section
|
|
121
|
+
lines.push(colors.bold('━━━ MCP Config ━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
122
|
+
lines.push('');
|
|
123
|
+
if (result.mcp.length === 0) {
|
|
124
|
+
lines.push(colors.green(' No MCP configuration files found.'));
|
|
125
|
+
}
|
|
126
|
+
else {
|
|
127
|
+
for (const finding of result.mcp) {
|
|
128
|
+
lines.push(formatMCPFinding(finding));
|
|
129
|
+
lines.push('');
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// Injection section
|
|
133
|
+
lines.push(colors.bold('━━━ Injection ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
134
|
+
lines.push('');
|
|
135
|
+
if (result.injection.length === 0) {
|
|
136
|
+
lines.push(colors.green(' No injection patterns detected.'));
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
for (const finding of result.injection) {
|
|
140
|
+
lines.push(formatInjectionFinding(finding));
|
|
141
|
+
lines.push('');
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// Summary section
|
|
145
|
+
lines.push(colors.bold('━━━ Summary ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
146
|
+
lines.push('');
|
|
147
|
+
lines.push(` Critical: ${result.summary.critical} | Warning: ${result.summary.warning} | Confirmed PII: ${result.summary.confirmedPii} | Possible PII: ${result.summary.possiblePii}`);
|
|
148
|
+
lines.push(` MCP Critical: ${result.summary.mcpCritical} | MCP Warning: ${result.summary.mcpWarning}`);
|
|
149
|
+
lines.push(` Injection Critical: ${result.summary.injectionCritical} | Injection Warning: ${result.summary.injectionWarning}`);
|
|
150
|
+
lines.push(` Files scanned: ${result.summary.filesScanned} | Time: ${(result.summary.timeMs / 1000).toFixed(1)}s`);
|
|
151
|
+
lines.push('');
|
|
152
|
+
// Score section
|
|
153
|
+
if (score) {
|
|
154
|
+
lines.push(colors.bold('━━━ Score ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━'));
|
|
155
|
+
lines.push('');
|
|
156
|
+
const gradeColor = score.grade === 'A' || score.grade === 'B'
|
|
157
|
+
? colors.green
|
|
158
|
+
: score.grade === 'C'
|
|
159
|
+
? colors.yellow
|
|
160
|
+
: colors.red;
|
|
161
|
+
lines.push(` Grade: ${gradeColor(score.grade)} (${score.numericScore}/100) — ${score.label}`);
|
|
162
|
+
lines.push(` Breakdown: ${score.breakdown.criticalCount} critical, ${score.breakdown.warningCount} warning, ${score.breakdown.possibleCount} possible, ${score.breakdown.infoCount} info`);
|
|
163
|
+
lines.push('');
|
|
164
|
+
// Lock status
|
|
165
|
+
if (lockStatus) {
|
|
166
|
+
if (lockStatus.isLocked) {
|
|
167
|
+
lines.push(colors.red(` Badge generation LOCKED — Fix all critical findings first.`));
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
lines.push(colors.green(` Badge: ${lockStatus.badgeType} badge available.`));
|
|
171
|
+
}
|
|
172
|
+
lines.push('');
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
return lines.join('\n');
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Format scan results as JSON.
|
|
179
|
+
*/
|
|
180
|
+
function formatJsonOutput(result, score, seal) {
|
|
181
|
+
const output = { ...result };
|
|
182
|
+
if (score) {
|
|
183
|
+
output.score = score;
|
|
184
|
+
}
|
|
185
|
+
if (seal) {
|
|
186
|
+
output.seal = seal;
|
|
187
|
+
}
|
|
188
|
+
return JSON.stringify(output, null, 2);
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=terminal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terminal.js","sourceRoot":"","sources":["../../src/output/terminal.ts"],"names":[],"mappings":";;AA6GA,oDAqGC;AAKD,4CAaC;AAzND,sFAAsF;AACtF,MAAM,MAAM,GAAG;IACb,GAAG,EA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