Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ability to redact header values in JWT authentication info log #6200

Open
dupham-indeed opened this issue Oct 28, 2024 · 0 comments
Open

Ability to redact header values in JWT authentication info log #6200

dupham-indeed opened this issue Oct 28, 2024 · 0 comments

Comments

@dupham-indeed
Copy link

dupham-indeed commented Oct 28, 2024

Is your feature request related to a problem? Please describe.

Currently, once JWT is configured and the router spin up, the following info log will be printed out at startup:

2024-10-28T15:12:08.984490Z INFO  JWT authentication using JWKSets from jwks=[JwksConf { url: "<jwk_url>", poll_interval: 60s, issuer: Some("<issuer_url>"), algorithms: Some([ES256]), headers: [Header { name: "x-client-id", value: "<client_id_value>" }, Header { name: "x-api-key", value: "<api_key_value>" }, Header { name: "x-client-version", value: "<client_version_value>" }] }]

For our situation, <api_key_value> is considered a sensitive value and shouldn't be printed out in the logs, which can be viewed in observability tools such as Datadog. We would like to have the ability to have that value redacted for security concerns.

Describe the solution you'd like

One possibility

authentication:
  router:
    jwt:
      jwks:
        - url: <jwk_url>
          headers:
            - name: x-api-key
              value: <api_key_value>
              is_sensitive: true # (default value is false)

Then the output will look like

2024-10-28T15:12:08.984490Z INFO  JWT authentication using JWKSets from jwks=[JwksConf { url: "<jwk_url>", poll_interval: 60s, issuer: Some("<issuer_url>"), algorithms: Some([ES256]), headers: [Header { name: "x-client-id", value: "<client_id_value>" }, Header { name: "x-api-key", value: "redacted" }, Header { name: "x-client-version", value: "<client_version_value>" }] }]

Describe alternatives you've considered

A clear and concise description of any alternative solutions or features you've considered.

Additional context

Add any other context or screenshots about the feature request here.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant