Skip to content

Commit 79e33b2

Browse files
Litarnusbitsandfoxes
authored andcommitted
ref(pii): add example for wildcard selector (#14029)
Adds an example to better visualise the behaviour of the deep wildcard selector (`**`) if used in a sub-path. closes RELAY-15
1 parent 53e74e2 commit 79e33b2

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

docs/security-legal-pii/scrubbing/advanced-datascrubbing.mdx

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,40 @@ You can combine sources using boolean logic.
142142
- `**` matches all subpaths, so that `foo.**` matches all JSON keys within `foo`.
143143
- `*` matches a single path item, so that `foo.*` matches all JSON keys one level below `foo`.
144144

145+
When using `**` selectors in scrubbing rules, be aware that they only apply to the [default event PII fields](/security-legal-pii/scrubbing/server-side-scrubbing/event-pii-fields/). Fields not on that list will **not** be scrubbed automatically, even if matched by a `**` selector.
146+
147+
For example, given the following event payload:
148+
149+
```json
150+
{
151+
"exception": {
152+
"values": [
153+
{
154+
"type": "Error",
155+
"value": "An error occurred",
156+
"stacktrace": {
157+
"frames": [
158+
{
159+
"filename": "test/example/script.js",
160+
"abs_path": "test/example/script.js?id=12345"
161+
}
162+
]
163+
}
164+
}
165+
]
166+
}
167+
}
168+
```
169+
170+
Using the scrubbing rule `[Mask] [Anything] from [$frame.**]` will not scrub the `filename` or `abs_path` fields, since they're not included in the default PII field list.
171+
172+
To scrub those fields, use one of the following rules:
173+
```
174+
[Mask] [Anything] from [$frame.*]
175+
[Mask] [Anything] from [$frame.filename]
176+
[Mask] [Anything] from [$frame.abs_path]
177+
```
178+
145179
### Value Types
146180

147181
Select subsections by JSON-type using the following:

0 commit comments

Comments
 (0)