Skip to content

Add safe example to javascript_lang_logger_leak #1701

@pleymor

Description

@pleymor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions