Skip to content

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

Merged
poad merged 1 commit into
mainfrom
alert-autofix-2
Aug 10, 2025
Merged

Potential fix for code scanning alert no. 2: Clear-text logging of sensitive information#107
poad merged 1 commit into
mainfrom
alert-autofix-2

Conversation

@poad

@poad poad commented Aug 10, 2025

Copy link
Copy Markdown
Owner

Potential fix for https://github.com/poad/llm-ts-example/security/code-scanning/2

To fix the problem, we must ensure that sensitive information such as API keys is never logged, even in development. The best way to do this is to remove or comment out the line that logs process.env.AZURE_OPENAI_API_KEY. If logging is needed for debugging, log only non-sensitive information or a message indicating whether the key is set (without revealing its value). The change should be made in rag/batch/src/embeddings-models.ts, specifically on line 12. No new imports or methods are needed.


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

…nsitive information

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

Copy link
Copy Markdown
Contributor

⏳ I'm reviewing this pull request for security vulnerabilities and code quality issues. I'll provide an update when I'm done

@amazon-q-developer

Copy link
Copy Markdown
Contributor

✅ I finished the code review, and didn't find any security or code quality issues.

@poad
poad marked this pull request as ready for review August 10, 2025 04:20
@poad
poad merged commit acad40a into main Aug 10, 2025
5 of 6 checks passed
@poad
poad deleted the alert-autofix-2 branch August 10, 2025 04:20
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