Skip to content

Secret console#4

Merged
Shubham4026 merged 1 commit into
mainfrom
dev-release
May 7, 2026
Merged

Secret console#4
Shubham4026 merged 1 commit into
mainfrom
dev-release

Conversation

@Shubham4026
Copy link
Copy Markdown
Collaborator

No description provided.

@Shubham4026 Shubham4026 merged commit f26ba6f into main May 7, 2026
1 check passed
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the JwtStrategy to enhance logging for the Keycloak public key configuration, including error reporting for missing keys and logging the full key value. A security concern was identified regarding the exposure of the full cryptographic key in logs, which could lead to sensitive data leakage if misconfigured. It is recommended to log only the key's length instead.

Comment on lines +14 to +15
logger.log(`KEYCLOAK_REALM_RSA_PUBLIC_KEY length: ${publicKey.length}`);
logger.log(`KEYCLOAK_REALM_RSA_PUBLIC_KEY full value:\n${publicKey}`);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

Logging the full content of a cryptographic key (even a public one) is a security risk. If the environment variable is misconfigured to contain a private key, it will be exposed in the logs. It is recommended to only log the length or a truncated version of the key to verify its presence.

Suggested change
logger.log(`KEYCLOAK_REALM_RSA_PUBLIC_KEY length: ${publicKey.length}`);
logger.log(`KEYCLOAK_REALM_RSA_PUBLIC_KEY full value:\n${publicKey}`);
logger.log('KEYCLOAK_REALM_RSA_PUBLIC_KEY loaded (length: ' + publicKey.length + ')');

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