Skip to content

Commit 457b129

Browse files
authored
fix(azure_storage): use DefaultMultiPartCredentialProvider (#3639)
1 parent 9d99de8 commit 457b129

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/detectors/azure_storage/storage.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
type Scanner struct {
2222
client *http.Client
23-
detectors.MultiPartCredentialProvider
23+
detectors.DefaultMultiPartCredentialProvider
2424
}
2525

2626
var _ detectors.Detector = (*Scanner)(nil)
@@ -29,13 +29,13 @@ var (
2929
defaultClient = detectors.DetectorHttpClientWithNoLocalAddresses
3030

3131
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.
32+
keyPat = regexp.MustCompile(`(?i:(?:Access|Account|Storage)[_.-]?Key)(?:.|\s){0,25}?([a-zA-Z0-9+\/-]{86,88}={0,2})`)
33+
3234
// https://learn.microsoft.com/en-us/azure/storage/common/storage-use-emulator
3335
testNames = map[string]struct{}{
3436
"devstoreaccount1": {},
3537
"storagesample": {},
3638
}
37-
38-
keyPat = regexp.MustCompile(`(?i:(?:Access|Account|Storage)[_.-]?Key)(?:.|\s){0,25}?([a-zA-Z0-9+\/-]{86,88}={0,2})`)
3939
testKeys = map[string]struct{}{
4040
"Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==": {},
4141
}

0 commit comments

Comments
 (0)