Skip to content

fix: [CCM-34691]: Redact sensitive HTTP/RPC header values in span attributes#16

Open
suryanarayanan-venkatesan wants to merge 1 commit into
harness:mainfrom
suryanarayanan-venkatesan:fix/redact-sensitive-headers
Open

fix: [CCM-34691]: Redact sensitive HTTP/RPC header values in span attributes#16
suryanarayanan-venkatesan wants to merge 1 commit into
harness:mainfrom
suryanarayanan-venkatesan:fix/redact-sensitive-headers

Conversation

@suryanarayanan-venkatesan

Copy link
Copy Markdown

BaseInstrumentorWrapper.add_headers_to_span() wrote every captured header value onto the span verbatim. Because the OpenAI/Anthropic SDKs make their API calls over httpx, the HTTP instrumentation fired alongside the GenAI instrumentation and exported the provider credential (Authorization: Bearer sk-..., x-api-key: sk-ant-...) into telemetry.

Add a default denylist of credential-bearing headers (authorization, proxy-authorization, x-api-key, api-key, apikey, x-auth-token, x-amz-security-token, x-goog-api-key, cookie, set-cookie, x-harness-service-token, x-harness-token) and replace their values with [REDACTED] in the single choke point used by both the HTTP (requests/httpx/aiohttp) and RPC (gRPC) handlers. Matching is case-insensitive; benign header values are unchanged.

Adds unit tests covering redaction, case-insensitivity, and pass-through.

BaseInstrumentorWrapper.add_headers_to_span() wrote every captured header
value onto the span verbatim. Because the OpenAI/Anthropic SDKs make their
API calls over httpx, the HTTP instrumentation fired alongside the GenAI
instrumentation and exported the provider credential
(Authorization: Bearer sk-..., x-api-key: sk-ant-...) into telemetry.

Add a default denylist of credential-bearing headers (authorization,
proxy-authorization, x-api-key, api-key, apikey, x-auth-token,
x-amz-security-token, x-goog-api-key, cookie, set-cookie,
x-harness-service-token, x-harness-token) and replace their values with
[REDACTED] in the single choke point used by both the HTTP
(requests/httpx/aiohttp) and RPC (gRPC) handlers. Matching is
case-insensitive; benign header values are unchanged.

Adds unit tests covering redaction, case-insensitivity, and pass-through.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@suryanarayanan-venkatesan suryanarayanan-venkatesan changed the title Redact sensitive HTTP/RPC header values in span attributes fix: [CCM-34691]: Redact sensitive HTTP/RPC header values in span attributes Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants