Skip to content

Commit

Permalink
fix(azure_storage): use DefaultMultiPartCredentialProvider (#3639)
Browse files Browse the repository at this point in the history
  • Loading branch information
rgmz authored Nov 20, 2024
1 parent 9d99de8 commit 457b129
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/detectors/azure_storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (

type Scanner struct {
client *http.Client
detectors.MultiPartCredentialProvider
detectors.DefaultMultiPartCredentialProvider
}

var _ detectors.Detector = (*Scanner)(nil)
Expand All @@ -29,13 +29,13 @@ var (
defaultClient = detectors.DetectorHttpClientWithNoLocalAddresses

namePat = regexp.MustCompile(`(?i:Account[_.-]?Name|Storage[_.-]?(?:Account|Name))(?:.|\s){0,20}?\b([a-z0-9]{3,24})\b|([a-z0-9]{3,24})(?i:\.blob\.core\.windows\.net)`) // Names can only be lowercase alphanumeric.
keyPat = regexp.MustCompile(`(?i:(?:Access|Account|Storage)[_.-]?Key)(?:.|\s){0,25}?([a-zA-Z0-9+\/-]{86,88}={0,2})`)

// https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator
testNames = map[string]struct{}{
"devstoreaccount1": {},
"storagesample": {},
}

keyPat = regexp.MustCompile(`(?i:(?:Access|Account|Storage)[_.-]?Key)(?:.|\s){0,25}?([a-zA-Z0-9+\/-]{86,88}={0,2})`)
testKeys = map[string]struct{}{
"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==": {},
}
Expand Down

0 comments on commit 457b129

Please sign in to comment.