Skip to content

Commit 25270b1

Browse files
CodeQL Suppression for DefaultAzureCredential usage (#3233)
## Why make this change? - Closes on #3232 - This PR addresses a CodeQL false positive regarding - the usage of `DefaultAzureCredential()` - Reference documentation: - https://eng.ms/docs/cloud-ai-platform/devdiv/one-engineering-system-1es/1es-docs/codeql/codeql-semmle - [CodeQL suppression syntax](https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#suppressing-or-resolving-alerts) - [DefaultAzureCredential documentation](https://learn.microsoft.com/en-us/dotnet/api/azure.identity.defaultazurecredential) - https://liquid.microsoft.com/Web/Object/Read/Campaign.Requirements/Requirements/SSIRP.floss ## What is this change? - Suppresses the CodeQL warnings: - Adds a suppression rule to the relevant file - No logic or runtime code is changed; this is a configuration only update to streamline code analysis. ## How was this tested? - [x] Integration Tests - [x] Unit Tests The change will be validated by running the full test suite and triggering a CodeQL analysis to confirm the warning is suppressed and no new issues are introduced as part of a next build. ## Sample Request(s) - NA
1 parent 80a7f7d commit 25270b1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/Service/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ private static async Task<IConnectionMultiplexer> CreateConnectionMultiplexerAsy
521521

522522
if (ShouldUseEntraAuthForRedis(options))
523523
{
524-
options = await options.ConfigureForAzureWithTokenCredentialAsync(new DefaultAzureCredential());
524+
options = await options.ConfigureForAzureWithTokenCredentialAsync(new DefaultAzureCredential()); // CodeQL [SM05137] DefaultAzureCredential will use Managed Identity if available or fallback to default.
525525
}
526526

527527
return await ConnectionMultiplexer.ConnectAsync(options);

0 commit comments

Comments
 (0)