Skip to content

Potential fix for code scanning alert no. 422: Clear-text logging of sensitive information #3715

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

silvestre
Copy link
Member

Potential fix for https://github.com/cloudfoundry/app-autoscaler-release/security/code-scanning/422

To fix the issue, we need to ensure that sensitive information, such as the Password field, is not logged in clear text. The best approach is to exclude the Password field from the log entirely or replace it with a placeholder (e.g., "***"). This ensures that sensitive data is not exposed in the logs while still allowing other non-sensitive information to be logged for debugging purposes.

Specifically:

  1. Modify the logging statement on line 126 in src/autoscaler/db/sqldb/storedprocedure_sqldb.go to exclude the Password field from the creds object.
  2. Create a sanitized version of the creds object that omits or masks the Password field before passing it to the logger.

Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…sensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Copy link

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