Skip to content

Commit 96ff796

Browse files
Allowed configuration of Sentry send_default_pii parameter (netbox-community#16803)
* Allowed configuration of Sentry send_default_pii parameter. Also changed default value of send_default_pii to False to avoid sending sensitive data to Sentry. Closes netbox-community#16802 * Order alphabetically & link to Sentry parameter documentation --------- Co-authored-by: Jeremy Stretch <jstretch@netboxlabs.com>
1 parent d8d6658 commit 96ff796

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

docs/configuration/error-reporting.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ The sampling rate for errors. Must be a value between 0 (disabled) and 1.0 (repo
3131

3232
---
3333

34+
## SENTRY_SEND_DEFAULT_PII
35+
36+
Default: False
37+
38+
Maps to the Sentry SDK's [`send_default_pii`](https://docs.sentry.io/platforms/python/configuration/options/#send-default-pii) parameter. If enabled, certain personally identifiable information (PII) is added.
39+
40+
!!! warning "Sensitive data"
41+
If you enable this option, be aware that sensitive data such as cookies and authentication tokens will be logged.
42+
43+
---
44+
3445
## SENTRY_TAGS
3546

3647
An optional dictionary of tag names and values to apply to Sentry error reports.For example:

netbox/netbox/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
SENTRY_DSN = getattr(configuration, 'SENTRY_DSN', None)
148148
SENTRY_ENABLED = getattr(configuration, 'SENTRY_ENABLED', False)
149149
SENTRY_SAMPLE_RATE = getattr(configuration, 'SENTRY_SAMPLE_RATE', 1.0)
150+
SENTRY_SEND_DEFAULT_PII = getattr(configuration, 'SENTRY_SEND_DEFAULT_PII', False)
150151
SENTRY_TAGS = getattr(configuration, 'SENTRY_TAGS', {})
151152
SENTRY_TRACES_SAMPLE_RATE = getattr(configuration, 'SENTRY_TRACES_SAMPLE_RATE', 0)
152153
SESSION_COOKIE_NAME = getattr(configuration, 'SESSION_COOKIE_NAME', 'sessionid')
@@ -553,7 +554,7 @@ def _setting(name, default=None):
553554
release=VERSION,
554555
sample_rate=SENTRY_SAMPLE_RATE,
555556
traces_sample_rate=SENTRY_TRACES_SAMPLE_RATE,
556-
send_default_pii=True,
557+
send_default_pii=SENTRY_SEND_DEFAULT_PII,
557558
http_proxy=HTTP_PROXIES.get('http') if HTTP_PROXIES else None,
558559
https_proxy=HTTP_PROXIES.get('https') if HTTP_PROXIES else None
559560
)

0 commit comments

Comments
 (0)