Skip to content

Commit 9718351

Browse files
authored
feat(python): Update EventScrubber docs with new pii denylist (#11154)
1 parent ef40aaf commit 9718351

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

docs/platforms/python/configuration/options.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ If you enable this option, be sure to manually remove what you don't want to sen
111111

112112
<ConfigKey name="event-scrubber">
113113

114-
If <PlatformIdentifier name="send-default-pii" /> is turned off, scrubs the event payload for sensitive information from a `denylist`. See how to [configure the scrubber here](../../data-management/sensitive-data/#event-scrubber).
114+
Scrubs the event payload for sensitive information such as cookies, sessions, and passwords from a `denylist`. It can additionally be used to scrub from another `pii_denylist` if <PlatformIdentifier name="send-default-pii" /> is disabled. See how to [configure the scrubber here](../../data-management/sensitive-data/#event-scrubber).
115115

116116
</ConfigKey>
117117

platform-includes/configuration/event-scrubber/python.mdx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
If <PlatformIdentifier name="send-default-pii" /> is set to `False`, the default scrubber implementation will run automatically and filter anything in the [`denylist`](https://github.com/getsentry/sentry-python/blob/1.18.0/sentry_sdk/scrubber.py#L17-L58) from [potentially sensitive interfaces](/platforms/python/data-collected/) in the event payload.
1+
The default scrubber implementation will run automatically and filter anything in the [`denylist`](https://github.com/getsentry/sentry-python/blob/4b361c5c008aec1a33cf521014edc0297fbf89c1/sentry_sdk/scrubber.py#L15-L56) from [potentially sensitive interfaces](/platforms/python/data-collected/) in the event payload. These are typically security values such as passwords, authentication, sessions, cookies, and CSRF tokens.
2+
3+
Additionally, if <PlatformIdentifier name="send-default-pii" /> is set to `False`, the scrubber will also filter from a separate `pii_denylist` that typically has PII values such as IP addresses.
24

35
```python
46
import sentry_sdk
@@ -11,18 +13,19 @@ sentry_sdk.init(
1113
)
1214
```
1315

14-
You can also pass in a custom `denylist` to the `EventScrubber` class and filter additional fields that you want.
16+
You can also pass in a custom `denylist` or `pii_denylist` to the `EventScrubber` class and filter additional fields that you want. Make sure you extend the current lists if you want to use the default lists as well.
1517

1618
```python
17-
from sentry_sdk.scrubber import EventScrubber, DEFAULT_DENYLIST
19+
from sentry_sdk.scrubber import EventScrubber, DEFAULT_DENYLIST, DEFAULT_PII_DENYLIST
1820

1921
# custom denylist
2022
denylist = DEFAULT_DENYLIST + ["my_sensitive_var"]
23+
pii_denylist = DEFAULT_PII_DENYLIST + ["my_private_var"]
2124

2225
sentry_sdk.init(
2326
# ...
2427
send_default_pii=False,
25-
event_scrubber=EventScrubber(denylist=denylist),
28+
event_scrubber=EventScrubber(denylist=denylist, pii_denylist=pii_denylist),
2629
)
2730
```
2831

0 commit comments

Comments
 (0)