-
Notifications
You must be signed in to change notification settings - Fork 0
Fix prompt div e14a0 #14
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
base: main
Are you sure you want to change the base?
Conversation
| ) | ||
| for secret in secrets_found: | ||
| env_var = secret.upper().replace(".", "_").replace("-", "_") | ||
| logger.warning(f" - {secret} -> Set STREAMTV_{env_var} environment variable") |
Check failure
Code scanning / CodeQL
Clear-text logging of sensitive information High
sensitive data (secret)
This expression logs
sensitive data (secret)
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix
AI 7 days ago
In general, to fix clear-text logging of sensitive information, avoid including any data derived from secrets in log messages. Log only high-level, non-sensitive information (e.g., that a secret is misconfigured) and, if necessary, generic identifiers that are not tainted by secret-handling flows.
For this specific case, the minimal, behavior-preserving fix is to change the per-secret warning so it no longer interpolates the secret value (which CodeQL taints) into the message. Instead, we can log only the derived environment variable name, or even a fully generic message. The core functionality here is to tell users to use environment variables instead of config-file secrets; that can be achieved by logging the recommended environment variable names alone.
Concretely:
- In
Config._warn_secrets_in_config, keep buildingsecrets_foundthe same way. - Keep the initial high-level warning at lines 268–271 as-is.
- Change the loop at lines 272–274 so that:
- We no longer include
secretin the formatted log string. - We only mention the environment variable name to set, e.g.
" - Set STREAMTV_{env_var} environment variable".
- We no longer include
- This removes tainted data from the log sink while preserving the user guidance.
No new methods or imports are required.
-
Copy modified line R274
| @@ -271,7 +271,7 @@ | ||
| ) | ||
| for secret in secrets_found: | ||
| env_var = secret.upper().replace(".", "_").replace("-", "_") | ||
| logger.warning(f" - {secret} -> Set STREAMTV_{env_var} environment variable") | ||
| logger.warning(f" - Set STREAMTV_{env_var} environment variable") | ||
| logger.warning( | ||
| "See .env.example for a template of all environment variables." | ||
| ) |
Description
Brief description of changes
Type of Change
Testing
Checklist
Related Issues
Closes #(issue number)
Screenshots (if applicable)
Add screenshots to help explain your changes.
Additional Notes
Any additional information that reviewers should know.