Skip to content

Commit d2789d1

Browse files
authored
Add CodeQL suppression for DefaultAzureCredentialUse (#1917)
1 parent 6b9ddf4 commit d2789d1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/code/Utils.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ public static string GetAzAccessToken(PSCmdlet cmdletPassedIn)
662662
ExcludeInteractiveBrowserCredential = false
663663
};
664664

665+
// codeql[cs/security/identity/default-azure-credential-use] DefaultAzureCredential is not being used to create a credential in a production environment (i.e hosted server). It is created locally for a PSResourceGet command invocation, intended to be short-lived, and supports multiple authentication mechanisms which cannot be predicted and isolated for the invocation beforehand.
665666
var dCred = new DefaultAzureCredential(credOptions);
666667
var tokenRequestContext = new TokenRequestContext(new string[] { "https://management.azure.com/.default" });
667668

0 commit comments

Comments
 (0)