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

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

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

fabriziosalmi
Copy link
Owner

Potential fix for https://github.com/fabriziosalmi/caddy-waf/security/code-scanning/42

To fix the problem, we need to ensure that sensitive information is redacted or obfuscated before being logged. This can be achieved by implementing a function that checks for sensitive keys and redacts their values in the log fields. We will modify the prepareLogFields function to include this redaction process.

  1. Implement a function to redact sensitive information in the log fields.
  2. Modify the prepareLogFields function to call the redaction function before returning the log fields.
  3. Ensure that the redaction function checks for keys in the sensitiveKeys array and replaces their values with a redacted string.

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

…ensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
@fabriziosalmi fabriziosalmi reopened this Jan 22, 2025
@fabriziosalmi fabriziosalmi marked this pull request as ready for review January 22, 2025 19:40
@fabriziosalmi fabriziosalmi merged commit b503785 into main Jan 22, 2025
8 of 9 checks passed
@fabriziosalmi fabriziosalmi deleted the alert-autofix-42 branch January 22, 2025 19:41
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