Skip to content

Commit 8b986db

Browse files
Potential fix for code scanning alert no. 31: Clear-text logging of sensitive information
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent ca85584 commit 8b986db

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

teaagent/cli/_handlers/_doctor.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -887,7 +887,8 @@ def _ensure_log_safe(value: Any) -> Any:
887887
if isinstance(value, dict):
888888
safe: dict[Any, Any] = {}
889889
for key, item in value.items():
890-
if _is_sensitive_key(key):
890+
key_text = str(key)
891+
if _is_sensitive_key(key) or _looks_like_sensitive_env_name(key_text):
891892
safe[key] = _REDACTED
892893
continue
893894
safe[key] = _ensure_log_safe(item)

0 commit comments

Comments
 (0)