flare-redact 1.11.0 → 1.12.1

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.
Files changed (57) hide show
  1. package/CHANGELOG.md +115 -0
  2. package/README.md +3 -3
  3. package/SECURITY.md +1 -1
  4. package/dist/audit.d.ts.map +1 -1
  5. package/dist/audit.js +3 -2
  6. package/dist/audit.js.map +1 -1
  7. package/dist/detectors.d.ts +1 -2
  8. package/dist/detectors.d.ts.map +1 -1
  9. package/dist/detectors.js +8 -4
  10. package/dist/detectors.js.map +1 -1
  11. package/dist/engine.d.ts.map +1 -1
  12. package/dist/engine.js +24 -6
  13. package/dist/engine.js.map +1 -1
  14. package/dist/extra.d.ts.map +1 -1
  15. package/dist/extra.js +3 -1
  16. package/dist/extra.js.map +1 -1
  17. package/dist/fold.d.ts +22 -0
  18. package/dist/fold.d.ts.map +1 -0
  19. package/dist/fold.js +140 -0
  20. package/dist/fold.js.map +1 -0
  21. package/dist/help.d.ts.map +1 -1
  22. package/dist/help.js +13 -9
  23. package/dist/help.js.map +1 -1
  24. package/dist/i18n.d.ts +10 -0
  25. package/dist/i18n.d.ts.map +1 -1
  26. package/dist/i18n.js +18 -1
  27. package/dist/i18n.js.map +1 -1
  28. package/dist/index.d.ts.map +1 -1
  29. package/dist/index.js +2 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/pack.d.ts +2 -2
  32. package/dist/pack.d.ts.map +1 -1
  33. package/dist/pack.js +9 -7
  34. package/dist/pack.js.map +1 -1
  35. package/dist/pino.d.ts +18 -0
  36. package/dist/pino.d.ts.map +1 -1
  37. package/dist/pino.js +61 -0
  38. package/dist/pino.js.map +1 -1
  39. package/dist/printf.d.ts +8 -0
  40. package/dist/printf.d.ts.map +1 -0
  41. package/dist/printf.js +49 -0
  42. package/dist/printf.js.map +1 -0
  43. package/dist/terms.d.ts +4 -4
  44. package/dist/terms.d.ts.map +1 -1
  45. package/dist/terms.js +22 -13
  46. package/dist/terms.js.map +1 -1
  47. package/dist/winston.d.ts.map +1 -1
  48. package/dist/winston.js +14 -0
  49. package/dist/winston.js.map +1 -1
  50. package/docs/guide.md +43 -16
  51. package/package.json +1 -1
  52. package/spec/SPEC.md +142 -51
  53. package/spec/conformance/README.md +7 -4
  54. package/spec/conformance/cases.json +22 -0
  55. package/spec/conformance/expected.json +378 -0
  56. package/spec/detectors.json +4 -4
  57. package/spec/detectors.schema.json +1 -1
@@ -83,6 +83,20 @@
83
83
  ],
84
84
  "redact": "密码: ***"
85
85
  },
