flare-redact 0.5.0 โ 0.6.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.
- package/README.md +64 -5
- package/dist/bip39.d.ts +4 -0
- package/dist/bip39.d.ts.map +1 -0
- package/dist/bip39.js +2061 -0
- package/dist/bip39.js.map +1 -0
- package/dist/checksums.d.ts +27 -0
- package/dist/checksums.d.ts.map +1 -0
- package/dist/checksums.js +192 -0
- package/dist/checksums.js.map +1 -0
- package/dist/cli.js +1 -1
- package/dist/detectors.d.ts +3 -0
- package/dist/detectors.d.ts.map +1 -1
- package/dist/detectors.js +14 -11
- package/dist/detectors.js.map +1 -1
- package/dist/engine.d.ts.map +1 -1
- package/dist/engine.js +12 -6
- package/dist/engine.js.map +1 -1
- package/dist/extra.d.ts +8 -0
- package/dist/extra.d.ts.map +1 -0
- package/dist/extra.js +173 -0
- package/dist/extra.js.map +1 -0
- package/dist/i18n.d.ts +13 -0
- package/dist/i18n.d.ts.map +1 -0
- package/dist/i18n.js +74 -0
- package/dist/i18n.js.map +1 -0
- package/dist/locales.d.ts +11 -0
- package/dist/locales.d.ts.map +1 -0
- package/dist/locales.js +113 -0
- package/dist/locales.js.map +1 -0
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -12,10 +12,18 @@
|
|
|
12
12
|
<a href="https://www.npmjs.com/package/flare-redact"><img src="https://img.shields.io/npm/v/flare-redact.svg" alt="npm"></a>
|
|
13
13
|
<a href="https://github.com/umudhasanli/flare-redact/actions/workflows/ci.yml"><img src="https://github.com/umudhasanli/flare-redact/actions/workflows/ci.yml/badge.svg" alt="CI"></a>
|
|
14
14
|
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg" alt="MIT License"></a>
|
|
15
|
+
<img src="https://img.shields.io/npm/types/flare-redact.svg" alt="TypeScript">
|
|
15
16
|
<img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="Zero dependencies">
|
|
17
|
+
<img src="https://img.shields.io/badge/languages-24-4f46e5" alt="24 languages">
|
|
18
|
+
<img src="https://img.shields.io/badge/detectors-50-4f46e5" alt="50 detectors">
|
|
16
19
|
<img src="https://img.shields.io/badge/runtime-node%20%7C%20browser%20%7C%20edge-blue" alt="Runtimes">
|
|
17
20
|
</p>
|
|
18
21
|
|
|
22
|
+
<p align="center">
|
|
23
|
+
๐ <b>International by default โ 24 languages</b><br>
|
|
24
|
+
๐ฌ๐ง ๐จ๐ณ ๐ฎ๐ณ ๐ช๐ธ ๐ธ๐ฆ ๐ซ๐ท ๐ต๐น ๐ท๐บ ๐ฏ๐ต ๐ฉ๐ช ๐ฐ๐ท ๐น๐ท ๐ฎ๐น ๐ฎ๐ท ๐ต๐ฑ ๐บ๐ฆ ๐ณ๐ฑ ๐ป๐ณ ๐ฎ๐ฉ ๐น๐ญ ๐ฌ๐ท ๐ฎ๐ฑ ๐ฆ๐ฟ ๐ท๐ด
|
|
25
|
+
</p>
|
|
26
|
+
|
|
19
27
|
---
|
|
20
28
|
|
|
21
29
|
Every leaked secret has the same origin story: someone logged an object, and a
|
|
@@ -42,6 +50,18 @@ Nothing to configure. No list of field paths to maintain. No native build step.
|
|
|
42
50
|
> reply โ the model never sees the real data, your app still gets the right answer.
|
|
43
51
|
> [Jump to it โ](#redact-prompts-before-they-reach-an-llm)
|
|
44
52
|
|
|
53
|
+
<p align="center">
|
|
54
|
+
<picture>
|
|
55
|
+
<source media="(prefers-color-scheme: dark)" srcset="assets/coverage-dark.svg">
|
|
56
|
+
<img src="assets/coverage-light.svg" alt="One policy applied across app, logs, HTTP, LLM, datasets, and egress" width="820">
|
|
57
|
+
</picture>
|
|
58
|
+
</p>
|
|
59
|
+
|
|
60
|
+
| | | |
|
|
61
|
+
|---|---|---|
|
|
62
|
+
| ๐ **Content-aware** โ reads values, not just field names | โป๏ธ **Reversible** โ vault: redact โ use โ restore | ๐ญ **Format-preserving** โ emails stay email-shaped |
|
|
63
|
+
| ๐ค **LLM-safe** โ strips secrets before OpenAI/Anthropic | ๐ **24 languages** โ plus checksum-validated national IDs | ๐ก๏ธ **ReDoS-safe ยท 0 deps** โ safe on untrusted input |
|
|
64
|
+
|
|
45
65
|
## Contents
|
|
46
66
|
|
|
47
67
|
- [Install](#install)
|
|
@@ -58,6 +78,7 @@ Nothing to configure. No list of field paths to maintain. No native build step.
|
|
|
58
78
|
- [Fail a build when a secret sneaks in](#fail-a-build-when-a-secret-sneaks-in)
|
|
59
79
|
- [CLI](#cli)
|
|
60
80
|
- [What it catches](#what-it-catches)
|
|
81
|
+
- [Every language, every country](#every-language-every-country)
|
|
61
82
|
- [Custom detectors & allowlists](#custom-detectors--allowlists)
|
|
62
83
|
- [API](#api)
|
|
63
84
|
- [Why not a field allowlist?](#why-not-a-field-allowlist)
|
|
@@ -354,23 +375,61 @@ On by default:
|
|
|
354
375
|
| `bearer_token` | `Authorization: Bearer โฆ` |
|
|
355
376
|
| `basic_auth` | `Authorization: Basic โฆ` |
|
|
356
377
|
| `url_credentials` | passwords inside connection strings |
|
|
357
|
-
| `generic_assignment` | `password=`, `api_key: โฆ`, `secret=โฆ` |
|
|
378
|
+
| `generic_assignment` | `password=`, `api_key: โฆ`, `secret=โฆ` (any language) |
|
|
358
379
|
| `email` | email addresses |
|
|
359
380
|
| `credit_card` | card numbers (Luhn-validated) |
|
|
381
|
+
| `iban` | IBANs (mod-97 validated) |
|
|
382
|
+
| `discord_bot_token` / `telegram_bot_token` | chat bot tokens |
|
|
383
|
+
| `shopify_token` / `square_token` | commerce tokens |
|
|
384
|
+
| `digitalocean_token` / `azure_storage_key` | cloud secrets |
|
|
385
|
+
| `sentry_dsn` / `new_relic_key` | observability secrets |
|
|
360
386
|
|
|
361
387
|
Opt in with `enable`:
|
|
362
388
|
|
|
363
|
-
| Detector | Finds |
|
|
389
|
+
| Detector / tag | Finds |
|
|
364
390
|
|---|---|
|
|
365
391
|
| `high_entropy` | long random-looking tokens of *any* format (entropy-based) |
|
|
392
|
+
| `crypto` | Bitcoin & Ethereum addresses, BIP39 seed phrases |
|
|
393
|
+
| `finance` | SWIFT/BIC, US ABA routing numbers |
|
|
394
|
+
| `vehicle` | VINs (checksum-validated) |
|
|
395
|
+
| `network` | IPs, MAC addresses, coordinates, internal URLs |
|
|
366
396
|
| `phone` | E.164 phone numbers |
|
|
367
|
-
| `ssn` | US Social Security numbers |
|
|
368
|
-
| `ipv4` / `ipv6` | IP addresses |
|
|
369
|
-
| `mac_address` | MAC addresses |
|
|
370
397
|
|
|
371
398
|
Plus object values whose **key name** is sensitive (`password`, `token`,
|
|
372
399
|
`authorization`, `cookie`, `cvv`, โฆ) are masked regardless of content.
|
|
373
400
|
|
|
401
|
+
## Every language, every country
|
|
402
|
+
|
|
403
|
+
Secrets like API keys and card numbers don't care what language your app is in.
|
|
404
|
+
Neither does this โ but the word-based checks do, so `password`, `secret`, and
|
|
405
|
+
`token` are recognized in **24 languages** (`ลifrษ=โฆ`, `ๅฏ็ : โฆ`, `ะฟะฐัะพะปั=โฆ`,
|
|
406
|
+
`contraseรฑa: โฆ`), as assignments and as object keys.
|
|
407
|
+
|
|
408
|
+
National IDs are opt-in and **checksum-validated**, so a random run of digits is
|
|
409
|
+
never mistaken for one. Enable a whole group or a single country by tag:
|
|
410
|
+
|
|
411
|
+
```js
|
|
412
|
+
redact(text, { enable: ['pii'] }); // every national ID below
|
|
413
|
+
redact(text, { enable: ['tr', 'de'] }); // just Turkish and German
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
| Detector | Country | Validated by |
|
|
417
|
+
|---|---|---|
|
|
418
|
+
| `iban` | ๐ international *(on by default)* | ISO 13616 mod-97 |
|
|
419
|
+
| `tr_tckn` | ๐น๐ท Turkey | TCKN checksum |
|
|
420
|
+
| `de_tax_id` | ๐ฉ๐ช Germany | ISO 7064 mod-11,10 |
|
|
421
|
+
| `es_dni` | ๐ช๐ธ Spain (DNI/NIE) | control letter mod-23 |
|
|
422
|
+
| `it_codice_fiscale` | ๐ฎ๐น Italy | odd/even table |
|
|
423
|
+
| `br_cpf` | ๐ง๐ท Brazil | two mod-11 digits |
|
|
424
|
+
| `nl_bsn` | ๐ณ๐ฑ Netherlands | 11-test |
|
|
425
|
+
| `pl_pesel` | ๐ต๐ฑ Poland | weighted mod-10 |
|
|
426
|
+
| `ca_sin` | ๐จ๐ฆ Canada | Luhn |
|
|
427
|
+
| `us_ssn` | ๐บ๐ธ United States | issued-range rules |
|
|
428
|
+
| `uk_nhs` | ๐ฌ๐ง United Kingdom (NHS) | weighted mod-11 |
|
|
429
|
+
|
|
430
|
+
Every algorithm has its own tests against known-valid and known-invalid numbers,
|
|
431
|
+
so enabling them won't turn your logs into a wall of `[REDACTED]`.
|
|
432
|
+
|
|
374
433
|
## Custom detectors & allowlists
|
|
375
434
|
|
|
376
435
|
Teach it your own secrets, and tell it what to leave alone:
|
package/dist/bip39.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bip39.d.ts","sourceRoot":"","sources":["../src/bip39.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAigE1C,CAAC;AAIH,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAIjD"}
|