Skip to content

fix(logging): redact Azure api-key header in HttpLoggingInterceptor#717

Open
vincerevu wants to merge 1 commit intoopenai:mainfrom
vincerevu:jules-security-api-key-redaction-8195430166442096674
Open

fix(logging): redact Azure api-key header in HttpLoggingInterceptor#717
vincerevu wants to merge 1 commit intoopenai:mainfrom
vincerevu:jules-security-api-key-redaction-8195430166442096674

Conversation

@vincerevu
Copy link
Copy Markdown

Summary

This PR prevents Azure API keys from being exposed in application logs by redacting the api-key header in HttpLoggingInterceptor.

What changed

  • added redactHeader("api-key")
  • kept the existing redactHeader("Authorization")
  • applied the change in the OkHttp logging interceptor configuration

Why

When request logging is enabled, the Azure api-key header may otherwise be written to logs in plaintext. This creates a risk of credential leakage during debugging or in downstream log systems.

Impact

  • improves protection of sensitive credentials in logs
  • does not change request behavior
  • only affects logging output

Verification

  • reviewed the interceptor configuration to confirm both sensitive headers are redacted
  • change uses standard OkHttp HttpLoggingInterceptor API
  • local Gradle verification was limited by command timeout, but the modification is straightforward and low risk

When `OPENAI_LOG` is configured, `HttpLoggingInterceptor` logs HTTP requests/responses. Previously, only the `Authorization` header was redacted. This commit also redacts the `api-key` header to ensure Azure API keys are not exposed in application logs.
@vincerevu vincerevu requested a review from a team as a code owner April 11, 2026 02:12
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.

1 participant