Skip to content

Commit

Permalink
Fix Sentry sending PII even when turned off
Browse files Browse the repository at this point in the history
os.environ.get cannot get True/False flags from the environment
variables, so the result was being ignored. To fix this, use int values
and directly compare to see if users have enabled or disabled this
feature.
  • Loading branch information
ericswpark committed Jun 11, 2022
1 parent 942cb99 commit 206a546
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion config/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ def before_send(event, hint):
integrations=[DjangoIntegration()],
release=f"{SHIPPER_VERSION}",
traces_sample_rate=sentry_transaction_rate,
send_default_pii=os.environ.get("SHIPPER_SENTRY_SDK_PII", default=False),
send_default_pii=(int(os.environ.get("SHIPPER_SENTRY_SDK_PII", default=0)) == 0),
before_send=before_send,
ignore_errors=[
SSHException,
Expand Down
6 changes: 4 additions & 2 deletions docs/sysadmin/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ Copy the `.env.example` file and set the values:
- Default: ``, disabled
- `SHIPPER_SENTRY_SDK_PII`
- Send potential personally-identifiable information (PII) to Sentry when submitting bug reports
- Default: `False`
- Warning: if set to `True`, shipper may send PII such as usernames and email addresses. Set to `False` in production.
- `0` -> disabled
- Any other value -> enabled
- Default: `0`
- Warning: if enabled, shipper may send PII such as usernames and email addresses. Set to `False` in production.

## `.env.db`

Expand Down

0 comments on commit 206a546

Please sign in to comment.