Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add safe example to javascript_lang_logger_leak #1701

Open
pleymor opened this issue Oct 22, 2024 · 0 comments
Open

Add safe example to javascript_lang_logger_leak #1701

pleymor opened this issue Oct 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@pleymor
Copy link

pleymor commented Oct 22, 2024

Would be nice to add an example of safe code to the Remediation section of javascript_lang_logger_leak

  • Do not include sensitive data directly in logger messages. This can lead to the exposure of such data in log files, which might be accessible to unauthorized individuals.
  • Do use logging levels appropriately to control the verbosity of log output and minimize the risk of leaking sensitive information in production environments.
logger.info(`Results: ${data}`) // unsafe
logger.info(`Results received: ${data.unsensitive}`) // safe as no sensitive data is output in info level
logger.debug(`Results: ${data}`) // safe: log the details of the issue with debug level only, disabled in production
@pleymor pleymor added the enhancement New feature or request label Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant