Skip to content

Commit 93abbcf

Browse files
committed
docs(sensitive-data): Overhaul docs around HTTP headers
1 parent 5785050 commit 93abbcf

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed

develop-docs/sdk/expected-features/data-handling.mdx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,22 @@ In the event that API returns data considered PII, we guard that behind a flag c
1313
This is an option in the SDK called [_send-default-pii_](https://docs.sentry.io/platforms/python/configuration/options/#send-default-pii)
1414
and is **disabled by default**. That means that data that is naturally sensitive is not sent by default.
1515

16-
Some examples of data guarded by this flag:
16+
Handling sensitive data in the SDK regardless of the `send_default_pii` setting:
17+
18+
- HTTP Headers: The keys of known sensitive headers (such as `Authorization` or `Cookie`) are added, while their values must be replaced with `"[Filtered]"`.
19+
20+
<Expandable title="List of sensitive HTTP headers">
21+
22+
The SDK performs a **partial, case-insensitive match** against the following headers to determine if they are sensitive:
23+
24+
`['auth', 'token', 'secret', 'cookie', '-user', 'password', 'key', 'jwt', 'bearer', 'sso', 'saml']`
25+
26+
</Expandable>
27+
28+
Some examples of data guarded by `send_default_pii: false`:
1729

1830
- When attaching data of HTTP requests and/or responses to events
1931
- Request Body: "raw" HTTP bodies (bodies which cannot be parsed as JSON or formdata) are removed
20-
- HTTP Headers: known sensitive headers such as `Authorization` or `Cookie` are removed too.
2132
- _Note_ that if a user explicitly sets a request on the scope, nothing is stripped from that request. The above rules only apply to integrations that come with the SDK.
2233
- User-specific information (e.g. the current user ID according to the used web-framework) is not sent at all.
2334
- On desktop applications

develop-docs/sdk/expected-features/index.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ The HTTP Client integration should have 3 configuration options:
361361
- If the language has a `Range` type, it should be used instead of `HttpStatusCodeRange`.
362362
- `failedRequestTargets` defaults to (`.*`), this configuration option accepts a `List` of `String` that may be Regular expressions as well, similar to <Link to="/sdk/telemetry/traces/#tracepropagationtargets">tracePropagationTargets</Link>.
363363
- The SDK will only capture HTTP Client errors if the HTTP Request URL is a match for any of the `failedRequestsTargets`.
364-
- sensitive `headers` should only be set if `sendDefaultPii` is enabled, e.g. `Cookie` and `Set-Cookie`.
364+
- While the keys of sensitive HTTP headers (e.g. `Cookie` and `Set-Cookie`) are included, their values must be replaced with `"[Filtered]"` (also see <Link to="/sdk/expected-features/data-handling/#sensitive-data">Data Handling: Sensitive Data</Link>).
365365

366366
The HTTP Client integration should capture error events with the following properties:
367367

0 commit comments

Comments
 (0)