-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
AzureAD Default credentials - select credential type based on environment #14470
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
…l type from env var don't default to ClientSecretCredential unless present in env var
…fault azure credentials used in the right context
The latest updates on your projects. Learn more about Vercel for GitHub.
|
or infer_credential_type_from_environment() | ||
) | ||
verbose_logger.info( | ||
f"For Azure AD Token Provider, choosing credential type: {cred}" |
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 3 days ago
The best way to fix the issue is to ensure that no potentially sensitive credential information, including types that indicate secret material is present, are logged in clear text.
- We should remove or minimize the logging of which credential type is chosen from the line:
verbose_logger.info(f"For Azure AD Token Provider, choosing credential type: {cred}")
- If some logging is still desired for operational awareness, it should be redacted or limited (e.g., logging only that a credential was chosen, not the specific type), or log only if a safe setting is explicitly enabled.
- Change: in
litellm/secret_managers/get_azure_ad_token_provider.py
, remove or replace line 76-78 so it does not log the value of the credential type.- Option 1: Remove the line entirely.
- Option 2 (if you want to keep some logging): Replace it with a minimal, non-sensitive log such as "Azure AD Token Provider credential type chosen" (no actual value shown).
- No new imports or methods are needed.
-
Copy modified line R76
@@ -73,9 +73,7 @@ | ||
or os.environ.get("AZURE_CREDENTIAL") | ||
or infer_credential_type_from_environment() | ||
) | ||
verbose_logger.info( | ||
f"For Azure AD Token Provider, choosing credential type: {cred}" | ||
) | ||
# Do not log credential type to avoid disclosing sensitive information. | ||
credential: Optional[ | ||
Union[ | ||
ClientSecretCredential, |
Title
Relevant issues
Pre-Submission checklist
Please complete all items before asking a LiteLLM maintainer to review your PR
tests/litellm/
directory, Adding at least 1 test is a hard requirement - see detailsmake test-unit
Type
🆕 New Feature
🐛 Bug Fix
🧹 Refactoring
📖 Documentation
🚄 Infrastructure
✅ Test
Changes