Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URL query string values should be redacted by default #961

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .chloggen/961.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Use this changelog template to create an entry for release notes.
#
# If your change doesn't affect end users you should instead start
# your pull request title with [chore] or use the "Skip Changelog" label.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recognize that the specification allows this as a non-breaking change because it is an attribute value, but I am very concerned about the end user experience of this change. This change will break alerts/slos/boards that expect query parameters to be present in the attribute named url.full or url.query.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Especially painful for users who are treating the query parameters as non-sensitive data

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, in practice this can be a pretty substantial breaking change for end users, most of whom likely don't have sensitive information in these query params


# The name of the area of concern in the attributes-registry, (e.g. http, cloud, db)
component: url

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Query string values are now redacted by default due to concerns around leaking sensitive data.

# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
# The values here must be integers.
issues: [ 860 ]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
7 changes: 5 additions & 2 deletions docs/attributes-registry/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ linkTitle: URL

**[3]:** For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.
`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed).
Query string values SHOULD be redacted by default and replaced by the value `REDACTED`, e.g. `https://www.example.com/path?abc=REDACTED&xyz=REDACTED` (the query string keys SHOULD be preserved).
Instrumentation MAY provide a configuration option to capture the full query string without any redaction.

**[4]:** In network monitoring, the observed URL may be a full URL, whereas in access logs, the URL is often just represented as a path. This field is meant to represent the URL as it was observed, complete or not.
`url.original` might contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case password and username SHOULD NOT be redacted and attribute's value SHOULD remain the same.

**[5]:** Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it.

**[6]:** Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it.
**[6]:** Query string values SHOULD be redacted by default and replaced by the value `REDACTED`, e.g. `abc=REDACTED&xyz=REDACTED` (the query string keys SHOULD be preserved).
Instrumentation MAY provide a configuration option to capture the full query string without any redaction.

**[7]:** This value can be determined precisely with the [public suffix list](http://publicsuffix.org). For example, the registered domain for `foo.example.com` is `example.com`. Trying to approximate this by simply taking the last two labels will not work well for TLDs such as `co.uk`.

Expand Down
4 changes: 3 additions & 1 deletion docs/database/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original

**[3]:** For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.
`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed).
Query string values SHOULD be redacted by default and replaced by the value `REDACTED`, e.g. `https://www.example.com/path?abc=REDACTED&xyz=REDACTED` (the query string keys SHOULD be preserved).
Instrumentation MAY provide a configuration option to capture the full query string without any redaction.
trask marked this conversation as resolved.
Show resolved Hide resolved

**[4]:** Many Elasticsearch url paths allow dynamic values. These SHOULD be recorded in span attributes in the format `db.elasticsearch.path_parts.<key>`, where `<key>` is the url path part name. The implementation SHOULD reference the [elasticsearch schema](https://raw.githubusercontent.com/elastic/elasticsearch-specification/main/output/schema/schema.json) in order to map the path part values to their names.

Expand Down
7 changes: 5 additions & 2 deletions docs/http/http-spans.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,9 @@ Tracing instrumentations that do so, MUST also set `http.request.method_original

**[4]:** For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.
`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed).
Query string values SHOULD be redacted by default and replaced by the value `REDACTED`, e.g. `https://www.example.com/path?abc=REDACTED&xyz=REDACTED` (the query string keys SHOULD be preserved).
Instrumentation MAY provide a configuration option to capture the full query string without any redaction.

**[5]:** If the request fails with an error before response status code was sent or received,
`error.type` SHOULD be set to exception type (its fully-qualified class name, if applicable)
Expand Down Expand Up @@ -393,7 +395,8 @@ SHOULD include the [application root](/docs/http/http-spans.md#http-server-defin

**[9]:** See [Setting `server.address` and `server.port` attributes](/docs/http/http-spans.md#setting-serveraddress-and-serverport-attributes).

**[10]:** Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it.
**[10]:** Query string values SHOULD be redacted by default and replaced by the value `REDACTED`, e.g. `abc=REDACTED&xyz=REDACTED` (the query string keys SHOULD be preserved).
Instrumentation MAY provide a configuration option to capture the full query string without any redaction.
trask marked this conversation as resolved.
Show resolved Hide resolved

**[11]:** The IP address of the original client behind all proxies, if known (e.g. from [Forwarded#for](https://developer.mozilla.org/docs/Web/HTTP/Headers/Forwarded#for), [X-Forwarded-For](https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Forwarded-For), or a similar header). Otherwise, the immediate client peer address.

Expand Down
7 changes: 5 additions & 2 deletions docs/url/url.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,14 @@ This document defines semantic conventions that describe URL and its components.

**[1]:** For network calls, URL usually has `scheme://host[:port][path][?query][#fragment]` format, where the fragment is not transmitted over HTTP, but if it is known, it SHOULD be included nevertheless.
`url.full` MUST NOT contain credentials passed via URL in form of `https://username:password@www.example.com/`. In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed). Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it.
`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed).
Query string values SHOULD be redacted by default and replaced by the value `REDACTED`, e.g. `https://www.example.com/path?abc=REDACTED&xyz=REDACTED` (the query string keys SHOULD be preserved).
Instrumentation MAY provide a configuration option to capture the full query string without any redaction.

**[2]:** Sensitive content provided in `url.path` SHOULD be scrubbed when instrumentations can identify it.

**[3]:** Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it.
**[3]:** Query string values SHOULD be redacted by default and replaced by the value `REDACTED`, e.g. `abc=REDACTED&xyz=REDACTED` (the query string keys SHOULD be preserved).
Instrumentation MAY provide a configuration option to capture the full query string without any redaction.
<!-- endsemconv -->

## Sensitive information
Expand Down
11 changes: 9 additions & 2 deletions model/registry/url.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
In such case username and password SHOULD be redacted and attribute's value SHOULD be `https://REDACTED:REDACTED@www.example.com/`.

`url.full` SHOULD capture the absolute URL when it is available (or can be reconstructed).
Sensitive content provided in `url.full` SHOULD be scrubbed when instrumentations can identify it.

Query string values SHOULD be redacted by default and replaced by the value `REDACTED`, e.g.
`https://www.example.com/path?abc=REDACTED&xyz=REDACTED` (the query string keys SHOULD be preserved).

Check failure on line 48 in model/registry/url.yaml

View workflow job for this annotation

GitHub Actions / yamllint

[trailing-spaces] trailing spaces
Instrumentation MAY provide a configuration option to capture the full query string without any redaction.
trask marked this conversation as resolved.
Show resolved Hide resolved
examples: ['https://www.foo.bar/search?q=OpenTelemetry#SemConv', '//localhost']
- id: original
type: string
Expand Down Expand Up @@ -77,7 +81,10 @@
The [URI query](https://www.rfc-editor.org/rfc/rfc3986#section-3.4) component
examples: ["q=OpenTelemetry"]
note: >
Sensitive content provided in `url.query` SHOULD be scrubbed when instrumentations can identify it.
Query string values SHOULD be redacted by default and replaced by the value `REDACTED`, e.g.
`abc=REDACTED&xyz=REDACTED` (the query string keys SHOULD be preserved).

Instrumentation MAY provide a configuration option to capture the full query string without any redaction.
trask marked this conversation as resolved.
Show resolved Hide resolved
- id: registered_domain
type: string
stability: experimental
Expand Down
Loading