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

Fix code scanning alert no. 6: Clear-text logging of sensitive information #413

Closed
wants to merge 1 commit into from

Conversation

mstmdev
Copy link
Member

@mstmdev mstmdev commented Dec 12, 2024

Fixes /~https://github.com/no-src/gofs/security/code-scanning/6

To fix the problem, we need to ensure that sensitive information, such as user passwords, is not logged in clear text. The best way to fix this issue without changing existing functionality is to modify the logging statement to exclude the password information. Instead of logging the entire cp.Users string, we should log only the usernames or other non-sensitive information.

We will modify the generateRandomUser function in the cmd/gofs.go file to log only the usernames of the generated users. This can be achieved by creating a new function that extracts and returns only the usernames from the user list.

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

…ation

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@mstmdev mstmdev closed this Dec 12, 2024
@mstmdev mstmdev deleted the alert-autofix-6 branch December 12, 2024 05:39
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