circle-ir 3.25.0 → 3.28.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/analysis/passes/scan-secrets-pass.d.ts +60 -0
- package/dist/analysis/passes/scan-secrets-pass.d.ts.map +1 -0
- package/dist/analysis/passes/scan-secrets-pass.js +345 -0
- package/dist/analysis/passes/scan-secrets-pass.js.map +1 -0
- package/dist/analyzer.d.ts +1 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/analyzer.js +272 -249
- package/dist/analyzer.js.map +1 -1
- package/dist/browser/circle-ir.js +507 -213
- package/dist/core/circle-ir-core.cjs +17 -1
- package/dist/core/circle-ir-core.js +17 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/parser.d.ts +19 -1
- package/dist/core/parser.d.ts.map +1 -1
- package/dist/core/parser.js +53 -2
- package/dist/core/parser.js.map +1 -1
- package/dist/graph/analysis-pass.d.ts +10 -0
- package/dist/graph/analysis-pass.d.ts.map +1 -1
- package/dist/graph/analysis-pass.js +3 -0
- package/dist/graph/analysis-pass.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pass #90: scan-secrets (category: security, CWE-798)
|
|
3
|
+
*
|
|
4
|
+
* Detects hardcoded credentials across all 7 supported languages
|
|
5
|
+
* (Java, JS/TS, Python, Go, Rust, Bash, HTML).
|
|
6
|
+
*
|
|
7
|
+
* Two detection layers:
|
|
8
|
+
*
|
|
9
|
+
* 1. Provider-specific regex patterns. ~16 high-confidence prefixes /
|
|
10
|
+
* shapes (AWS AKIA, GitHub `ghp_`/`gho_`/`ghs_`/`ghu_`/`ghr_`,
|
|
11
|
+
* Stripe `sk_live_`/`pk_live_`, OpenAI `sk-`, Anthropic `sk-ant-`,
|
|
12
|
+
* Slack `xox[baprs]-`, Google `AIza`, JWT `eyJ..eyJ..`, PEM private
|
|
13
|
+
* keys, npm `npm_`). Each match emits a finding with
|
|
14
|
+
* `rule_id: 'hardcoded-credential'` (matches the legacy Bash
|
|
15
|
+
* detection in LanguageSourcesPass).
|
|
16
|
+
*
|
|
17
|
+
* 2. Shannon-entropy scan of inline string literals. For each
|
|
18
|
+
* base64-shaped or hex-shaped quoted string above the length gate,
|
|
19
|
+
* compute Shannon entropy; flag if it crosses the per-shape
|
|
20
|
+
* threshold. Heavily denylisted (UUIDs, bare SHA hashes, common
|
|
21
|
+
* placeholders like "changeme" / "your-key-here", env-var refs)
|
|
22
|
+
* and gated against test-file paths. Emits
|
|
23
|
+
* `rule_id: 'hardcoded-credential-entropy'` (distinct rule so users
|
|
24
|
+
* can filter the noisier entropy branch without losing provider
|
|
25
|
+
* coverage).
|
|
26
|
+
*
|
|
27
|
+
* Both layers dedupe against any prior `hardcoded-credential` /
|
|
28
|
+
* `hardcoded-credential-entropy` findings already in the pipeline's
|
|
29
|
+
* findings buffer, so the pre-existing Bash detection
|
|
30
|
+
* (`findBashPatternFindings` in language-sources-pass.ts) is never
|
|
31
|
+
* double-reported.
|
|
32
|
+
*
|
|
33
|
+
* Test files (path-based heuristic) are skipped entirely.
|
|
34
|
+
*
|
|
35
|
+
* Detection is regex-based on the raw source text, so the pass works
|
|
36
|
+
* on every language without per-grammar tree walking. This is the same
|
|
37
|
+
* approach used by `language-sources-pass.findBashPatternFindings` and
|
|
38
|
+
* `todo-in-prod-pass`.
|
|
39
|
+
*/
|
|
40
|
+
import type { AnalysisPass, PassContext } from '../../graph/analysis-pass.js';
|
|
41
|
+
export interface ScanSecretsPassResult {
|
|
42
|
+
/** Number of findings emitted in each layer (for debugging / tests). */
|
|
43
|
+
providerFindings: number;
|
|
44
|
+
entropyFindings: number;
|
|
45
|
+
}
|
|
46
|
+
export declare class ScanSecretsPass implements AnalysisPass<ScanSecretsPassResult> {
|
|
47
|
+
readonly name = "scan-secrets";
|
|
48
|
+
readonly category: "security";
|
|
49
|
+
run(ctx: PassContext): ScanSecretsPassResult;
|
|
50
|
+
/** Length + shape + denylist filter before entropy is computed. */
|
|
51
|
+
private isCandidate;
|
|
52
|
+
/**
|
|
53
|
+
* Shannon-entropy gate. Base64-shaped strings need higher entropy than
|
|
54
|
+
* hex-shaped (hex alphabet is 4 bits/char by construction). When the
|
|
55
|
+
* surrounding line contains a credential-shaped variable name, both
|
|
56
|
+
* thresholds drop by 0.2 bits/char.
|
|
57
|
+
*/
|
|
58
|
+
private passesEntropyGate;
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=scan-secrets-pass.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-secrets-pass.d.ts","sourceRoot":"","sources":["../../../src/analysis/passes/scan-secrets-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AA2M9E,MAAM,WAAW,qBAAqB;IACpC,wEAAwE;IACxE,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,qBAAa,eAAgB,YAAW,YAAY,CAAC,qBAAqB,CAAC;IACzE,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,QAAQ,EAAG,UAAU,CAAU;IAExC,GAAG,CAAC,GAAG,EAAE,WAAW,GAAG,qBAAqB;IAoG5C,mEAAmE;IACnE,OAAO,CAAC,WAAW;IAanB;;;;;OAKG;IACH,OAAO,CAAC,iBAAiB;CAO1B"}
|
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pass #90: scan-secrets (category: security, CWE-798)
|
|
3
|
+
*
|
|
4
|
+
* Detects hardcoded credentials across all 7 supported languages
|
|
5
|
+
* (Java, JS/TS, Python, Go, Rust, Bash, HTML).
|
|
6
|
+
*
|
|
7
|
+
* Two detection layers:
|
|
8
|
+
*
|
|
9
|
+
* 1. Provider-specific regex patterns. ~16 high-confidence prefixes /
|
|
10
|
+
* shapes (AWS AKIA, GitHub `ghp_`/`gho_`/`ghs_`/`ghu_`/`ghr_`,
|
|
11
|
+
* Stripe `sk_live_`/`pk_live_`, OpenAI `sk-`, Anthropic `sk-ant-`,
|
|
12
|
+
* Slack `xox[baprs]-`, Google `AIza`, JWT `eyJ..eyJ..`, PEM private
|
|
13
|
+
* keys, npm `npm_`). Each match emits a finding with
|
|
14
|
+
* `rule_id: 'hardcoded-credential'` (matches the legacy Bash
|
|
15
|
+
* detection in LanguageSourcesPass).
|
|
16
|
+
*
|
|
17
|
+
* 2. Shannon-entropy scan of inline string literals. For each
|
|
18
|
+
* base64-shaped or hex-shaped quoted string above the length gate,
|
|
19
|
+
* compute Shannon entropy; flag if it crosses the per-shape
|
|
20
|
+
* threshold. Heavily denylisted (UUIDs, bare SHA hashes, common
|
|
21
|
+
* placeholders like "changeme" / "your-key-here", env-var refs)
|
|
22
|
+
* and gated against test-file paths. Emits
|
|
23
|
+
* `rule_id: 'hardcoded-credential-entropy'` (distinct rule so users
|
|
24
|
+
* can filter the noisier entropy branch without losing provider
|
|
25
|
+
* coverage).
|
|
26
|
+
*
|
|
27
|
+
* Both layers dedupe against any prior `hardcoded-credential` /
|
|
28
|
+
* `hardcoded-credential-entropy` findings already in the pipeline's
|
|
29
|
+
* findings buffer, so the pre-existing Bash detection
|
|
30
|
+
* (`findBashPatternFindings` in language-sources-pass.ts) is never
|
|
31
|
+
* double-reported.
|
|
32
|
+
*
|
|
33
|
+
* Test files (path-based heuristic) are skipped entirely.
|
|
34
|
+
*
|
|
35
|
+
* Detection is regex-based on the raw source text, so the pass works
|
|
36
|
+
* on every language without per-grammar tree walking. This is the same
|
|
37
|
+
* approach used by `language-sources-pass.findBashPatternFindings` and
|
|
38
|
+
* `todo-in-prod-pass`.
|
|
39
|
+
*/
|
|
40
|
+
// ---------------------------------------------------------------------------
|
|
41
|
+
// Test-file skip heuristic
|
|
42
|
+
// ---------------------------------------------------------------------------
|
|
43
|
+
/** Path components and filename suffixes that mark test/fixture files. */
|
|
44
|
+
const TEST_PATH_RE = /(?:^|[\\/])(?:test|tests|spec|specs|__tests?__|__mocks?__|fixtures?|testdata)(?:[\\/]|$)/i;
|
|
45
|
+
const TEST_FILENAME_RE = /(?:\.(?:test|spec)\.[cm]?[jt]sx?|_test\.go|_test\.py|Test\.java|Tests\.java)$/i;
|
|
46
|
+
function isTestFile(file) {
|
|
47
|
+
return TEST_PATH_RE.test(file) || TEST_FILENAME_RE.test(file);
|
|
48
|
+
}
|
|
49
|
+
const PROVIDER_PATTERNS = [
|
|
50
|
+
{
|
|
51
|
+
name: 'AWS access key',
|
|
52
|
+
regex: /\bAKIA[0-9A-Z]{16}\b/,
|
|
53
|
+
severity: 'critical', level: 'error',
|
|
54
|
+
fix: 'Rotate the AWS access key immediately and move it to an environment variable or AWS Secrets Manager.',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'GitHub personal access token',
|
|
58
|
+
regex: /\bghp_[A-Za-z0-9]{36}\b/,
|
|
59
|
+
severity: 'critical', level: 'error',
|
|
60
|
+
fix: 'Revoke the token at https://github.com/settings/tokens and store secrets in CI/CD secrets, not source.',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'GitHub OAuth token',
|
|
64
|
+
regex: /\bgho_[A-Za-z0-9]{36}\b/,
|
|
65
|
+
severity: 'critical', level: 'error',
|
|
66
|
+
fix: 'Revoke the OAuth token and store secrets outside source control.',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'GitHub user-to-server token',
|
|
70
|
+
regex: /\bghu_[A-Za-z0-9]{36}\b/,
|
|
71
|
+
severity: 'critical', level: 'error',
|
|
72
|
+
fix: 'Revoke the GitHub user-to-server token and store secrets outside source control.',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: 'GitHub server-to-server token',
|
|
76
|
+
regex: /\bghs_[A-Za-z0-9]{36}\b/,
|
|
77
|
+
severity: 'critical', level: 'error',
|
|
78
|
+
fix: 'Revoke the GitHub server-to-server token and store secrets outside source control.',
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: 'GitHub refresh token',
|
|
82
|
+
regex: /\bghr_[A-Za-z0-9]{36}\b/,
|
|
83
|
+
severity: 'critical', level: 'error',
|
|
84
|
+
fix: 'Revoke the GitHub refresh token and store secrets outside source control.',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: 'Stripe live secret key',
|
|
88
|
+
regex: /\bsk_live_[A-Za-z0-9]{24,}\b/,
|
|
89
|
+
severity: 'critical', level: 'error',
|
|
90
|
+
fix: 'Rotate the Stripe secret key in the Stripe Dashboard and load it from a secrets manager.',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: 'Stripe live publishable key',
|
|
94
|
+
regex: /\bpk_live_[A-Za-z0-9]{24,}\b/,
|
|
95
|
+
severity: 'high', level: 'warning',
|
|
96
|
+
fix: 'Publishable keys are not secret but should still not be checked in to back-end source files; verify front-end vs back-end context.',
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
name: 'OpenAI API key',
|
|
100
|
+
regex: /\bsk-[A-Za-z0-9]{48}\b/,
|
|
101
|
+
severity: 'critical', level: 'error',
|
|
102
|
+
fix: 'Revoke the OpenAI key at https://platform.openai.com/api-keys and load from environment.',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
name: 'Anthropic API key',
|
|
106
|
+
regex: /\bsk-ant-[A-Za-z0-9_-]{90,}\b/,
|
|
107
|
+
severity: 'critical', level: 'error',
|
|
108
|
+
fix: 'Revoke the Anthropic key in the Console and load from environment.',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'Slack token',
|
|
112
|
+
regex: /\bxox[baprs]-[A-Za-z0-9-]{10,}\b/,
|
|
113
|
+
severity: 'critical', level: 'error',
|
|
114
|
+
fix: 'Revoke the Slack token and load from environment.',
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
name: 'Google API key',
|
|
118
|
+
regex: /\bAIza[0-9A-Za-z_-]{35}\b/,
|
|
119
|
+
severity: 'critical', level: 'error',
|
|
120
|
+
fix: 'Restrict the Google API key by referrer / IP in the GCP console or revoke it.',
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
name: 'JSON Web Token',
|
|
124
|
+
regex: /\beyJ[A-Za-z0-9_-]{10,}\.eyJ[A-Za-z0-9_-]{10,}\.[A-Za-z0-9_-]{10,}\b/,
|
|
125
|
+
severity: 'critical', level: 'error',
|
|
126
|
+
fix: 'JWTs in source carry whatever scope they were minted with; rotate signing keys and remove the token.',
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
name: 'PEM private key',
|
|
130
|
+
regex: /-----BEGIN (?:RSA |EC |DSA |OPENSSH |PGP )?PRIVATE KEY-----/,
|
|
131
|
+
severity: 'critical', level: 'error',
|
|
132
|
+
fix: 'Remove the private key from source control immediately, rotate the corresponding public key, and store keys outside the repository.',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: 'npm access token',
|
|
136
|
+
regex: /\bnpm_[A-Za-z0-9]{36}\b/,
|
|
137
|
+
severity: 'critical', level: 'error',
|
|
138
|
+
fix: 'Revoke the npm token at https://www.npmjs.com/settings/<user>/tokens and load from environment.',
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
// ---------------------------------------------------------------------------
|
|
142
|
+
// Entropy patterns (layer 2)
|
|
143
|
+
// ---------------------------------------------------------------------------
|
|
144
|
+
/**
|
|
145
|
+
* Single-line string-literal extraction across languages.
|
|
146
|
+
* Matches "...", '...', `...`. Group 1: opening delimiter; Group 2: content.
|
|
147
|
+
*
|
|
148
|
+
* Intentionally does NOT try to parse escapes or multi-line strings —
|
|
149
|
+
* we want the literal-text content as the user wrote it, which is what
|
|
150
|
+
* Shannon entropy needs to see.
|
|
151
|
+
*/
|
|
152
|
+
const STRING_LITERAL_RE = /(["'`])((?:\\.|(?!\1).){8,200})\1/g;
|
|
153
|
+
const BASE64ISH_RE = /^[A-Za-z0-9+/=_-]+$/;
|
|
154
|
+
const HEXISH_RE = /^[a-fA-F0-9]+$/;
|
|
155
|
+
const UUID_RE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
|
|
156
|
+
const PLACEHOLDER_RE = /(?:changeme|your[-_]?(?:key|secret|token|password)(?:[-_]?here)?|replace[-_]?me|example[-_]?(?:key|secret|token)?|placeholder|todo|fixme|test[-_]?(?:key|secret|token)|fake[-_]?(?:key|secret|token)|dummy|sample|insert[-_]?your)/i;
|
|
157
|
+
/** Bare cryptographic-hash shapes (MD5 / SHA1 / SHA256) — high entropy but rarely a secret on their own. */
|
|
158
|
+
function isBareHashShape(s) {
|
|
159
|
+
const n = s.length;
|
|
160
|
+
if (n !== 32 && n !== 40 && n !== 64)
|
|
161
|
+
return false;
|
|
162
|
+
return HEXISH_RE.test(s);
|
|
163
|
+
}
|
|
164
|
+
function isAllSameChar(s) {
|
|
165
|
+
if (s.length < 2)
|
|
166
|
+
return false;
|
|
167
|
+
const c = s.charAt(0);
|
|
168
|
+
for (let i = 1; i < s.length; i++)
|
|
169
|
+
if (s.charAt(i) !== c)
|
|
170
|
+
return false;
|
|
171
|
+
return true;
|
|
172
|
+
}
|
|
173
|
+
/** Decode base64 best-effort; return decoded text or null. Universal (no Node Buffer). */
|
|
174
|
+
function tryBase64Decode(s) {
|
|
175
|
+
// Quick reject: base64 length must be a multiple of 4 when padded.
|
|
176
|
+
if (s.length % 4 !== 0 && !/=+$/.test(s))
|
|
177
|
+
return null;
|
|
178
|
+
try {
|
|
179
|
+
return globalThis.atob(s);
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/** True if the base64 decodes to something that starts with `{` or `[` (i.e. JSON). */
|
|
186
|
+
function looksLikeBase64Json(s) {
|
|
187
|
+
const decoded = tryBase64Decode(s);
|
|
188
|
+
if (!decoded)
|
|
189
|
+
return false;
|
|
190
|
+
const trimmed = decoded.trimStart();
|
|
191
|
+
return trimmed.startsWith('{') || trimmed.startsWith('[');
|
|
192
|
+
}
|
|
193
|
+
function shannonEntropy(s) {
|
|
194
|
+
const freq = new Map();
|
|
195
|
+
for (const ch of s)
|
|
196
|
+
freq.set(ch, (freq.get(ch) ?? 0) + 1);
|
|
197
|
+
const len = s.length;
|
|
198
|
+
let h = 0;
|
|
199
|
+
for (const n of freq.values()) {
|
|
200
|
+
const p = n / len;
|
|
201
|
+
h -= p * Math.log2(p);
|
|
202
|
+
}
|
|
203
|
+
return h;
|
|
204
|
+
}
|
|
205
|
+
/** Words near the literal that imply credential context — used to lower the entropy threshold. */
|
|
206
|
+
const CREDENTIAL_NAME_RE = /(?:key|secret|token|password|passwd|credential|api[_-]?key)/i;
|
|
207
|
+
// ---------------------------------------------------------------------------
|
|
208
|
+
// Per-line FP-guard substrings (entropy layer only)
|
|
209
|
+
// ---------------------------------------------------------------------------
|
|
210
|
+
const TEST_CALL_RE = /\b(?:expect|assert|describe|it|test)\s*\(/;
|
|
211
|
+
const COMMENT_EXAMPLE_RE = /(?:\/\/|#)\s*(?:example|sample|test|fixture)/i;
|
|
212
|
+
export class ScanSecretsPass {
|
|
213
|
+
name = 'scan-secrets';
|
|
214
|
+
category = 'security';
|
|
215
|
+
run(ctx) {
|
|
216
|
+
const file = ctx.graph.ir.meta.file;
|
|
217
|
+
if (isTestFile(file)) {
|
|
218
|
+
return { providerFindings: 0, entropyFindings: 0 };
|
|
219
|
+
}
|
|
220
|
+
const lines = ctx.code.split('\n');
|
|
221
|
+
const prior = ctx.getFindings?.() ?? [];
|
|
222
|
+
// Build dedup index keyed on `${line}:${rule_id}` for O(1) lookup.
|
|
223
|
+
const seen = new Set();
|
|
224
|
+
for (const f of prior) {
|
|
225
|
+
if (f.file !== file)
|
|
226
|
+
continue;
|
|
227
|
+
if (f.rule_id === 'hardcoded-credential' || f.rule_id === 'hardcoded-credential-entropy') {
|
|
228
|
+
seen.add(`${f.line}:${f.rule_id}`);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
let providerFindings = 0;
|
|
232
|
+
let entropyFindings = 0;
|
|
233
|
+
// Layer 1: provider patterns (line-by-line).
|
|
234
|
+
for (let i = 0; i < lines.length; i++) {
|
|
235
|
+
const lineText = lines[i];
|
|
236
|
+
const lineNum = i + 1;
|
|
237
|
+
for (const pattern of PROVIDER_PATTERNS) {
|
|
238
|
+
const m = pattern.regex.exec(lineText);
|
|
239
|
+
if (!m)
|
|
240
|
+
continue;
|
|
241
|
+
const key = `${lineNum}:hardcoded-credential`;
|
|
242
|
+
if (seen.has(key))
|
|
243
|
+
continue;
|
|
244
|
+
seen.add(key);
|
|
245
|
+
ctx.addFinding({
|
|
246
|
+
id: `hardcoded-credential-${file}-${lineNum}`,
|
|
247
|
+
pass: this.name,
|
|
248
|
+
category: this.category,
|
|
249
|
+
rule_id: 'hardcoded-credential',
|
|
250
|
+
cwe: 'CWE-798',
|
|
251
|
+
severity: pattern.severity,
|
|
252
|
+
level: pattern.level,
|
|
253
|
+
message: `Hardcoded credential: ${pattern.name} detected`,
|
|
254
|
+
file,
|
|
255
|
+
line: lineNum,
|
|
256
|
+
snippet: lineText.trim().substring(0, 120),
|
|
257
|
+
fix: pattern.fix,
|
|
258
|
+
evidence: { provider: pattern.name, match: m[0].substring(0, 40) },
|
|
259
|
+
});
|
|
260
|
+
providerFindings += 1;
|
|
261
|
+
// First provider hit on a line is enough — same value won't match two
|
|
262
|
+
// unrelated providers because patterns are prefix-anchored.
|
|
263
|
+
break;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// Layer 2: Shannon-entropy scan on string literals.
|
|
267
|
+
for (let i = 0; i < lines.length; i++) {
|
|
268
|
+
const lineText = lines[i];
|
|
269
|
+
const lineNum = i + 1;
|
|
270
|
+
if (TEST_CALL_RE.test(lineText))
|
|
271
|
+
continue;
|
|
272
|
+
if (COMMENT_EXAMPLE_RE.test(lineText))
|
|
273
|
+
continue;
|
|
274
|
+
// Reset regex state per line; STRING_LITERAL_RE is global.
|
|
275
|
+
STRING_LITERAL_RE.lastIndex = 0;
|
|
276
|
+
let match;
|
|
277
|
+
while ((match = STRING_LITERAL_RE.exec(lineText)) !== null) {
|
|
278
|
+
const value = match[2];
|
|
279
|
+
if (!this.isCandidate(value))
|
|
280
|
+
continue;
|
|
281
|
+
if (!this.passesEntropyGate(value, lineText))
|
|
282
|
+
continue;
|
|
283
|
+
const key = `${lineNum}:hardcoded-credential-entropy`;
|
|
284
|
+
if (seen.has(key))
|
|
285
|
+
continue;
|
|
286
|
+
// Also dedup against provider-pattern hits on the same line — the
|
|
287
|
+
// entropy branch is purely additive coverage.
|
|
288
|
+
if (seen.has(`${lineNum}:hardcoded-credential`))
|
|
289
|
+
continue;
|
|
290
|
+
seen.add(key);
|
|
291
|
+
ctx.addFinding({
|
|
292
|
+
id: `hardcoded-credential-entropy-${file}-${lineNum}`,
|
|
293
|
+
pass: this.name,
|
|
294
|
+
category: this.category,
|
|
295
|
+
rule_id: 'hardcoded-credential-entropy',
|
|
296
|
+
cwe: 'CWE-798',
|
|
297
|
+
severity: 'high',
|
|
298
|
+
level: 'warning',
|
|
299
|
+
message: `Possible hardcoded secret: high-entropy string literal (${value.length} chars)`,
|
|
300
|
+
file,
|
|
301
|
+
line: lineNum,
|
|
302
|
+
snippet: lineText.trim().substring(0, 120),
|
|
303
|
+
fix: 'If this is a credential, move it to environment / secrets manager. If it is sample data, add an `example` / `test` marker or disable this pass via `disabledPasses: [\'scan-secrets\']`.',
|
|
304
|
+
evidence: { kind: 'entropy', length: value.length },
|
|
305
|
+
});
|
|
306
|
+
entropyFindings += 1;
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
return { providerFindings, entropyFindings };
|
|
310
|
+
}
|
|
311
|
+
/** Length + shape + denylist filter before entropy is computed. */
|
|
312
|
+
isCandidate(s) {
|
|
313
|
+
if (s.length < 20 || s.length > 200)
|
|
314
|
+
return false;
|
|
315
|
+
if (!BASE64ISH_RE.test(s) && !HEXISH_RE.test(s))
|
|
316
|
+
return false;
|
|
317
|
+
if (UUID_RE.test(s))
|
|
318
|
+
return false;
|
|
319
|
+
if (isBareHashShape(s))
|
|
320
|
+
return false;
|
|
321
|
+
if (isAllSameChar(s))
|
|
322
|
+
return false;
|
|
323
|
+
if (PLACEHOLDER_RE.test(s))
|
|
324
|
+
return false;
|
|
325
|
+
// Skip strings that are themselves a recognizable base64-encoded JSON
|
|
326
|
+
// payload (configs, PEM-bundles, etc.).
|
|
327
|
+
if (looksLikeBase64Json(s))
|
|
328
|
+
return false;
|
|
329
|
+
return true;
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Shannon-entropy gate. Base64-shaped strings need higher entropy than
|
|
333
|
+
* hex-shaped (hex alphabet is 4 bits/char by construction). When the
|
|
334
|
+
* surrounding line contains a credential-shaped variable name, both
|
|
335
|
+
* thresholds drop by 0.2 bits/char.
|
|
336
|
+
*/
|
|
337
|
+
passesEntropyGate(value, lineText) {
|
|
338
|
+
const isHex = HEXISH_RE.test(value);
|
|
339
|
+
const boost = CREDENTIAL_NAME_RE.test(lineText) ? 0.2 : 0;
|
|
340
|
+
const threshold = isHex ? (3.5 - boost) : (4.3 - boost);
|
|
341
|
+
const h = shannonEntropy(value);
|
|
342
|
+
return h >= threshold;
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
//# sourceMappingURL=scan-secrets-pass.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan-secrets-pass.js","sourceRoot":"","sources":["../../../src/analysis/passes/scan-secrets-pass.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AAKH,8EAA8E;A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|
|
|
45
45
|
* 38. MissingStreamPass — whole-file read without streaming (performance)
|
|
46
46
|
* 39. GodClassPass — class with high WMC/LCOM2/CBO metrics (CWE-1060)
|
|
47
47
|
* 40. NamingConventionPass — class/method names violate language conventions
|
|
48
|
+
* 41. ScanSecretsPass — hardcoded credentials: provider regexes + Shannon entropy (CWE-798)
|
|
48
49
|
*
|
|
49
50
|
* Removed from default pipeline (raw IR signals still available for circle-ir-ai):
|
|
50
51
|
* – MissingGuardDomPass — false positives in framework-auth codebases (see pass file)
|
package/dist/analyzer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,gBAAgB,EAA2B,eAAe,EAAe,MAAM,kBAAkB,CAAC;AAC1H,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAYL,KAAK,iBAAiB,EACvB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAKL,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAgC7B,OAAO,EAAwB,KAAK,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAKlH,OAAO,EAA2B,KAAK,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAe1H,OAAO,EAAwB,KAAK,uBAAuB,EAAE,MAAM,6CAA6C,CAAC;AACjH,OAAO,EAAuB,KAAK,sBAAsB,EAA6B,MAAM,4CAA4C,CAAC;AAsBzI,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,UAAU,CAAC,EAAE,WAAW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