86
+ "assignment/dotless-i": {
87
+ "findings": [
88
+ {
89
+ "column": 1,
90
+ "confidence": 0.92,
91
+ "detector": "generic_assignment",
92
+ "end": 21,
93
+ "line": 1,
94
+ "risk": "critical",
95
+ "start": 0
96
+ }
97
+ ],
98
+ "redact": "şıfre: ***"
99
+ },
86
100
  "assignment/english": {
87
101
  "findings": [
88
102
  {
@@ -97,6 +111,48 @@
97
111
  ],
98
112
  "redact": "password=***"
99
113
  },
114
+ "assignment/greek-final-sigma": {
115
+ "findings": [
116
+ {
117
+ "column": 1,
118
+ "confidence": 0.92,
119
+ "detector": "generic_assignment",
120
+ "end": 21,
121
+ "line": 1,
122
+ "risk": "critical",
123
+ "start": 0
124
+ }
125
+ ],
126
+ "redact": "ΚΩΔΙΚΌΣ: ***"
127
+ },
128
+ "assignment/kelvin-sign": {
129
+ "findings": [
130
+ {
131
+ "column": 1,
132
+ "confidence": 0.92,
133
+ "detector": "generic_assignment",
134
+ "end": 24,
135
+ "line": 1,
136
+ "risk": "critical",
137
+ "start": 0
138
+ }
139
+ ],
140
+ "redact": "API_KEY=***"
141
+ },
142
+ "assignment/long-s": {
143
+ "findings": [
144
+ {
145
+ "column": 1,
146
+ "confidence": 0.92,
147
+ "detector": "generic_assignment",
148
+ "end": 23,
149
+ "line": 1,
150
+ "risk": "critical",
151
+ "start": 0
152
+ }
153
+ ],
154
+ "redact": "PAſſWORD=***"
155
+ },
100
156
  "assignment/quoted": {
101
157
  "findings": [
102
158
  {
@@ -143,6 +199,66 @@
143
199
  ],
144
200
  "redact": "parola=***"
145
201
  },
202
+ "assignment/turkish-locale-identifier": {
203
+ "findings": [
204
+ {
205
+ "column": 1,
206
+ "confidence": 0.92,
207
+ "detector": "generic_assignment",
208
+ "end": 24,
209
+ "line": 1,
210
+ "risk": "critical",
211
+ "start": 0
212
+ }
213
+ ],
214
+ "redact": "APİ_KEY=***"
215
+ },
216
+ "assignment/turkish-uppercase": {
217
+ "findings": [
218
+ {
219
+ "column": 1,
220
+ "confidence": 0.92,
221
+ "detector": "generic_assignment",
222
+ "end": 21,
223
+ "line": 1,
224
+ "risk": "critical",
225
+ "start": 0
226
+ },
227
+ {
228
+ "column": 23,
229
+ "confidence": 0.92,
230
+ "detector": "generic_assignment",
231
+ "end": 38,
232
+ "line": 1,
233
+ "risk": "critical",
234
+ "start": 22
235
+ }
236
+ ],
237
+ "redact": "ŞİFRE: *** MƏXFİ=***"
238
+ },
239
+ "assignment/value-holding-separators": {
240
+ "findings": [
241
+ {
242
+ "column": 1,
243
+ "confidence": 0.92,
244
+ "detector": "generic_assignment",
245
+ "end": 21,
246
+ "line": 1,
247
+ "risk": "critical",
248
+ "start": 0
249
+ },
250
+ {
251
+ "column": 23,
252
+ "confidence": 0.92,
253
+ "detector": "generic_assignment",
254
+ "end": 37,
255
+ "line": 1,
256
+ "risk": "critical",
257
+ "start": 22
258
+ }
259
+ ],
260
+ "redact": "secret=*** pwd=***"
261
+ },
146
262
  "atlassian/token": {
147
263
  "findings": [
148
264
  {
@@ -555,6 +671,48 @@
555
671
  ],
556
672
  "redact": "value Zm9v*** stored"
557
673
  },
674
+ "entropy/refine-context-ascii-boundary": {
675
+ "findings": [
676
+ {
677
+ "column": 8,
678
+ "confidence": 0.799992,
679
+ "detector": "high_entropy",
680
+ "end": 39,
681
+ "line": 1,
682
+ "risk": "critical",
683
+ "start": 7
684
+ }
685
+ ],
686
+ "redact": "çtoken GkL3***"
687
+ },
688
+ "entropy/refine-context-ascii-case": {
689
+ "findings": [
690
+ {
691
+ "column": 8,
692
+ "confidence": 0.797759,
693
+ "detector": "high_entropy",
694
+ "end": 39,
695
+ "line": 1,
696
+ "risk": "critical",
697
+ "start": 7
698
+ }
699
+ ],
700
+ "redact": "ſecret GkL3***"
701
+ },
702
+ "entropy/refine-window-in-characters": {
703
+ "findings": [
704
+ {
705
+ "column": 64,
706
+ "confidence": 0.799992,
707
+ "detector": "high_entropy",
708
+ "end": 95,
709
+ "line": 1,
710
+ "risk": "critical",
711
+ "start": 63
712
+ }
713
+ ],
714
+ "redact": "token яяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяя GkL3***"
715
+ },
558
716
  "entropy/refined-secret": {
559
717
  "findings": [
560
718
  {
@@ -573,6 +731,20 @@
573
731
  "findings": [],
574
732
  "redact": "commit 9f8b7a6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e1f00"
575
733
  },
734
+ "evasion/prefilter-folds-case": {
735
+ "findings": [
736
+ {
737
+ "column": 25,
738
+ "confidence": 0.92,
739
+ "detector": "aws_secret_key",
740
+ "end": 64,
741
+ "line": 1,
742
+ "risk": "critical",
743
+ "start": 24
744
+ }
745
+ ],
746
+ "redact": "aws_ſecret_access_key = ***"
747
+ },
576
748
  "evasion/zero-width-assignment": {
577
749
  "findings": [
578
750
  {
@@ -767,6 +939,29 @@
767
939
  ],
768
940
  "redact": "hf_***"
769
941
  },
942
+ "iban/bic-needs-a-country": {
943
+ "findings": [
944
+ {
945
+ "column": 22,
946
+ "confidence": 0.92,
947
+ "detector": "swift_bic",
948
+ "end": 29,
949
+ "line": 1,
950
+ "risk": "high",
951
+ "start": 21
952
+ },
953
+ {
954
+ "column": 31,
955
+ "confidence": 0.92,
956
+ "detector": "swift_bic",
957
+ "end": 38,
958
+ "line": 1,
959
+ "risk": "high",
960
+ "start": 30
961
+ }
962
+ ],
963
+ "redact": "PASSWORD QWERTY12345 DEUT*** NWBK***"
964
+ },
770
965
  "iban/de": {
771
966
  "findings": [
772
967
  {
@@ -1479,6 +1674,19 @@
1479
1674
  "password": "hunter2"
1480
1675
  }
1481
1676
  },
1677
+ "keys/greek-final-sigma": {
1678
+ "findings": [
1679
+ {
1680
+ "confidence": 0.98,
1681
+ "detector": "sensitive_key",
1682
+ "path": "ΚΩΔΙΚΌΣ",
1683
+ "risk": "critical"
1684
+ }
1685
+ ],
1686
+ "redact": {
1687
+ "ΚΩΔΙΚΌΣ": "***"
1688
+ }
1689
+ },
1482
1690
  "keys/multilingual-object": {
1483
1691
  "findings": [
1484
1692
  {
@@ -1506,6 +1714,23 @@
1506
1714
  "密码": "***"
1507
1715
  }
1508
1716
  },
1717
+ "keys/names-are-not-redacted": {
1718
+ "findings": [
1719
+ {
1720
+ "column": 1,
1721
+ "confidence": 0.92,
1722
+ "detector": "email",
1723
+ "end": 17,
1724
+ "line": 1,
1725
+ "path": "ada@example.com",
1726
+ "risk": "high",
1727
+ "start": 0
1728
+ }
1729
+ ],
1730
+ "redact": {
1731
+ "ada@example.com": "g***@***"
1732
+ }
1733
+ },
1509
1734
  "keys/nested-structure": {
1510
1735
  "findings": [
1511
1736
  {
@@ -1548,6 +1773,27 @@
1548
1773
  ]
1549
1774
  }
1550
1775
  },
1776
+ "keys/redact-keys-normalised": {
1777
+ "findings": [
1778
+ {
1779
+ "confidence": 0.98,
1780
+ "detector": "sensitive_key",
1781
+ "path": "Şifre",
1782
+ "risk": "critical"
1783
+ },
1784
+ {
1785
+ "confidence": 0.98,
1786
+ "detector": "sensitive_key",
1787
+ "path": "ŞİFRE",
1788
+ "risk": "critical"
1789
+ }
1790
+ ],
1791
+ "redact": {
1792
+ "other": "z",
1793
+ "Şifre": "***",
1794
+ "ŞİFRE": "***"
1795
+ }
1796
+ },
1551
1797
  "keys/sensitive-object": {
1552
1798
  "findings": [
1553
1799
  {
@@ -1569,6 +1815,27 @@
1569
1815
  "password": "***"
1570
1816
  }
1571
1817
  },
1818
+ "keys/turkish-uppercase": {
1819
+ "findings": [
1820
+ {
1821
+ "confidence": 0.98,
1822
+ "detector": "sensitive_key",
1823
+ "path": "GİZLİ",
1824
+ "risk": "critical"
1825
+ },
1826
+ {
1827
+ "confidence": 0.98,
1828
+ "detector": "sensitive_key",
1829
+ "path": "ŞİFRE",
1830
+ "risk": "critical"
1831
+ }
1832
+ ],
1833
+ "redact": {
1834
+ "GİZLİ": "***",
1835
+ "note": "ok",
1836
+ "ŞİFRE": "***"
1837
+ }
1838
+ },
1572
1839
  "langsmith/key": {
1573
1840
  "findings": [
1574
1841
  {
@@ -1934,6 +2201,20 @@
1934
2201
  ],
1935
2202
  "redact": "api_key=***"
1936
2203
  },
2204
+ "phone/context-window-in-characters": {
2205
+ "findings": [
2206
+ {
2207
+ "column": 77,
2208
+ "confidence": 0.86,
2209
+ "detector": "phone",
2210
+ "end": 93,
2211
+ "line": 1,
2212
+ "risk": "high",
2213
+ "start": 76
2214
+ }
2215
+ ],
2216
+ "redact": "call яяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяяя +99***"
2217
+ },
1937
2218
  "phone/e164": {
1938
2219
  "findings": [
1939
2220
  {
@@ -2401,6 +2682,20 @@
2401
2682
  ],
2402
2683
  "redact": "[REDACTED TELEGRAM TOKEN]"
2403
2684
  },
2685
+ "terms/boundary-failure-moves-one-character": {
2686
+ "findings": [
2687
+ {
2688
+ "column": 8,
2689
+ "confidence": 0.92,
2690
+ "detector": "custom_term",
2691
+ "end": 14,
2692
+ "line": 1,
2693
+ "risk": "high",
2694
+ "start": 7
2695
+ }
2696
+ ],
2697
+ "redact": "say 76 *** now"
2698
+ },
2404
2699
  "terms/case-sensitive": {
2405
2700
  "findings": [
2406
2701
  {
@@ -2415,6 +2710,66 @@
2415
2710
  ],
2416
2711
  "redact": "bluebird and ***"
2417
2712
  },
2713
+ "terms/combining-mark-boundary": {
2714
+ "findings": [
2715
+ {
2716
+ "column": 6,
2717
+ "confidence": 0.92,
2718
+ "detector": "custom_term",
2719
+ "end": 8,
2720
+ "line": 1,
2721
+ "risk": "high",
2722
+ "start": 5
2723
+ }
2724
+ ],
2725
+ "redact": "राजा *** राजकुमार"
2726
+ },
2727
+ "terms/dotted-i": {
2728
+ "findings": [
2729
+ {
2730
+ "column": 1,
2731
+ "confidence": 0.92,
2732
+ "detector": "custom_term",
2733
+ "end": 5,
2734
+ "line": 1,
2735
+ "risk": "high",
2736
+ "start": 0
2737
+ },
2738
+ {
2739
+ "column": 11,
2740
+ "confidence": 0.92,
2741
+ "detector": "custom_term",
2742
+ "end": 15,
2743
+ "line": 1,
2744
+ "risk": "high",
2745
+ "start": 10
2746
+ }
2747
+ ],
2748
+ "redact": "<G> and <G>"
2749
+ },
2750
+ "terms/equal-length-keeps-order": {
2751
+ "findings": [
2752
+ {
2753
+ "column": 1,
2754
+ "confidence": 0.92,
2755
+ "detector": "custom_term",
2756
+ "end": 3,
2757
+ "line": 1,
2758
+ "risk": "high",
2759
+ "start": 0
2760
+ },
2761
+ {
2762
+ "column": 9,
2763
+ "confidence": 0.92,
2764
+ "detector": "custom_term",
2765
+ "end": 11,
2766
+ "line": 1,
2767
+ "risk": "high",
2768
+ "start": 8
2769
+ }
2770
+ ],
2771
+ "redact": "<1> and <1>"
2772
+ },
2418
2773
  "terms/plain": {
2419
2774
  "findings": [
2420
2775
  {
@@ -2443,6 +2798,29 @@
2443
2798
  ],
2444
2799
  "redact": "project [PROJECT] ships in Q3"
2445
2800
  },
2801
+ "terms/shorter-term-at-same-position": {
2802
+ "findings": [
2803
+ {
2804
+ "column": 1,
2805
+ "confidence": 0.92,
2806
+ "detector": "custom_term",
2807
+ "end": 3,
2808
+ "line": 1,
2809
+ "risk": "high",
2810
+ "start": 0
2811
+ },
2812
+ {
2813
+ "column": 14,
2814
+ "confidence": 0.92,
2815
+ "detector": "custom_term",
2816
+ "end": 16,
2817
+ "line": 1,
2818
+ "risk": "high",
2819
+ "start": 13
2820
+ }
2821
+ ],
2822
+ "redact": "*** defx and ***"
2823
+ },
2446
2824
  "terms/word-boundary": {
2447
2825
  "findings": [
2448
2826
  {
@@ -2,9 +2,9 @@
2
2
  "$schema": "./detectors.schema.json",
3
3
  "spec": "FRS-1",
4
4
  "id": "flare-redact/core",
5
- "version": "1.11.0",
5
+ "version": "1.12.1",
6
6
  "title": "flare-redact core detector pack",
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.",
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, Rust, Java and .NET engines compile it to the same automaton and produce byte-identical output. See spec/SPEC.md.",
8
8
  "license": "MIT",
9
9
  "confidenceModel": {
10
10
  "version": 1,
@@ -366,7 +366,7 @@
366
366
  "flags": "i",
367
367
  "mask": {
368
368
  "type": "replace",
369
- "pattern": "({{ANY}}*[:=][ \\t\\n\\x0B\\f\\r]*[\"']?)[^ \\t\\n\\x0B\\f\\r\"',;]{4,}([\"']?)",
369
+ "pattern": "({{ANY}}*?[:=][ \\t\\n\\x0B\\f\\r]*[\"']?)[^ \\t\\n\\x0B\\f\\r\"',;]{4,}([\"']?)",
370
370
  "replacement": "$1***$2"
371
371
  },
372
372
  "default": true,
@@ -2600,7 +2600,7 @@
2600
2600
  "id": "swift_bic",
2601
2601
  "label": "SWIFT / BIC code",
2602
2602
  "why": "Identifies a bank for international transfers.",
2603
- "pattern": "[A-Z]{4}[A-Z]{2}[A-Z0-9]{2}(?:[A-Z0-9]{3})?",
2603
+ "pattern": "[A-Z]{4}(?:A[DEFGILMOQRSTUWXZ]|B[ABDEFGHIJLMNOQRSTVWYZ]|C[ACDFGHIKLMNORUVWXYZ]|D[EJKMOZ]|E[CEGHRST]|F[IJKMOR]|G[ABDEFGHILMNPQRSTUWY]|H[KMNRTU]|I[DELMNOQRST]|J[EMOP]|K[EGHIMNPRWYZ]|L[ABCIKRSTUVY]|M[ACDEFGHKLMNOPQRSTUVWXYZ]|N[ACEFGILOPRUZ]|OM|P[AEFGHKLMNRSTWY]|QA|R[EOSUW]|S[ABCDEGHIJKLMNORSTVXYZ]|T[CDFGHJKLMNORTVWZ]|U[AGMSYZ]|V[ACEGINU]|W[FS]|XK|Y[ET]|Z[AMW])[A-Z0-9]{2}(?:[A-Z0-9]{3})?",
2604
2604
  "boundary": {
2605
2605
  "before": "word",
2606
2606
  "after": "word"
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://json-schema.org/draft/2020-12/schema",
3
3
  "$id": "https://flare-collection.github.io/flare-redact/spec/detectors.schema.json",
4
4
  "title": "FRS-1 detector pack",
5
- "description": "A portable, language-neutral description of a set of secret and PII detectors. Any FRS-1 engine (JavaScript, Python, Go, Rust) loading the same pack must produce identical findings. The normative prose lives in spec/SPEC.md.",
5
+ "description": "A portable, language-neutral description of a set of secret and PII detectors. Any FRS-1 engine (JavaScript, Python, Go, Rust, Java, .NET) loading the same pack must produce identical findings. The normative prose lives in spec/SPEC.md.",
6
6
  "type": "object",
7
7
  "required": ["spec", "id", "version", "detectors"],
8
8
  "additionalProperties": false,