Skip to content

Commit 7dfc3d6

Browse files
added more keywords in the regex prefix
1 parent 5ba3645 commit 7dfc3d6

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkg/detectors/twilio/twilio.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ var _ detectors.Detector = (*Scanner)(nil)
2424

2525
var (
2626
defaultClient = common.SaneHttpClient()
27-
sidPat = regexp.MustCompile(detectors.PrefixRegex([]string{"twilio", "account", "sid"}) + `\b(AC[0-9a-f]{32})\b`)
28-
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"twilio", "auth", "token", "key"}) + `\b([0-9a-f]{32})\b`)
27+
sidPat = regexp.MustCompile(detectors.PrefixRegex([]string{"twilio", "account", "id", "sid"}) + `\b(AC[0-9a-f]{32})\b`)
28+
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"twilio", "auth", "token", "secret", "key"}) + `\b([0-9a-f]{32})\b`)
2929
)
3030

3131
type serviceResponse struct {

pkg/detectors/twilioapikey/twilioapikey.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
6060
for _, apiKey := range apiKeyMatches {
6161
for _, secret := range secretMatches {
6262
s1 := detectors.Result{
63+
// TODO: We need to use the correct DetectorType here; detectorspb.DetectorType_TwilioApiKey
6364
DetectorType: detectorspb.DetectorType_Twilio,
6465
Raw: []byte(apiKey),
6566
RawV2: []byte(apiKey + secret),

0 commit comments

Comments
 (0)