You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
opentelemetry-util-http: redact_url leaves the SigV4 X-Amz-* query values of presigned URLs unredacted #5284
OS: Ubuntu 24.04
Python version: 3.12
Package version: opentelemetry-util-http from main at 0715515 (api and semantic-conventions from opentelemetry-python main at dc7dbaf)
What happened?
A presigned S3 URL reaches url.full with its credential, session token and signature intact. PARAMS_TO_REDACT (util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py:59) holds the SigV2 names only, so redact_url never matches the SigV4 X-Amz-* keys that S3 presigns with by default.
The url registry lists all three X-Amz-* keys among those that SHOULD be redacted by default.
Actual Result
$ .venv/bin/python -I repro.py
.../util/opentelemetry-util-http/src/opentelemetry/util/http/__init__.py
https://bucket.s3.us-east-1.amazonaws.com/report.csv?X-Amz-Credential=ASIAEXAMPLE%2F20261029%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Security-Token=session-token&X-Amz-Signature=deadbeef
# not run: the instrumentation test suites
Additional context
This follows up #2992. #3508 implemented its list, and the registry later moved to the SigV4 names. #4944 and #4960 touch the function, not the list.
The fix is to add the three SigV4 names and keep the SigV2 ones for old presigned URLs. With that change the script prints the expected line. I can send the PR with a test in tests/test_redact_query_parameters.py.
Would you like to implement a fix?
Yes
Tip
React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Duplicate of #5279, which was filed earlier the same day, and the draft #5280 makes the same change. The script from this issue, run against #5280's head, prints the redacted line, and the PR's four new tests fail with the old list:
$ python -I repro.py # #5280 head 2ca7de8, opentelemetry-util-http installed editable
https://bucket.s3.us-east-1.amazonaws.com/report.csv?X-Amz-Credential=REDACTED&X-Amz-Security-Token=REDACTED&X-Amz-Signature=REDACTED
$ python -m pytest tests/test_redact_query_parameters.py -q
16 passed in 0.02s
# __init__.py from base dc9f666, tests kept:
4 failed, 12 passed in 0.06s
I'm closing this one so the thread stays on #5279.
Activity
chrikrah commentedon Nov 5, 2026
Duplicate of #5279, which was filed earlier the same day, and the draft #5280 makes the same change. The script from this issue, run against #5280's head, prints the redacted line, and the PR's four new tests fail with the old list:
I'm closing this one so the thread stays on #5279.