@cello-protocol/gateway 0.0.10 → 0.0.12
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/detect/corpus-digest.d.ts +19 -0
- package/dist/detect/corpus-digest.d.ts.map +1 -0
- package/dist/detect/corpus-digest.js +32 -0
- package/dist/detect/corpus-digest.js.map +1 -0
- package/dist/detect/index.d.ts +11 -2
- package/dist/detect/index.d.ts.map +1 -1
- package/dist/detect/index.js +11 -2
- package/dist/detect/index.js.map +1 -1
- package/dist/detect/injection-patterns.d.ts +11 -0
- package/dist/detect/injection-patterns.d.ts.map +1 -1
- package/dist/detect/injection-patterns.js +13 -0
- package/dist/detect/injection-patterns.js.map +1 -1
- package/dist/detect/secrets.d.ts +6 -0
- package/dist/detect/secrets.d.ts.map +1 -1
- package/dist/detect/secrets.js +8 -0
- package/dist/detect/secrets.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* M10B / DOD-END-SCAN-1 (`M10B-D15`) — a stable digest of the ACTIVE detector corpus.
|
|
3
|
+
*
|
|
4
|
+
* The intake scanner's `scanner_version` is DERIVED from this, never hand-maintained. A hand-bumped
|
|
5
|
+
* constant goes stale the first time someone edits a regex and forgets — and because the directory
|
|
6
|
+
* cannot re-run the scan, that stale value is notarized as evidence of a scan that did not happen,
|
|
7
|
+
* which is the stated reason `DOD-DIR-WRITE-1` made the field signed in the first place.
|
|
8
|
+
*
|
|
9
|
+
* Returns null when either corpus is uncompiled. A digest over "no rules" would be a perfectly
|
|
10
|
+
* stable, perfectly meaningless value that a fail-closed caller could not distinguish from a real
|
|
11
|
+
* one — so the absence is reported as absence (§5a), and the caller refuses.
|
|
12
|
+
*
|
|
13
|
+
* SORTED before hashing, because corpus ORDER is not a property anyone should depend on: reordering
|
|
14
|
+
* the source array changes nothing about which text is caught, and a digest that moved on a reorder
|
|
15
|
+
* would force a spurious `scanner_version` change and read as a rule change to anyone auditing it.
|
|
16
|
+
* What the digest MUST track is the SET of active rules.
|
|
17
|
+
*/
|
|
18
|
+
export declare function detectorCorpusDigest(): string | null;
|
|
19
|
+
//# sourceMappingURL=corpus-digest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corpus-digest.d.ts","sourceRoot":"","sources":["../../src/detect/corpus-digest.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,GAAG,IAAI,CASpD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { injectionPatternIds } from "./injection-patterns.js";
|
|
3
|
+
import { secretRuleIds } from "./secrets.js";
|
|
4
|
+
/**
|
|
5
|
+
* M10B / DOD-END-SCAN-1 (`M10B-D15`) — a stable digest of the ACTIVE detector corpus.
|
|
6
|
+
*
|
|
7
|
+
* The intake scanner's `scanner_version` is DERIVED from this, never hand-maintained. A hand-bumped
|
|
8
|
+
* constant goes stale the first time someone edits a regex and forgets — and because the directory
|
|
9
|
+
* cannot re-run the scan, that stale value is notarized as evidence of a scan that did not happen,
|
|
10
|
+
* which is the stated reason `DOD-DIR-WRITE-1` made the field signed in the first place.
|
|
11
|
+
*
|
|
12
|
+
* Returns null when either corpus is uncompiled. A digest over "no rules" would be a perfectly
|
|
13
|
+
* stable, perfectly meaningless value that a fail-closed caller could not distinguish from a real
|
|
14
|
+
* one — so the absence is reported as absence (§5a), and the caller refuses.
|
|
15
|
+
*
|
|
16
|
+
* SORTED before hashing, because corpus ORDER is not a property anyone should depend on: reordering
|
|
17
|
+
* the source array changes nothing about which text is caught, and a digest that moved on a reorder
|
|
18
|
+
* would force a spurious `scanner_version` change and read as a rule change to anyone auditing it.
|
|
19
|
+
* What the digest MUST track is the SET of active rules.
|
|
20
|
+
*/
|
|
21
|
+
export function detectorCorpusDigest() {
|
|
22
|
+
const patterns = injectionPatternIds();
|
|
23
|
+
const secrets = secretRuleIds();
|
|
24
|
+
if (patterns === null || secrets === null)
|
|
25
|
+
return null;
|
|
26
|
+
const canonical = JSON.stringify({
|
|
27
|
+
injection: [...patterns].sort(),
|
|
28
|
+
secrets: [...secrets].sort(),
|
|
29
|
+
});
|
|
30
|
+
return createHash("sha256").update(canonical, "utf8").digest("hex");
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=corpus-digest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corpus-digest.js","sourceRoot":"","sources":["../../src/detect/corpus-digest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB;IAClC,MAAM,QAAQ,GAAG,mBAAmB,EAAE,CAAC;IACvC,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;IAChC,IAAI,QAAQ,KAAK,IAAI,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IACvD,MAAM,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAC/B,SAAS,EAAE,CAAC,GAAG,QAAQ,CAAC,CAAC,IAAI,EAAE;QAC/B,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,IAAI,EAAE;KAC7B,CAAC,CAAC;IACH,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtE,CAAC"}
|
package/dist/detect/index.d.ts
CHANGED
|
@@ -28,7 +28,16 @@
|
|
|
28
28
|
* constraint 3). Reusing `InboundScreener`'s disposition would produce a scanner that passes its
|
|
29
29
|
* tests and never refuses anything (`M10B-D16`). The corpus is shared; the policy is the portal's.
|
|
30
30
|
*/
|
|
31
|
-
export { compileInjectionPatterns, injectionPatternsReady, scanInjectionPatterns } from "./injection-patterns.js";
|
|
32
|
-
export { compileSecretRules, secretRulesReady, redactSecrets } from "./secrets.js";
|
|
31
|
+
export { compileInjectionPatterns, injectionPatternsReady, scanInjectionPatterns, injectionPatternIds } from "./injection-patterns.js";
|
|
32
|
+
export { compileSecretRules, secretRulesReady, redactSecrets, secretRuleIds } from "./secrets.js";
|
|
33
|
+
export { detectorCorpusDigest } from "./corpus-digest.js";
|
|
34
|
+
/**
|
|
35
|
+
* The RE2 engine initializer, exported because THE CORPUS CANNOT COMPILE WITHOUT IT. Omitting it
|
|
36
|
+
* made this subpath look complete while being unusable: `compileInjectionPatterns` runs, leaves
|
|
37
|
+
* `compiled` null, and every rule silently matches nothing — the exact degrade-open behaviour a
|
|
38
|
+
* fail-closed intake must never inherit. A consumer has no other way to reach it, since the exports
|
|
39
|
+
* map deliberately offers no deep-import escape.
|
|
40
|
+
*/
|
|
41
|
+
export { initLinearRegex, linearRegexEngine } from "./linear-regex.js";
|
|
33
42
|
export type { SecretFinding, SecretScanResult } from "./secrets.js";
|
|
34
43
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/detect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/detect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACvI,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACvE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC"}
|
package/dist/detect/index.js
CHANGED
|
@@ -28,6 +28,15 @@
|
|
|
28
28
|
* constraint 3). Reusing `InboundScreener`'s disposition would produce a scanner that passes its
|
|
29
29
|
* tests and never refuses anything (`M10B-D16`). The corpus is shared; the policy is the portal's.
|
|
30
30
|
*/
|
|
31
|
-
export { compileInjectionPatterns, injectionPatternsReady, scanInjectionPatterns } from "./injection-patterns.js";
|
|
32
|
-
export { compileSecretRules, secretRulesReady, redactSecrets } from "./secrets.js";
|
|
31
|
+
export { compileInjectionPatterns, injectionPatternsReady, scanInjectionPatterns, injectionPatternIds } from "./injection-patterns.js";
|
|
32
|
+
export { compileSecretRules, secretRulesReady, redactSecrets, secretRuleIds } from "./secrets.js";
|
|
33
|
+
export { detectorCorpusDigest } from "./corpus-digest.js";
|
|
34
|
+
/**
|
|
35
|
+
* The RE2 engine initializer, exported because THE CORPUS CANNOT COMPILE WITHOUT IT. Omitting it
|
|
36
|
+
* made this subpath look complete while being unusable: `compileInjectionPatterns` runs, leaves
|
|
37
|
+
* `compiled` null, and every rule silently matches nothing — the exact degrade-open behaviour a
|
|
38
|
+
* fail-closed intake must never inherit. A consumer has no other way to reach it, since the exports
|
|
39
|
+
* map deliberately offers no deep-import escape.
|
|
40
|
+
*/
|
|
41
|
+
export { initLinearRegex, linearRegexEngine } from "./linear-regex.js";
|
|
33
42
|
//# sourceMappingURL=index.js.map
|
package/dist/detect/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/detect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/detect/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACvI,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D;;;;;;GAMG;AACH,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
/** Compile the pattern set. Call once at gateway startup, after `initLinearRegex()` resolves. */
|
|
2
2
|
export declare function compileInjectionPatterns(): void;
|
|
3
|
+
/**
|
|
4
|
+
* The ids of the patterns that ACTUALLY COMPILED, in corpus order — the input to the intake
|
|
5
|
+
* scanner's derived `scanner_version` (`M10B-D15`).
|
|
6
|
+
*
|
|
7
|
+
* The ACTIVE set, not the source list, and the difference is the point: if two deployments compile
|
|
8
|
+
* different subsets (a different RE2 build, a rule that fails to compile), their digests diverge —
|
|
9
|
+
* which is what makes "byte-identical across nodes" mechanically checkable rather than aspirational.
|
|
10
|
+
* Returns null when nothing is compiled, so a caller that must fail closed can tell "no rules" from
|
|
11
|
+
* "not ready".
|
|
12
|
+
*/
|
|
13
|
+
export declare function injectionPatternIds(): string[] | null;
|
|
3
14
|
/** Whether the patterns are compiled (the RE2 engine was initialized). */
|
|
4
15
|
export declare function injectionPatternsReady(): boolean;
|
|
5
16
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injection-patterns.d.ts","sourceRoot":"","sources":["../../src/detect/injection-patterns.ts"],"names":[],"mappings":"AAmCA,iGAAiG;AACjG,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AAED,0EAA0E;AAC1E,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAO5D"}
|
|
1
|
+
{"version":3,"file":"injection-patterns.d.ts","sourceRoot":"","sources":["../../src/detect/injection-patterns.ts"],"names":[],"mappings":"AAmCA,iGAAiG;AACjG,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C;AAED;;;;;;;;;GASG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,EAAE,GAAG,IAAI,CAErD;AAED,0EAA0E;AAC1E,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAO5D"}
|
|
@@ -32,6 +32,19 @@ const PATTERN_SOURCES = [
|
|
|
32
32
|
export function compileInjectionPatterns() {
|
|
33
33
|
compiled = PATTERN_SOURCES.map(({ id, src }) => ({ id, re: new LinearRegex(src, "i") }));
|
|
34
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The ids of the patterns that ACTUALLY COMPILED, in corpus order — the input to the intake
|
|
37
|
+
* scanner's derived `scanner_version` (`M10B-D15`).
|
|
38
|
+
*
|
|
39
|
+
* The ACTIVE set, not the source list, and the difference is the point: if two deployments compile
|
|
40
|
+
* different subsets (a different RE2 build, a rule that fails to compile), their digests diverge —
|
|
41
|
+
* which is what makes "byte-identical across nodes" mechanically checkable rather than aspirational.
|
|
42
|
+
* Returns null when nothing is compiled, so a caller that must fail closed can tell "no rules" from
|
|
43
|
+
* "not ready".
|
|
44
|
+
*/
|
|
45
|
+
export function injectionPatternIds() {
|
|
46
|
+
return compiled === null ? null : compiled.map((c) => c.id);
|
|
47
|
+
}
|
|
35
48
|
/** Whether the patterns are compiled (the RE2 engine was initialized). */
|
|
36
49
|
export function injectionPatternsReady() {
|
|
37
50
|
return compiled !== null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"injection-patterns.js","sourceRoot":"","sources":["../../src/detect/injection-patterns.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAIhD,IAAI,QAAQ,GAA6B,IAAI,CAAC;AAE9C,MAAM,eAAe,GAAuC;IAC1D,iGAAiG;IACjG,EAAE,EAAE,EAAE,aAAa,EAAE,GAAG,EAAE,oHAAoH,EAAE;IAChJ,qBAAqB;IACrB,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,2LAA2L,EAAE;IACpN,EAAE,EAAE,EAAE,mBAAmB,EAAE,GAAG,EAAE,8EAA8E,EAAE;IAChH,sCAAsC;IACtC,EAAE,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,6EAA6E,EAAE;IACrG,2CAA2C;IAC3C,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,8DAA8D,EAAE;IACxF,gCAAgC;IAChC,EAAE,EAAE,EAAE,UAAU,EAAE,GAAG,EAAE,+EAA+E,EAAE;IACxG,iCAAiC;IACjC,EAAE,EAAE,EAAE,WAAW,EAAE,GAAG,EAAE,mCAAmC,EAAE;CAC9D,CAAC;AAEF,iGAAiG;AACjG,MAAM,UAAU,wBAAwB;IACtC,QAAQ,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB;IACpC,OAAO,QAAQ,KA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CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,WAAW,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3F,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB;IACjC,OAAO,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,sBAAsB;IACpC,OAAO,QAAQ,KAAK,IAAI,CAAC;AAC3B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,IAAI,CAAC,QAAQ;QAAE,OAAO,EAAE,CAAC;IACzB,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,KAAK,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,QAAQ,EAAE,CAAC;QAClC,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;YAAE,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACnC,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/detect/secrets.d.ts
CHANGED
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The ids of the secret rules that ACTUALLY COMPILED — see `injectionPatternIds` for why the active
|
|
3
|
+
* set rather than the source list. `compileSecretRules` deliberately skips a rule that will not
|
|
4
|
+
* compile under RE2, so the two can differ, and the digest must follow what is really running.
|
|
5
|
+
*/
|
|
6
|
+
export declare function secretRuleIds(): string[] | null;
|
|
1
7
|
/** Compile the rule set + the false-positive layer. Returns how many of the 222 rules compiled. */
|
|
2
8
|
export declare function compileSecretRules(): {
|
|
3
9
|
compiled: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/detect/secrets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"secrets.d.ts","sourceRoot":"","sources":["../../src/detect/secrets.ts"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,GAAG,IAAI,CAE/C;AAID,mGAAmG;AACnG,wBAAgB,kBAAkB,IAAI;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAexE;AAED,wBAAgB,gBAAgB,IAAI,OAAO,CAE1C;AAED,MAAM,WAAW,aAAa;IAAG,MAAM,EAAE,MAAM,CAAA;CAAE;AACjD,MAAM,WAAW,gBAAgB;IAAG,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,aAAa,EAAE,CAAA;CAAE;AAmB7E;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,gBAAgB,CA6B7D"}
|
package/dist/detect/secrets.js
CHANGED
|
@@ -15,6 +15,14 @@
|
|
|
15
15
|
import { LinearRegex } from "./linear-regex.js";
|
|
16
16
|
import { GITLEAKS_RULES, GITLEAKS_STOPWORDS, GITLEAKS_ALLOW_REGEXES } from "./gitleaks-rules.js";
|
|
17
17
|
let RULES = null;
|
|
18
|
+
/**
|
|
19
|
+
* The ids of the secret rules that ACTUALLY COMPILED — see `injectionPatternIds` for why the active
|
|
20
|
+
* set rather than the source list. `compileSecretRules` deliberately skips a rule that will not
|
|
21
|
+
* compile under RE2, so the two can differ, and the digest must follow what is really running.
|
|
22
|
+
*/
|
|
23
|
+
export function secretRuleIds() {
|
|
24
|
+
return RULES === null ? null : RULES.map((r) => r.id);
|
|
25
|
+
}
|
|
18
26
|
let STOPWORDS = [];
|
|
19
27
|
let ALLOW = [];
|
|
20
28
|
/** Compile the rule set + the false-positive layer. Returns how many of the 222 rules compiled. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/detect/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIjG,IAAI,KAAK,GAA0B,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../src/detect/secrets.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAIjG,IAAI,KAAK,GAA0B,IAAI,CAAC;AAExC;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AACxD,CAAC;AACD,IAAI,SAAS,GAAa,EAAE,CAAC;AAC7B,IAAI,KAAK,GAAkB,EAAE,CAAC;AAE9B,mGAAmG;AACnG,MAAM,UAAU,kBAAkB;IAChC,MAAM,QAAQ,GAAmB,EAAE,CAAC;IACpC,KAAK,MAAM,CAAC,IAAI,cAAc,EAAE,CAAC;QAC/B,IAAI,CAAC;YACH,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACtG,CAAC;QAAC,MAAM,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