flare-redact 1.6.0 → 1.7.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 +63 -0
- package/README.md +84 -6
- package/SECURITY.md +5 -0
- package/bench/entities-cases.json +154 -0
- package/bench/entities.mjs +151 -0
- package/dist/checksums.d.ts +13 -0
- package/dist/checksums.d.ts.map +1 -1
- package/dist/checksums.js +38 -1
- package/dist/checksums.js.map +1 -1
- package/dist/detectors.d.ts.map +1 -1
- package/dist/detectors.js +7 -2
- package/dist/detectors.js.map +1 -1
- package/dist/engine.d.ts +8 -0
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +30 -0
- package/dist/engine.js.map +1 -1
- package/dist/entities.d.ts +36 -0
- package/dist/entities.d.ts.map +1 -0
- package/dist/entities.js +897 -0
- package/dist/entities.js.map +1 -0
- package/dist/entity-lexicon.d.ts +11 -0
- package/dist/entity-lexicon.d.ts.map +1 -0
- package/dist/entity-lexicon.js +202 -0
- package/dist/entity-lexicon.js.map +1 -0
- package/dist/help.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/locales.d.ts.map +1 -1
- package/dist/locales.js +10 -5
- package/dist/locales.js.map +1 -1
- package/dist/stream.d.ts.map +1 -1
- package/dist/stream.js +6 -3
- package/dist/stream.js.map +1 -1
- package/dist/transforms.d.ts.map +1 -1
- package/dist/transforms.js +5 -2
- package/dist/transforms.js.map +1 -1
- package/package.json +10 -2
- package/spec/SPEC.md +10 -4
- package/spec/conformance/cases.json +12 -0
- package/spec/conformance/expected.json +176 -0
- package/spec/detectors.json +7 -7
package/dist/transforms.js
CHANGED
|
@@ -83,8 +83,11 @@ export function surrogate(value, detector, secret) {
|
|
|
83
83
|
case 'email': return emailSurrogate(value, secret);
|
|
84
84
|
case 'credit_card': return cardSurrogate(value, secret);
|
|
85
85
|
case 'phone': return digitSurrogate(value, secret);
|
|
86
|
-
case 'person_name':
|
|
87
|
-
case '
|
|
86
|
+
case 'person_name':
|
|
87
|
+
case 'private_person': return personSurrogate(value, secret);
|
|
88
|
+
case 'street_address':
|
|
89
|
+
case 'private_address': return addressSurrogate(value, secret);
|
|
90
|
+
case 'private_phone': return digitSurrogate(value, secret);
|
|
88
91
|
default: return pseudonymize(value, secret);
|
|
89
92
|
}
|
|
90
93
|
}
|
package/dist/transforms.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transforms.js","sourceRoot":"","sources":["../src/transforms.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG3D,MAAM,KAAK,GAAG,4BAA4B,CAAC;AAC3C,MAAM,KAAK,GAAG,4BAA4B,CAAC;AAC3C,MAAM,MAAM,GAAG,YAAY,CAAC;AAC5B,MAAM,WAAW,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC9F,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAC3F,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AAEhG,SAAS,WAAW,CAAC,EAAU;IAC7B,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG;QAAE,OAAO,MAAM,CAAC;IAC1C,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG;QAAE,OAAO,KAAK,CAAC;IACzC,IAAI,EAAE,IAAI,GAAG,IAAI,EAAE,IAAI,GAAG;QAAE,OAAO,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EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flare-redact",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Zero-dependency secret and PII redaction for logs, prompts, and agent tools — with FlareFlow information-flow control and a polyglot sidecar.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -23,6 +23,10 @@
|
|
|
23
23
|
"types": "./dist/ml.d.ts",
|
|
24
24
|
"default": "./dist/ml.js"
|
|
25
25
|
},
|
|
26
|
+
"./entities": {
|
|
27
|
+
"types": "./dist/entities.d.ts",
|
|
28
|
+
"default": "./dist/entities.js"
|
|
29
|
+
},
|
|
26
30
|
"./tool": {
|
|
27
31
|
"types": "./dist/tool.d.ts",
|
|
28
32
|
"default": "./dist/tool.js"
|
|
@@ -90,6 +94,8 @@
|
|
|
90
94
|
"bench/graph-vault.mjs",
|
|
91
95
|
"bench/agent-flow.mjs",
|
|
92
96
|
"bench/agent-flow-cases.json",
|
|
97
|
+
"bench/entities.mjs",
|
|
98
|
+
"bench/entities-cases.json",
|
|
93
99
|
"README.md",
|
|
94
100
|
"CHANGELOG.md",
|
|
95
101
|
"MIGRATION.md",
|
|
@@ -107,6 +113,7 @@
|
|
|
107
113
|
"benchmark": "npm run build && node bench/performance.mjs",
|
|
108
114
|
"benchmark:agent": "npm run build && node bench/agent-flow.mjs",
|
|
109
115
|
"benchmark:adversarial": "npm run build && node bench/adversarial-runtime.mjs",
|
|
116
|
+
"benchmark:entities": "npm run build && node bench/entities.mjs",
|
|
110
117
|
"prepublishOnly": "npm run build",
|
|
111
118
|
"benchmark:graph": "npm run build && node bench/graph-vault.mjs",
|
|
112
119
|
"build:playground": "npm run build && npx --yes esbuild dist/index.js --bundle --format=esm --minify --outfile=docs/playground/flare-redact.min.js"
|
|
@@ -181,7 +188,8 @@
|
|
|
181
188
|
"sdk",
|
|
182
189
|
"information-flow-control",
|
|
183
190
|
"agent-security",
|
|
184
|
-
"prompt-injection"
|
|
191
|
+
"prompt-injection",
|
|
192
|
+
"nemo-guardrails"
|
|
185
193
|
],
|
|
186
194
|
"author": "Umud Hasanli (https://github.com/umudhasanli)",
|
|
187
195
|
"license": "MIT",
|
package/spec/SPEC.md
CHANGED
|
@@ -162,7 +162,7 @@ survives only if **all** validators return true.
|
|
|
162
162
|
| `luhn` | digits only; length within `[minDigits, maxDigits]` (defaults 2 / unbounded); Luhn sum ≡ 0 (mod 10) |
|
|
163
163
|
| `entropy` | Shannon entropy over Unicode code points ≥ `min` bits/symbol |
|
|
164
164
|
| `phone` | 8–15 digits; a value without a leading `+` needs ≥ 9 digits and must not end in a separated `19xx`/`20xx` year |
|
|
165
|
-
| `iban` | ISO 13616 mod-97 |
|
|
165
|
+
| `iban` | remove ASCII whitespace, `-`, U+00A0, U+2009 and U+202F; ISO 13616 mod-97 |
|
|
166
166
|
| `tckn` | Türkiye T.C. Kimlik No, two check digits |
|
|
167
167
|
| `cpf` | Brazil, two mod-11 check digits, rejects repeated digits |
|
|
168
168
|
| `dni` | Spain DNI/NIE control letter (mod 23) |
|
|
@@ -175,7 +175,7 @@ survives only if **all** validators return true.
|
|
|
175
175
|
| `tfn` | Australia weighted sum ≡ 0 (mod 11) |
|
|
176
176
|
| `cn_resident_id` | China ISO 7064 MOD 11-2 |
|
|
177
177
|
| `jp_my_number` | Japan weighted mod-11 |
|
|
178
|
-
| `us_ssn` | never-issued ranges (area 0, 666, ≥ 900; group 0; serial 0) |
|
|
178
|
+
| `us_ssn` | 3-2-4 digits separated by `-`, a space or nothing; never-issued ranges (area 0, 666, ≥ 900; group 0; serial 0) |
|
|
179
179
|
| `aba` | US routing 3-7-1 mod-10 |
|
|
180
180
|
| `nhs` | UK weighted mod-11, rejects repeated digits |
|
|
181
181
|
| `vin` | transliterated weighted mod-11, check character at position 9 |
|
|
@@ -457,11 +457,17 @@ purpose and listed here.
|
|
|
457
457
|
4. **`person_name` matches `name is X` as `\s+is\s+`** rather than `\s*\bis\b\s*`,
|
|
458
458
|
which requires the whitespace that the word boundary implied anyway.
|
|
459
459
|
5. **Whitespace inside patterns is the six ASCII space characters** `[ \t\n\x0B\f\r]`,
|
|
460
|
-
not `\s`.
|
|
461
|
-
|
|
460
|
+
not `\s`. The one exception is the group separator of a printed IBAN, which is
|
|
461
|
+
a space, U+00A0, U+2009 or U+202F, because that is how banks and word
|
|
462
|
+
processors print them. No other detector matches a non-breaking or ideographic
|
|
463
|
+
space as a separator.
|
|
462
464
|
6. **`risk` and `confidence` are explicit on every detector** rather than inferred
|
|
463
465
|
from tags and id substrings. The inferred values are preserved exactly; making
|
|
464
466
|
them data removes a rule engines would otherwise have to reimplement.
|
|
467
|
+
7. **The `entities` recogniser is not in FRS-1 v1.** It is a scoring program over
|
|
468
|
+
cue lists, name lists and context, not a set of patterns, so it does not fit a
|
|
469
|
+
detector pack. Node runs it; other runtimes reach it through the gateway with
|
|
470
|
+
`enable: ["entities"]`.
|
|
465
471
|
|
|
466
472
|
---
|
|
467
473
|
|
|
@@ -47,6 +47,10 @@
|
|
|
47
47
|
{ "name": "basic/header", "input": "Authorization: Basic YWRtaW46aHVudGVyMg==" },
|
|
48
48
|
{ "name": "url/credentials", "input": "DATABASE_URL=postgres://app:s3cr3t-pass@db.internal:5432/main" },
|
|
49
49
|
{ "name": "private-key/pem", "input": "-----BEGIN RSA PRIVATE KEY-----\nMIIBOgIBAAJBAKj34GkxFhD90vcNLYLInFEX6Ppy1tPf9Cnzj4p4WGeKLs1Pt8Qu\n-----END RSA PRIVATE KEY-----" },
|
|
50
|
+
{ "name": "private-key/mismatched-footer", "input": "-----BEGIN RSA PRIVATE KEY-----\nMIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAq7BFUpkGp3+LQmlQ\n-----END CERTIFICATE-----\nnext line" },
|
|
51
|
+
{ "name": "private-key/truncated", "input": "log: -----BEGIN OPENSSH PRIVATE KEY-----\nMIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAq7BFUpkGp3+LQmlQ\nMIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAq7BFUpkGp3+LQmlQ" },
|
|
52
|
+
{ "name": "private-key/pgp-block", "input": "-----BEGIN PGP PRIVATE KEY BLOCK-----\n\nMIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAq7BFUpkGp3+LQmlQ\n-----END PGP PRIVATE KEY BLOCK-----\ndone" },
|
|
53
|
+
{ "name": "private-key/two-keys", "input": "a -----BEGIN RSA PRIVATE KEY-----\nMIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAq7BFUpkGp3+LQmlQ\n-----END RSA PRIVATE KEY----- b -----BEGIN EC PRIVATE KEY-----\nMIIBVQIBADANBgkqhkiG9w0BAQEFAASCAT8wggE7AgEAAkEAq7BFUpkGp3+LQmlQ\n-----END EC PRIVATE KEY----- c" },
|
|
50
54
|
|
|
51
55
|
{ "name": "assignment/english", "input": "password=hunter2000" },
|
|
52
56
|
{ "name": "assignment/quoted", "input": "client_secret: \"abcd-1234-efgh\"" },
|
|
@@ -61,6 +65,10 @@
|
|
|
61
65
|
{ "name": "iban/de", "input": "transfer to DE89370400440532013000 today" },
|
|
62
66
|
{ "name": "iban/gb", "input": "IBAN GB82WEST12345698765432" },
|
|
63
67
|
{ "name": "iban/negative", "input": "code DE89370400440532013001 is not an IBAN" },
|
|
68
|
+
{ "name": "iban/printed", "input": "iban GB82 WEST 1234 5698 7654 32 paid" },
|
|
69
|
+
{ "name": "iban/printed-trailing-word", "input": "IBAN: BE68 5390 0754 7034 EUR, BIC: GKCCBEBB" },
|
|
70
|
+
{ "name": "iban/printed-no-break-space", "input": "NO93\u00a08601\u00a01117\u00a0947 and FR76\u202f3000\u202f6000\u202f0112\u202f3456\u202f7890\u202f189" },
|
|
71
|
+
{ "name": "iban/printed-negative", "input": "GB82 WEST 1234 5698 7654 33 is a typo" },
|
|
64
72
|
|
|
65
73
|
{ "name": "obfuscated-email/brackets", "input": "reach me at ada [at] example [dot] com" },
|
|
66
74
|
{ "name": "obfuscated-email/parens", "input": "grace (at) example (dot) org" },
|
|
@@ -100,12 +108,15 @@
|
|
|
100
108
|
{ "name": "entropy/refined-secret", "input": "api_key GkL3nQ7pRt2vXz9WbYc4Hs6MdF8jA1eU", "options": { "enable": ["high_entropy"], "refineConfidence": true, "minConfidence": 0.5 } },
|
|
101
109
|
|
|
102
110
|
{ "name": "id/us-ssn", "input": "SSN 123-45-6789 on file", "options": { "enable": ["us_ssn"] } },
|
|
111
|
+
{ "name": "id/us-ssn-spaced", "input": "SSN 123 45 6789 on file", "options": { "enable": ["us_ssn"] } },
|
|
103
112
|
{ "name": "id/tr-tckn", "input": "TCKN 10000000146", "options": { "enable": ["tr"] } },
|
|
104
113
|
{ "name": "id/br-cpf", "input": "CPF 529.982.247-25", "options": { "enable": ["br"] } },
|
|
114
|
+
{ "name": "id/br-cpf-spaced", "input": "CPF 529 982 247 25", "options": { "enable": ["br"] } },
|
|
105
115
|
{ "name": "id/es-dni", "input": "DNI 12345678Z", "options": { "enable": ["es"] } },
|
|
106
116
|
{ "name": "id/nl-bsn", "input": "BSN 111222333", "options": { "enable": ["nl"] } },
|
|
107
117
|
{ "name": "id/pl-pesel", "input": "PESEL 44051401359", "options": { "enable": ["pl"] } },
|
|
108
118
|
{ "name": "id/de-tax", "input": "IdNr 26954371827", "options": { "enable": ["de"] } },
|
|
119
|
+
{ "name": "id/de-tax-printed", "input": "IdNr 26 954 371 827", "options": { "enable": ["de"] } },
|
|
109
120
|
{ "name": "id/it-codice-fiscale", "input": "CF RSSMRA85M01H501Q", "options": { "enable": ["it"] } },
|
|
110
121
|
{ "name": "id/ca-sin", "input": "SIN 046 454 286", "options": { "enable": ["ca"] } },
|
|
111
122
|
{ "name": "id/fr-nir", "input": "NIR 1 84 12 76 451 089 46", "options": { "enable": ["fr"] } },
|
|
@@ -123,6 +134,7 @@
|
|
|
123
134
|
|
|
124
135
|
{ "name": "contextual/person-name", "input": "full name: Grace Hopper", "options": { "enable": ["contextual"] } },
|
|
125
136
|
{ "name": "contextual/person-name-is", "input": "customer name is Ada Lovelace", "options": { "enable": ["contextual"] } },
|
|
137
|
+
{ "name": "contextual/person-name-stops-at-line-break", "input": "Name: Fatima Haddad\nAddress: 48 Elm Grove", "options": { "enable": ["contextual"] } },
|
|
126
138
|
{ "name": "contextual/street-address", "input": "address: 221 Baker Street", "options": { "enable": ["contextual"] } },
|
|
127
139
|
{ "name": "contextual/date-of-birth", "input": "date of birth: 1980-04-17", "options": { "enable": ["contextual"] } },
|
|
128
140
|
|
|
@@ -275,6 +275,20 @@
|
|
|
275
275
|
],
|
|
276
276
|
"redact": "customer name is [REDACTED PERSON]"
|
|
277
277
|
},
|
|
278
|
+
"contextual/person-name-stops-at-line-break": {
|
|
279
|
+
"findings": [
|
|
280
|
+
{
|
|
281
|
+
"column": 7,
|
|
282
|
+
"confidence": 0.86,
|
|
283
|
+
"detector": "person_name",
|
|
284
|
+
"end": 19,
|
|
285
|
+
"line": 1,
|
|
286
|
+
"risk": "high",
|
|
287
|
+
"start": 6
|
|
288
|
+
}
|
|
289
|
+
],
|
|
290
|
+
"redact": "Name: [REDACTED PERSON]\nAddress: 48 Elm Grove"
|
|
291
|
+
},
|
|
278
292
|
"contextual/street-address": {
|
|
279
293
|
"findings": [
|
|
280
294
|
{
|
|
@@ -585,6 +599,61 @@
|
|
|
585
599
|
"findings": [],
|
|
586
600
|
"redact": "code DE89370400440532013001 is not an IBAN"
|
|
587
601
|
},
|
|
602
|
+
"iban/printed": {
|
|
603
|
+
"findings": [
|
|
604
|
+
{
|
|
605
|
+
"column": 6,
|
|
606
|
+
"confidence": 0.99,
|
|
607
|
+
"detector": "iban",
|
|
608
|
+
"end": 32,
|
|
609
|
+
"line": 1,
|
|
610
|
+
"risk": "high",
|
|
611
|
+
"start": 5
|
|
612
|
+
}
|
|
613
|
+
],
|
|
614
|
+
"redact": "iban [REDACTED IBAN] paid"
|
|
615
|
+
},
|
|
616
|
+
"iban/printed-negative": {
|
|
617
|
+
"findings": [],
|
|
618
|
+
"redact": "GB82 WEST 1234 5698 7654 33 is a typo"
|
|
619
|
+
},
|
|
620
|
+
"iban/printed-no-break-space": {
|
|
621
|
+
"findings": [
|
|
622
|
+
{
|
|
623
|
+
"column": 1,
|
|
624
|
+
"confidence": 0.99,
|
|
625
|
+
"detector": "iban",
|
|
626
|
+
"end": 18,
|
|
627
|
+
"line": 1,
|
|
628
|
+
"risk": "high",
|
|
629
|
+
"start": 0
|
|
630
|
+
},
|
|
631
|
+
{
|
|
632
|
+
"column": 24,
|
|
633
|
+
"confidence": 0.99,
|
|
634
|
+
"detector": "iban",
|
|
635
|
+
"end": 56,
|
|
636
|
+
"line": 1,
|
|
637
|
+
"risk": "high",
|
|
638
|
+
"start": 23
|
|
639
|
+
}
|
|
640
|
+
],
|
|
641
|
+
"redact": "[REDACTED IBAN] and [REDACTED IBAN]"
|
|
642
|
+
},
|
|
643
|
+
"iban/printed-trailing-word": {
|
|
644
|
+
"findings": [
|
|
645
|
+
{
|
|
646
|
+
"column": 7,
|
|
647
|
+
"confidence": 0.99,
|
|
648
|
+
"detector": "iban",
|
|
649
|
+
"end": 25,
|
|
650
|
+
"line": 1,
|
|
651
|
+
"risk": "high",
|
|
652
|
+
"start": 6
|
|
653
|
+
}
|
|
654
|
+
],
|
|
655
|
+
"redact": "IBAN: [REDACTED IBAN] EUR, BIC: GKCCBEBB"
|
|
656
|
+
},
|
|
588
657
|
"id/aba-routing": {
|
|
589
658
|
"findings": [
|
|
590
659
|
{
|
|
@@ -627,6 +696,20 @@
|
|
|
627
696
|
],
|
|
628
697
|
"redact": "CPF [REDACTED ID]"
|
|
629
698
|
},
|
|
699
|
+
"id/br-cpf-spaced": {
|
|
700
|
+
"findings": [
|
|
701
|
+
{
|
|
702
|
+
"column": 5,
|
|
703
|
+
"confidence": 0.99,
|
|
704
|
+
"detector": "br_cpf",
|
|
705
|
+
"end": 18,
|
|
706
|
+
"line": 1,
|
|
707
|
+
"risk": "high",
|
|
708
|
+
"start": 4
|
|
709
|
+
}
|
|
710
|
+
],
|
|
711
|
+
"redact": "CPF [REDACTED ID]"
|
|
712
|
+
},
|
|
630
713
|
"id/ca-sin": {
|
|
631
714
|
"findings": [
|
|
632
715
|
{
|
|
@@ -669,6 +752,20 @@
|
|
|
669
752
|
],
|
|
670
753
|
"redact": "IdNr [REDACTED ID]"
|
|
671
754
|
},
|
|
755
|
+
"id/de-tax-printed": {
|
|
756
|
+
"findings": [
|
|
757
|
+
{
|
|
758
|
+
"column": 6,
|
|
759
|
+
"confidence": 0.99,
|
|
760
|
+
"detector": "de_tax_id",
|
|
761
|
+
"end": 19,
|
|
762
|
+
"line": 1,
|
|
763
|
+
"risk": "high",
|
|
764
|
+
"start": 5
|
|
765
|
+
}
|
|
766
|
+
],
|
|
767
|
+
"redact": "IdNr [REDACTED ID]"
|
|
768
|
+
},
|
|
672
769
|
"id/es-dni": {
|
|
673
770
|
"findings": [
|
|
674
771
|
{
|
|
@@ -813,6 +910,20 @@
|
|
|
813
910
|
],
|
|
814
911
|
"redact": "SSN [REDACTED ID] on file"
|
|
815
912
|
},
|
|
913
|
+
"id/us-ssn-spaced": {
|
|
914
|
+
"findings": [
|
|
915
|
+
{
|
|
916
|
+
"column": 5,
|
|
917
|
+
"confidence": 0.99,
|
|
918
|
+
"detector": "us_ssn",
|
|
919
|
+
"end": 15,
|
|
920
|
+
"line": 1,
|
|
921
|
+
"risk": "high",
|
|
922
|
+
"start": 4
|
|
923
|
+
}
|
|
924
|
+
],
|
|
925
|
+
"redact": "SSN [REDACTED ID] on file"
|
|
926
|
+
},
|
|
816
927
|
"id/vin": {
|
|
817
928
|
"findings": [
|
|
818
929
|
{
|
|
@@ -1276,6 +1387,20 @@
|
|
|
1276
1387
|
],
|
|
1277
1388
|
"redact": "PMAK-***"
|
|
1278
1389
|
},
|
|
1390
|
+
"private-key/mismatched-footer": {
|
|
1391
|
+
"findings": [
|
|
1392
|
+
{
|
|
1393
|
+
"column": 1,
|
|
1394
|
+
"confidence": 0.92,
|
|
1395
|
+
"detector": "private_key",
|
|
1396
|
+
"end": 122,
|
|
1397
|
+
"line": 1,
|
|
1398
|
+
"risk": "critical",
|
|
1399
|
+
"start": 0
|
|
1400
|
+
}
|
|
1401
|
+
],
|
|
1402
|
+
"redact": "[REDACTED PRIVATE KEY]\nnext line"
|
|
1403
|
+
},
|
|
1279
1404
|
"private-key/pem": {
|
|
1280
1405
|
"findings": [
|
|
1281
1406
|
{
|
|
@@ -1290,6 +1415,57 @@
|
|
|
1290
1415
|
],
|
|
1291
1416
|
"redact": "[REDACTED PRIVATE KEY]"
|
|
1292
1417
|
},
|
|
1418
|
+
"private-key/pgp-block": {
|
|
1419
|
+
"findings": [
|
|
1420
|
+
{
|
|
1421
|
+
"column": 1,
|
|
1422
|
+
"confidence": 0.92,
|
|
1423
|
+
"detector": "private_key",
|
|
1424
|
+
"end": 139,
|
|
1425
|
+
"line": 1,
|
|
1426
|
+
"risk": "critical",
|
|
1427
|
+
"start": 0
|
|
1428
|
+
}
|
|
1429
|
+
],
|
|
1430
|
+
"redact": "[REDACTED PRIVATE KEY]\ndone"
|
|
1431
|
+
},
|
|
1432
|
+
"private-key/truncated": {
|
|
1433
|
+
"findings": [
|
|
1434
|
+
{
|
|
1435
|
+
"column": 6,
|
|
1436
|
+
"confidence": 0.92,
|
|
1437
|
+
"detector": "private_key",
|
|
1438
|
+
"end": 170,
|
|
1439
|
+
"line": 1,
|
|
1440
|
+
"risk": "critical",
|
|
1441
|
+
"start": 5
|
|
1442
|
+
}
|
|
1443
|
+
],
|
|
1444
|
+
"redact": "log: [REDACTED PRIVATE KEY]"
|
|
1445
|
+
},
|
|
1446
|
+
"private-key/two-keys": {
|
|
1447
|
+
"findings": [
|
|
1448
|
+
{
|
|
1449
|
+
"column": 3,
|
|
1450
|
+
"confidence": 0.92,
|
|
1451
|
+
"detector": "private_key",
|
|
1452
|
+
"end": 128,
|
|
1453
|
+
"line": 1,
|
|
1454
|
+
"risk": "critical",
|
|
1455
|
+
"start": 2
|
|
1456
|
+
},
|
|
1457
|
+
{
|
|
1458
|
+
"column": 33,
|
|
1459
|
+
"confidence": 0.92,
|
|
1460
|
+
"detector": "private_key",
|
|
1461
|
+
"end": 255,
|
|
1462
|
+
"line": 3,
|
|
1463
|
+
"risk": "critical",
|
|
1464
|
+
"start": 131
|
|
1465
|
+
}
|
|
1466
|
+
],
|
|
1467
|
+
"redact": "a [REDACTED PRIVATE KEY] b [REDACTED PRIVATE KEY] c"
|
|
1468
|
+
},
|
|
1293
1469
|
"selection/disable-email": {
|
|
1294
1470
|
"findings": [
|
|
1295
1471
|
{
|
package/spec/detectors.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "./detectors.schema.json",
|
|
3
3
|
"spec": "FRS-1",
|
|
4
4
|
"id": "flare-redact/core",
|
|
5
|
-
"version": "1.
|
|
5
|
+
"version": "1.7.0",
|
|
6
6
|
"title": "flare-redact core detector pack",
|
|
7
7
|
"description": "The portable profile of the flare-redact detector set. Every pattern is written in the FRS-1 regular-expression subset so the JavaScript, Python, Go and Rust engines compile it to the same automaton and produce byte-identical output. See spec/SPEC.md.",
|
|
8
8
|
"license": "MIT",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"id": "private_key",
|
|
48
48
|
"label": "Private key",
|
|
49
49
|
"why": "A PEM private key is a full cryptographic identity — whoever holds it is you.",
|
|
50
|
-
"pattern": "-----BEGIN (?:
|
|
50
|
+
"pattern": "-----BEGIN (?:[A-Z0-9]+ ){0,3}PRIVATE KEY(?: BLOCK)?-----(?:{{ANY}}*?-----END [A-Z0-9 ]{1,60}-----|{{ANY}}*)",
|
|
51
51
|
"prefilter": [
|
|
52
52
|
"-----begin"
|
|
53
53
|
],
|
|
@@ -578,7 +578,7 @@
|
|
|
578
578
|
"id": "person_name",
|
|
579
579
|
"label": "Person name",
|
|
580
580
|
"why": "A person name appearing after an explicit identity label.",
|
|
581
|
-
"pattern": "(?:full[ _-]?name|customer[ _-]?name|contact[ _-]?name|name|ad[ıi]|isim|nombre|nom|nome|姓名|الاسم)(?:[ \\t\\n\\x0B\\f\\r]*[:=][ \\t\\n\\x0B\\f\\r]*|[ \\t\\n\\x0B\\f\\r]+is[ \\t\\n\\x0B\\f\\r]+)[\"']?({{L}}(?:{{L}}|['’.-]){1,39}(?:[ \\t
|
|
581
|
+
"pattern": "(?:full[ _-]?name|customer[ _-]?name|contact[ _-]?name|name|ad[ıi]|isim|nombre|nom|nome|姓名|الاسم)(?:[ \\t\\n\\x0B\\f\\r]*[:=][ \\t\\n\\x0B\\f\\r]*|[ \\t\\n\\x0B\\f\\r]+is[ \\t\\n\\x0B\\f\\r]+)[\"']?({{L}}(?:{{L}}|['’.-]){1,39}(?:[ \\t]+{{L}}(?:{{L}}|['’.-]){1,39}){1,3})",
|
|
582
582
|
"flags": "i",
|
|
583
583
|
"capture": 1,
|
|
584
584
|
"mask": {
|
|
@@ -638,7 +638,7 @@
|
|
|
638
638
|
"id": "iban",
|
|
639
639
|
"label": "IBAN",
|
|
640
640
|
"why": "An international bank account number.",
|
|
641
|
-
"pattern": "[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}",
|
|
641
|
+
"pattern": "(?:[A-Z]{2}[0-9]{2}[A-Z0-9]{11,30}|(?:AD|CZ|ES|MD|PK|RO|SA|SE|SK|TN|VG)[0-9]{2}(?:[ \\xA0\u2009\u202F][A-Z0-9]{4}){5}|(?:AE|GI|IL|IQ|OM|SO|TL)[0-9]{2}(?:[ \\xA0\u2009\u202F][A-Z0-9]{4}){4}[ \\xA0\u2009\u202F][A-Z0-9]{3}|(?:AL|AZ|BY|CY|DO|GT|HN|HU|LB|NI|PL|SV|BF|BJ|CI|MA|ML|NE|SN|TG)[0-9]{2}(?:[ \\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:MT|SC)[0-9]{2}(?:[ \\xA0\u2009\u202F][A-Z0-9]{4}){6}[ \\xA0\u2009\u202F][A-Z0-9]{3}|(?:NO)[0-9]{2}(?:[ \\xA0\u2009\u202F][A-Z0-9]{4}){2}[ \\xA0\u2009\u202F][A-Z0-9]{3}|(?:RU)[0-9]{2}(?:[ \\xA0\u2009\u202F][A-Z0-9]{4}){7}[ \\xA0\u2009\u202F][A-Z0-9]{1})",
|
|
642
642
|
"boundary": {
|
|
643
643
|
"before": "word",
|
|
644
644
|
"after": "word"
|
|
@@ -691,7 +691,7 @@
|
|
|
691
691
|
"id": "br_cpf",
|
|
692
692
|
"label": "Brazilian CPF",
|
|
693
693
|
"why": "Brazil taxpayer registry number — high-value PII.",
|
|
694
|
-
"pattern": "[0-9]{3}\\.?[0-9]{3}\\.?[0-9]{3}-?[0-9]{2}",
|
|
694
|
+
"pattern": "(?:[0-9]{3}\\.?[0-9]{3}\\.?[0-9]{3}-?[0-9]{2}|[0-9]{3} [0-9]{3} [0-9]{3}[ -][0-9]{2})",
|
|
695
695
|
"boundary": {
|
|
696
696
|
"before": "word",
|
|
697
697
|
"after": "word"
|
|
@@ -799,7 +799,7 @@
|
|
|
799
799
|
"id": "de_tax_id",
|
|
800
800
|
"label": "German tax ID (Steuer-IdNr)",
|
|
801
801
|
"why": "Germany tax identification number.",
|
|
802
|
-
"pattern": "[0-9]{11}",
|
|
802
|
+
"pattern": "(?:[0-9]{11}|[0-9]{2} [0-9]{3} [0-9]{3} [0-9]{3})",
|
|
803
803
|
"boundary": {
|
|
804
804
|
"before": "word",
|
|
805
805
|
"after": "word"
|
|
@@ -1018,7 +1018,7 @@
|
|
|
1018
1018
|
"id": "us_ssn",
|
|
1019
1019
|
"label": "US Social Security number",
|
|
1020
1020
|
"why": "A US national identifier — high-value PII.",
|
|
1021
|
-
"pattern": "[0-9]{3}-[0-9]{2}-[0-9]{4}",
|
|
1021
|
+
"pattern": "(?:[0-9]{3}-[0-9]{2}-[0-9]{4}|[0-9]{3} [0-9]{2} [0-9]{4})",
|
|
1022
1022
|
"boundary": {
|
|
1023
1023
|
"before": "word",
|
|
1024
1024
|
"after": "word"
|