feat: add configurable header redaction for logs#1240
Open
rdark wants to merge 1 commit intoory:masterfrom
Open
feat: add configurable header redaction for logs#1240rdark wants to merge 1 commit intoory:masterfrom
rdark wants to merge 1 commit intoory:masterfrom
Conversation
Add support for log.redact_headers configuration option to redact
additional sensitive headers beyond the defaults (authorization, cookie,
set-cookie, x-session-token). Headers specified in this configuration
will have their values masked in log output.
Configuration can be set via YAML:
log:
redact_headers:
- x-custom-authorization
- x-api-key
This prevents sensitive authentication headers from being logged,
improving security for deployments using non-standard auth headers.
Author
|
the format failing test seems to be not related to my change |
rdark
added a commit
to rdark/ory-docs
that referenced
this pull request
Oct 6, 2025
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When configuring oathkeeper to use a non standard auth header (such as
token_fromin the jwt authenticator), oathkeeper currently logs these tokens in plain text when configured at log levelINFOor above. There is no way currently to append additional headers to the default list of redacted headers.I considered implementing a matcher for some of these fields, but went with a more generic solution that allows the user to choose which arbitrary headers to redact from logging.
Add support for log.redact_headers configuration option to redact additional sensitive headers beyond the defaults (authorization, cookie, set-cookie, x-session-token). Headers specified in this configuration will have their values masked in log output.
Example configuration
Related issue(s)
Checklist
introduces a new feature.
contributing code guidelines.
vulnerability. If this pull request addresses a security vulnerability, I
confirm that I got the approval (please contact
security@ory.sh) from the maintainers to push
the changes.
works.
Further Comments