diff --git a/.changeset/config.json b/.changeset/config.json index 6adb6ae8b7..21a0165fc0 100644 --- a/.changeset/config.json +++ b/.changeset/config.json @@ -25,7 +25,8 @@ "@rrweb/rrweb-plugin-canvas-webrtc-record", "@rrweb/rrweb-plugin-canvas-webrtc-replay", "@rrweb/rrweb-plugin-network-record", - "@rrweb/rrweb-plugin-network-replay" + "@rrweb/rrweb-plugin-network-replay", + "@rrweb/rrweb-plugin-privacy-detectors" ] ], "linked": [], diff --git a/.changeset/privacy-at-capture-detectors.md b/.changeset/privacy-at-capture-detectors.md new file mode 100644 index 0000000000..7f240f1f32 --- /dev/null +++ b/.changeset/privacy-at-capture-detectors.md @@ -0,0 +1,26 @@ +--- +"@rrweb/rrweb-plugin-privacy-detectors": minor +"rrweb": minor +"rrweb-snapshot": minor +"@rrweb/types": minor +--- + +Privacy at Capture: opt-in heuristic PII detectors (**experimental** -- no +production mileage in any shipped session-replay recorder). + +- Add `@rrweb/rrweb-plugin-privacy-detectors` (email, phone, Luhn-valid card, + SSN-like, IPv4): masks a whole page text node on match, at snapshot time + and on live `characterData` mutations. Never implied by a preset; opt in + via the plugin or `applyPrivacyDetectors`. Attribute values and custom + detector patterns are not supported. The plugin logs a one-time + `console.info` ("privacy-detectors active: input values record as + length-only stars") the first time it applies its policy. +- While any detector is active, every input value is occluded to its length + regardless of preset (no unmask escape reopens one) -- scanning a value as + typed would leak it through keystroke prefixes. +- Add the `RecordPlugin.applyPrivacyPolicy` hook so a plugin can transform + the policy before `record()` compiles it; see the plugin's README for known + limitations. +- Rebased onto the renamed rule actions: a policy handed to + `applyPrivacyDetectors` or the plugin uses `mask`/`block`/`unmask`, and + `vendorCompat` is carried through untouched. diff --git a/docs/recipes/plugin-api.md b/docs/recipes/plugin-api.md index e61be76eb0..649f12490e 100644 --- a/docs/recipes/plugin-api.md +++ b/docs/recipes/plugin-api.md @@ -12,6 +12,7 @@ The plugin API is designed to enable extending the functionality of rrweb withou - [@rrweb/rrweb-plugin-canvas-webrtc-replay](packages/plugins/rrweb-plugin-canvas-webrtc-replay): A plugin for playing streamed `` via WebRTC. - [@rrweb/rrweb-plugin-network-record](packages/plugins/rrweb-plugin-network-record): A plugin for recording network requests (xhr/fetch). - [@rrweb/rrweb-plugin-network-replay](packages/plugins/rrweb-plugin-network-replay): A plugin for replaying network requests (xhr/fetch). +- [@rrweb/rrweb-plugin-privacy-detectors](packages/plugins/rrweb-plugin-privacy-detectors): Opt-in heuristic PII matching (email, phone, card, SSN, IPv4). ## Interface diff --git a/guide.md b/guide.md index 1e4880569c..a3e2bad413 100644 --- a/guide.md +++ b/guide.md @@ -261,8 +261,8 @@ of preset or configuration. Masking an input value also suppresses the `selected` flag on the `