Repository navigation
Conversation
…n to PARAMS_TO_REDACT PARAMS_TO_REDACT only covered AWSAccessKeyId, Signature, sig, and X-Goog-Signature. The semantic conventions url attribute registry also lists X-Amz-Signature, X-Amz-Credential, and X-Amz-Security-Token for redaction, so an S3 SigV4 presigned URL fetched through an instrumented client exported its signature, credential scope, and (for temporary credentials) the full STS session token verbatim in url.full/http.url. Fixes open-telemetry#5279 Assisted-by: Claude Sonnet 5
Assisted-by: Claude Sonnet 5
Pull request dashboard statusWaiting on maintainers · refreshed 2026-11-10 17:52 UTC Merge when ready. Status above doesn't look right?
|
|
Hi @Akshaay1, thanks for picking this up. I reported this in #5279, including the repro and test values your tests use, and I'd ticked that I wanted to implement the fix myself. It would have been nice to get a heads-up on the issue first. I'm happy for this PR to go ahead rather than open a competing one. Could you add me as a co-author on the commit, since the reproduction, test URLs and proposed fix come from the issue? Thanks! |
The reproduction, test URLs and proposed fix for this change come from issue open-telemetry#5279. Co-authored-by: preetsaini2004 <91930460+preetsaini2004@users.noreply.github.com>
|
Hi @preetsaini2004, you're right, I should have checked on the issue before opening this, sorry about that. Thanks for the detailed repro. I've added you as a co-author in 36017e6. EasyCLA now needs your signature before this can merge, so could you sign using the link in the bot's comment above? |
Description
opentelemetry.util.http.PARAMS_TO_REDACTonly coveredAWSAccessKeyId,Signature,sig, andX-Goog-Signature. The semantic conventions url attribute registry also listsX-Amz-Signature,X-Amz-Credential, andX-Amz-Security-Tokenas query parameters that SHOULD be redacted by default.Because those three keys were missing, an S3 SigV4 presigned URL fetched through an instrumented HTTP client (e.g.
httpx,requests) exported its signature, credential scope, and — for temporary credentials — the full STS session token verbatim in theurl.full/http.urlspan attribute.This adds the three missing keys to
PARAMS_TO_REDACTinopentelemetry-util-http, which is shared by the instrumentations that redact query parameters before setting URL attributes on spans.Fixes #5279
Type of change
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
tox -e precommittox -e typecheckTesting
test_redact_query_parameters.pycoveringX-Amz-Signature,X-Amz-Credential,X-Amz-Security-Token, and a full SigV4 presigned-URL case. Confirmed viagit stashthat all 4 fail on unmodifiedmain(the values pass through unredacted) and pass with the fix.pytest util/opentelemetry-util-http/tests/(excluding two unrelated files that fail to collect in this sandbox due to missingopentelemetry-test-utils/wraptdev dependencies, unrelated to this change): 61 passed, 13 subtests passed.ruff check/ruff format --checkon both changed files: clean.tox -e precommit/tox -e typecheckenvironments themselves (project-widetox/mypysetup wasn't fully reproducible in this sandbox); ran the equivalentruffchecks directly instead.This PR was prepared with AI assistance (see
Assisted-by:commit trailer), and I've reviewed and tested the change above.