Skip to content

Find, verify, and analyze leaked credentials

[Thog-628] update detector results hash v2 (#710)

ahrav2cab951ee559
diff --git a/pkg/detectors/adobeio/adobeio.go b/pkg/detectors/adobeio/adobeio.go
index b8ee57c70..af079da9e 100644
--- a/pkg/detectors/adobeio/adobeio.go
+++ b/pkg/detectors/adobeio/adobeio.go
@@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_AdobeIO,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/adzuna/adzuna.go b/pkg/detectors/adzuna/adzuna.go
index 821a871ca..32f8aca71 100644
--- a/pkg/detectors/adzuna/adzuna.go
+++ b/pkg/detectors/adzuna/adzuna.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Adzuna,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/aeroworkflow/aeroworkflow.go b/pkg/detectors/aeroworkflow/aeroworkflow.go
index d74677fbb..31088f06c 100644
--- a/pkg/detectors/aeroworkflow/aeroworkflow.go
+++ b/pkg/detectors/aeroworkflow/aeroworkflow.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Aeroworkflow,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/agora/agora.go b/pkg/detectors/agora/agora.go
index 32095a65e..8fe1f537e 100644
--- a/pkg/detectors/agora/agora.go
+++ b/pkg/detectors/agora/agora.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Agora,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecret),
}
if verify {
diff --git a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go
index c9487469a..a09cfaf68 100644
--- a/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go
+++ b/pkg/detectors/airbrakeprojectkey/airbrakeprojectkey.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_AirbrakeProjectKey,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/airtableapikey/airtableapikey.go b/pkg/detectors/airtableapikey/airtableapikey.go
index 71e350791..814741d98 100644
--- a/pkg/detectors/airtableapikey/airtableapikey.go
+++ b/pkg/detectors/airtableapikey/airtableapikey.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
DetectorType: detectorspb.DetectorType_AirtableApiKey,
Redacted: appRes,
Raw: []byte(keyRes),
+ RawV2: []byte(keyRes + appRes),
}
if verify {
diff --git a/pkg/detectors/alegra/alegra.go b/pkg/detectors/alegra/alegra.go
index 24f012dba..a4df18fda 100644
--- a/pkg/detectors/alegra/alegra.go
+++ b/pkg/detectors/alegra/alegra.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Alegra,
Raw: []byte(tokenPatMatch),
+ RawV2: []byte(tokenPatMatch + userPatMatch),
}
if verify {
diff --git a/pkg/detectors/algoliaadminkey/algoliaadminkey.go b/pkg/detectors/algoliaadminkey/algoliaadminkey.go
index 05250f7d7..7c5ac6023 100644
--- a/pkg/detectors/algoliaadminkey/algoliaadminkey.go
+++ b/pkg/detectors/algoliaadminkey/algoliaadminkey.go
@@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_AlgoliaAdminKey,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/alibaba/alibaba.go b/pkg/detectors/alibaba/alibaba.go
index 6b77617dd..63df50bba 100644
--- a/pkg/detectors/alibaba/alibaba.go
+++ b/pkg/detectors/alibaba/alibaba.go
@@ -84,6 +84,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Alibaba,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
@@ -103,7 +104,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
params.Add("Version", "2014-05-26")
stringToSign := buildStringToSign(req.Method, params.Encode())
- signature := GetSignature(stringToSign, resMatch+"&") //Get Signature HMAC SHA1
+ signature := GetSignature(stringToSign, resMatch+"&") // Get Signature HMAC SHA1
params.Add("Signature", signature)
req.URL.RawQuery = params.Encode()
diff --git a/pkg/detectors/amadeus/amadeus.go b/pkg/detectors/amadeus/amadeus.go
index b90e32b7f..cef1d86c4 100644
--- a/pkg/detectors/amadeus/amadeus.go
+++ b/pkg/detectors/amadeus/amadeus.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Amadeus,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecret),
}
if verify {
diff --git a/pkg/detectors/amplitudeapikey/amplitudeapikey.go b/pkg/detectors/amplitudeapikey/amplitudeapikey.go
index 7b3c5b2eb..7d30b00f7 100644
--- a/pkg/detectors/amplitudeapikey/amplitudeapikey.go
+++ b/pkg/detectors/amplitudeapikey/amplitudeapikey.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_AmplitudeApiKey,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecretMatch),
}
if verify {
diff --git a/pkg/detectors/anypoint/anypoint.go b/pkg/detectors/anypoint/anypoint.go
index fd6c9f63e..a669b59ff 100644
--- a/pkg/detectors/anypoint/anypoint.go
+++ b/pkg/detectors/anypoint/anypoint.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Anypoint,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + orgRes),
}
if verify {
diff --git a/pkg/detectors/apideck/apideck.go b/pkg/detectors/apideck/apideck.go
index c7ea1c1f8..917de9c87 100644
--- a/pkg/detectors/apideck/apideck.go
+++ b/pkg/detectors/apideck/apideck.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_ApiDeck,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/apiflash/apiflash.go b/pkg/detectors/apiflash/apiflash.go
index 35cf7245e..bb8e4653a 100644
--- a/pkg/detectors/apiflash/apiflash.go
+++ b/pkg/detectors/apiflash/apiflash.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Apiflash,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resUrlMatch),
}
if verify {
diff --git a/pkg/detectors/apimatic/apimatic.go b/pkg/detectors/apimatic/apimatic.go
index 83fc4ec8c..2030ed5cd 100644
--- a/pkg/detectors/apimatic/apimatic.go
+++ b/pkg/detectors/apimatic/apimatic.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_APIMatic,
Raw: []byte(userPatMatch),
+ RawV2: []byte(userPatMatch + passPatMatch),
}
if verify {
timeout := 10 * time.Second
diff --git a/pkg/detectors/appcues/appcues.go b/pkg/detectors/appcues/appcues.go
index 1bee72394..b5f76a5a5 100644
--- a/pkg/detectors/appcues/appcues.go
+++ b/pkg/detectors/appcues/appcues.go
@@ -63,6 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Appcues,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resUserMatch),
}
if verify {
req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.appcues.com/v2/accounts/%s/flows", resIdMatch), nil)
diff --git a/pkg/detectors/apptivo/apptivo.go b/pkg/detectors/apptivo/apptivo.go
index 2d6d5aa0a..6a7d65403 100644
--- a/pkg/detectors/apptivo/apptivo.go
+++ b/pkg/detectors/apptivo/apptivo.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Apptivo,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/artifactory/artifactory.go b/pkg/detectors/artifactory/artifactory.go
index ebee1d598..1fe3dc431 100644
--- a/pkg/detectors/artifactory/artifactory.go
+++ b/pkg/detectors/artifactory/artifactory.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_ArtifactoryAccessToken,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resURLMatch),
}
if verify {
diff --git a/pkg/detectors/artsy/artsy.go b/pkg/detectors/artsy/artsy.go
index 548cc7a88..e1249ead1 100644
--- a/pkg/detectors/artsy/artsy.go
+++ b/pkg/detectors/artsy/artsy.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Artsy,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go b/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go
index 20556f15e..6abfccbf8 100644
--- a/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go
+++ b/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go
@@ -58,6 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
DetectorType: detectorspb.DetectorType_Auth0ManagementApiToken,
Redacted: domainRes,
Raw: []byte(managementApiTokenRes),
+ RawV2: []byte(managementApiTokenRes + domainRes),
}
if verify {
diff --git a/pkg/detectors/auth0oauth/auth0oauth.go b/pkg/detectors/auth0oauth/auth0oauth.go
index 32c6616ee..47a89661a 100644
--- a/pkg/detectors/auth0oauth/auth0oauth.go
+++ b/pkg/detectors/auth0oauth/auth0oauth.go
@@ -2,14 +2,11 @@ package auth0oauth
import (
"context"
- // "fmt"
- // "log"
- "regexp"
- "strings"
-
"io/ioutil"
"net/http"
"net/url"
+ "regexp"
+ "strings"
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
@@ -65,6 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
DetectorType: detectorspb.DetectorType_Auth0oauth,
Redacted: clientIdRes,
Raw: []byte(clientSecretRes),
+ RawV2: []byte(clientIdRes + clientSecretRes),
}
if verify {
diff --git a/pkg/detectors/autodesk/autodesk.go b/pkg/detectors/autodesk/autodesk.go
index f70016331..40d7203d9 100644
--- a/pkg/detectors/autodesk/autodesk.go
+++ b/pkg/detectors/autodesk/autodesk.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Autodesk,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecret),
}
if verify {
diff --git a/pkg/detectors/aws/aws.go b/pkg/detectors/aws/aws.go
index 08070640c..b74cc6869 100644
--- a/pkg/detectors/aws/aws.go
+++ b/pkg/detectors/aws/aws.go
@@ -81,6 +81,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
DetectorType: detectorspb.DetectorType_AWS,
Raw: []byte(resIDMatch),
Redacted: resIDMatch,
+ RawV2: []byte(resIDMatch + resSecretMatch),
}
if verify {
diff --git a/pkg/detectors/aylien/aylien.go b/pkg/detectors/aylien/aylien.go
index 2ae1e9eb9..f8a28b30b 100644
--- a/pkg/detectors/aylien/aylien.go
+++ b/pkg/detectors/aylien/aylien.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Aylien,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
req, err := http.NewRequestWithContext(ctx, "GET", "https://api.aylien.com/news/stories", nil)
diff --git a/pkg/detectors/billomat/billomat.go b/pkg/detectors/billomat/billomat.go
index fd14f4d70..4c40b0598 100644
--- a/pkg/detectors/billomat/billomat.go
+++ b/pkg/detectors/billomat/billomat.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Billomat,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resId),
}
if verify {
diff --git a/pkg/detectors/bitmex/bitmex.go b/pkg/detectors/bitmex/bitmex.go
index a7ef5aeb1..94ccaf579 100644
--- a/pkg/detectors/bitmex/bitmex.go
+++ b/pkg/detectors/bitmex/bitmex.go
@@ -58,6 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Bitmex,
Raw: []byte(resSecretMatch),
+ RawV2: []byte(resMatch + resSecretMatch),
}
if verify {
diff --git a/pkg/detectors/browserstack/browserstack.go b/pkg/detectors/browserstack/browserstack.go
index 07728afb4..61e5b23ea 100644
--- a/pkg/detectors/browserstack/browserstack.go
+++ b/pkg/detectors/browserstack/browserstack.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_BrowserStack,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resUserMatch),
}
if verify {
diff --git a/pkg/detectors/bulksms/bulksms.go b/pkg/detectors/bulksms/bulksms.go
index 784a12087..203e18ee7 100644
--- a/pkg/detectors/bulksms/bulksms.go
+++ b/pkg/detectors/bulksms/bulksms.go
@@ -2,11 +2,11 @@ package bulksms
import (
"context"
+ b64 "encoding/base64"
"fmt"
"net/http"
"regexp"
"strings"
- b64 "encoding/base64"
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
@@ -21,10 +21,9 @@ var _ detectors.Detector = (*Scanner)(nil)
var (
client = common.SaneHttpClient()
- //Make sure that your group is surrounded in boundry characters such as below to reduce false positives
+ // Make sure that your group is surrounded in boundry characters such as below to reduce false positives
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"bulksms"}) + `\b([a-fA-Z0-9*]{29})\b`)
- idPat = regexp.MustCompile(detectors.PrefixRegex([]string{"bulksms"}) + `\b([A-F0-9-]{37})\b`)
-
+ idPat = regexp.MustCompile(detectors.PrefixRegex([]string{"bulksms"}) + `\b([A-F0-9-]{37})\b`)
)
// Keywords are used for efficiently pre-filtering chunks.
@@ -54,10 +53,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Bulksms,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
-
+
if verify {
- data := fmt.Sprintf("%s:%s", resIdMatch,resMatch)
+ data := fmt.Sprintf("%s:%s", resIdMatch, resMatch)
sEnc := b64.StdEncoding.EncodeToString([]byte(data))
req, err := http.NewRequestWithContext(ctx, "GET", "https://api.bulksms.com/v1/messages", nil)
if err != nil {
@@ -70,17 +70,17 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
if res.StatusCode >= 200 && res.StatusCode < 300 {
s1.Verified = true
} else {
- //This function will check false positives for common test words, but also it will make sure the key appears 'random' enough to be a real key
+ // This function will check false positives for common test words, but also it will make sure the key appears 'random' enough to be a real key
if detectors.IsKnownFalsePositive(resMatch, detectors.DefaultFalsePositives, true) {
continue
}
}
}
}
-
+
results = append(results, s1)
}
-
+
}
return detectors.CleanResults(results), nil
diff --git a/pkg/detectors/captaindata/captaindata.go b/pkg/detectors/captaindata/captaindata.go
index edbddcbbb..8d77f1dfc 100644
--- a/pkg/detectors/captaindata/captaindata.go
+++ b/pkg/detectors/captaindata/captaindata.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_CaptainData,
Raw: []byte(resMatch),
+ RawV2: []byte(resProjIdMatch + resMatch),
}
if verify {
diff --git a/pkg/detectors/cashboard/cashboard.go b/pkg/detectors/cashboard/cashboard.go
index 793c72a10..8c4f8d90b 100644
--- a/pkg/detectors/cashboard/cashboard.go
+++ b/pkg/detectors/cashboard/cashboard.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Cashboard,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resUser),
}
if verify {
diff --git a/pkg/detectors/caspio/caspio.go b/pkg/detectors/caspio/caspio.go
index 9c2461988..9c97af741 100644
--- a/pkg/detectors/caspio/caspio.go
+++ b/pkg/detectors/caspio/caspio.go
@@ -63,6 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Caspio,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch + resDomainMatch),
}
if verify {
diff --git a/pkg/detectors/censys/censys.go b/pkg/detectors/censys/censys.go
index 3c6e06f56..5a816d9f0 100644
--- a/pkg/detectors/censys/censys.go
+++ b/pkg/detectors/censys/censys.go
@@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Censys,
Raw: []byte(tokenPatMatch),
+ RawV2: []byte(tokenPatMatch + userPatMatch),
}
if verify {
diff --git a/pkg/detectors/cexio/cexio.go b/pkg/detectors/cexio/cexio.go
index bb206e620..8d1119bd2 100644
--- a/pkg/detectors/cexio/cexio.go
+++ b/pkg/detectors/cexio/cexio.go
@@ -69,6 +69,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_CexIO,
Raw: []byte(resKeyMatch),
+ RawV2: []byte(resUserIdMatch + resSecretMatch),
}
if verify {
diff --git a/pkg/detectors/checkout/checkout.go b/pkg/detectors/checkout/checkout.go
index 28040131d..6d12f1fa2 100644
--- a/pkg/detectors/checkout/checkout.go
+++ b/pkg/detectors/checkout/checkout.go
@@ -20,7 +20,7 @@ var (
client = common.SaneHttpClient()
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
- //Tokens starting with sk_test are used for the app's sandbox environment while tokens starting with sk only are for production environment
+ // Tokens starting with sk_test are used for the app's sandbox environment while tokens starting with sk only are for production environment
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"checkout"}) + `\b((sk_|sk_test_)[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})\b`)
idPat = regexp.MustCompile(detectors.PrefixRegex([]string{"checkout"}) + `\b(cus_[0-9a-zA-Z]{26})\b`)
)
@@ -53,10 +53,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Checkout,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
- //Used the app's sandbox environment for this case since I can't create a live account.
+ // Used the app's sandbox environment for this case since I can't create a live account.
req, err := http.NewRequestWithContext(ctx, "GET", "https://api.sandbox.checkout.com/customers/"+resIdMatch, nil)
if err != nil {
continue
diff --git a/pkg/detectors/checkvist/checkvist.go b/pkg/detectors/checkvist/checkvist.go
index ccdb7d53f..f50ae66c2 100644
--- a/pkg/detectors/checkvist/checkvist.go
+++ b/pkg/detectors/checkvist/checkvist.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Checkvist,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resEmailMatch),
}
if verify {
diff --git a/pkg/detectors/clickhelp/clickhelp.go b/pkg/detectors/clickhelp/clickhelp.go
index 8afb6f059..d9ebaa1f5 100644
--- a/pkg/detectors/clickhelp/clickhelp.go
+++ b/pkg/detectors/clickhelp/clickhelp.go
@@ -61,6 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_ClickHelp,
Raw: []byte(resServer),
+ RawV2: []byte(resServer + resEmail),
}
if verify {
diff --git a/pkg/detectors/clicksendsms/clicksendsms.go b/pkg/detectors/clicksendsms/clicksendsms.go
index 4447bf3f7..4bd5f5973 100644
--- a/pkg/detectors/clicksendsms/clicksendsms.go
+++ b/pkg/detectors/clicksendsms/clicksendsms.go
@@ -50,6 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_ClickSendsms,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/clockworksms/clockworksms.go b/pkg/detectors/clockworksms/clockworksms.go
index 35fa521b0..84763da53 100644
--- a/pkg/detectors/clockworksms/clockworksms.go
+++ b/pkg/detectors/clockworksms/clockworksms.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_ClockworkSMS,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + tokenRes),
}
if verify {
diff --git a/pkg/detectors/cloudelements/cloudelements.go b/pkg/detectors/cloudelements/cloudelements.go
index 5adc5c090..dcd066cb7 100644
--- a/pkg/detectors/cloudelements/cloudelements.go
+++ b/pkg/detectors/cloudelements/cloudelements.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_CloudElements,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resOrgMatch),
}
if verify {
diff --git a/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go b/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go
index b0320924c..23fbb1e50 100644
--- a/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go
+++ b/pkg/detectors/cloudflareglobalapikey/cloudflareglobalapikey.go
@@ -60,6 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
DetectorType: detectorspb.DetectorType_CloudflareGlobalApiKey,
Redacted: emailRes,
Raw: []byte(apiKeyRes),
+ RawV2: []byte(apiKeyRes + emailRes),
}
if verify {
diff --git a/pkg/detectors/companyhub/companyhub.go b/pkg/detectors/companyhub/companyhub.go
index be57f408b..2fa8e3f99 100644
--- a/pkg/detectors/companyhub/companyhub.go
+++ b/pkg/detectors/companyhub/companyhub.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_CompanyHub,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/confluent/confluent.go b/pkg/detectors/confluent/confluent.go
index 366551051..c21edd7dc 100644
--- a/pkg/detectors/confluent/confluent.go
+++ b/pkg/detectors/confluent/confluent.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Confluent,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecret),
}
if verify {
diff --git a/pkg/detectors/copper/copper.go b/pkg/detectors/copper/copper.go
index 0a6ed6283..054a42b75 100644
--- a/pkg/detectors/copper/copper.go
+++ b/pkg/detectors/copper/copper.go
@@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Copper,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/crossbrowsertesting/crossbrowsertesting.go b/pkg/detectors/crossbrowsertesting/crossbrowsertesting.go
index 09fb1c429..c6b12f40f 100644
--- a/pkg/detectors/crossbrowsertesting/crossbrowsertesting.go
+++ b/pkg/detectors/crossbrowsertesting/crossbrowsertesting.go
@@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_CrossBrowserTesting,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/customerguru/customerguru.go b/pkg/detectors/customerguru/customerguru.go
index ee71140fc..51c3e6a75 100644
--- a/pkg/detectors/customerguru/customerguru.go
+++ b/pkg/detectors/customerguru/customerguru.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_CustomerGuru,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/customerio/customerio.go b/pkg/detectors/customerio/customerio.go
index 6d58e1db9..3dfd173f2 100644
--- a/pkg/detectors/customerio/customerio.go
+++ b/pkg/detectors/customerio/customerio.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_CustomerIO,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/detectors.go b/pkg/detectors/detectors.go
index bfc722d08..66243cf37 100644
--- a/pkg/detectors/detectors.go
+++ b/pkg/detectors/detectors.go
@@ -29,6 +29,9 @@ type Result struct {
Verified bool
// Raw contains the raw secret identifier data. Prefer IDs over secrets since it is used for deduping after hashing.
Raw []byte
+ // RawV2 contains the raw secret identifier that is a combination of both the ID and the secret.
+ // This is used for secrets that are multi part and could have the same ID. Ex: AWS credentials
+ RawV2 []byte
// Redacted contains the redacted version of the raw secret identification data for display purposes.
// A secret ID should be used if available.
Redacted string
@@ -96,9 +99,9 @@ func PrefixRegex(keywords []string) string {
return pre + middle + post
}
-//KeyIsRandom is a Low cost check to make sure that 'keys' include a number to reduce FPs.
-//Golang doesnt support regex lookaheads, so must be done in separate calls.
-//TODO improve checks. Shannon entropy did not work well.
+// KeyIsRandom is a Low cost check to make sure that 'keys' include a number to reduce FPs.
+// Golang doesnt support regex lookaheads, so must be done in separate calls.
+// TODO improve checks. Shannon entropy did not work well.
func KeyIsRandom(key string) bool {
for _, ch := range key {
if unicode.IsDigit(ch) {
diff --git a/pkg/detectors/discordbottoken/discordbottoken.go b/pkg/detectors/discordbottoken/discordbottoken.go
index 170e741c2..b3d2390a4 100644
--- a/pkg/detectors/discordbottoken/discordbottoken.go
+++ b/pkg/detectors/discordbottoken/discordbottoken.go
@@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
DetectorType: detectorspb.DetectorType_DiscordBotToken,
Redacted: resId,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resId),
}
if verify {
diff --git a/pkg/detectors/dnscheck/dnscheck.go b/pkg/detectors/dnscheck/dnscheck.go
index f55b9b8e1..dbbd9f3d3 100644
--- a/pkg/detectors/dnscheck/dnscheck.go
+++ b/pkg/detectors/dnscheck/dnscheck.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Dnscheck,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/dwolla/dwolla.go b/pkg/detectors/dwolla/dwolla.go
index 3f6aa16db..81059b372 100644
--- a/pkg/detectors/dwolla/dwolla.go
+++ b/pkg/detectors/dwolla/dwolla.go
@@ -56,6 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Dwolla,
Raw: []byte(idMatch),
+ RawV2: []byte(idMatch + secretMatch),
}
if verify {
diff --git a/pkg/detectors/easyinsight/easyinsight.go b/pkg/detectors/easyinsight/easyinsight.go
index 4777aa495..f60b02718 100644
--- a/pkg/detectors/easyinsight/easyinsight.go
+++ b/pkg/detectors/easyinsight/easyinsight.go
@@ -2,13 +2,12 @@ package easyinsight
import (
"context"
+ b64 "encoding/base64"
"fmt"
+ "net/http"
"regexp"
"strings"
- b64 "encoding/base64"
- "net/http"
-
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -55,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_EasyInsight,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/edamam/edamam.go b/pkg/detectors/edamam/edamam.go
index d9867cde7..f2ccc3d5b 100644
--- a/pkg/detectors/edamam/edamam.go
+++ b/pkg/detectors/edamam/edamam.go
@@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Edamam,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resId),
}
if verify {
diff --git a/pkg/detectors/eightxeight/eightxeight.go b/pkg/detectors/eightxeight/eightxeight.go
index 99daa1682..ffbd6fa16 100644
--- a/pkg/detectors/eightxeight/eightxeight.go
+++ b/pkg/detectors/eightxeight/eightxeight.go
@@ -55,6 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_EightxEight,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resIdMatch),
}
if verify {
diff --git a/pkg/detectors/facebookoauth/facebookoauth.go b/pkg/detectors/facebookoauth/facebookoauth.go
index 57b805fc0..c79741648 100644
--- a/pkg/detectors/facebookoauth/facebookoauth.go
+++ b/pkg/detectors/facebookoauth/facebookoauth.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
DetectorType: detectorspb.DetectorType_FacebookOAuth,
Redacted: apiIdRes,
Raw: []byte(apiSecretRes),
+ RawV2: []byte(apiIdRes + apiSecretRes),
}
if verify {
diff --git a/pkg/detectors/faceplusplus/faceplusplus.go b/pkg/detectors/faceplusplus/faceplusplus.go
index 8a649ae8f..025865674 100644
--- a/pkg/detectors/faceplusplus/faceplusplus.go
+++ b/pkg/detectors/faceplusplus/faceplusplus.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_FacePlusPlus,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecret),
}
if verify {
diff --git a/pkg/detectors/foursquare/foursquare.go b/pkg/detectors/foursquare/foursquare.go
index afb957221..a1a9ab599 100644
--- a/pkg/detectors/foursquare/foursquare.go
+++ b/pkg/detectors/foursquare/foursquare.go
@@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_FourSquare,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecret),
}
if verify {
diff --git a/pkg/detectors/gengo/gengo.go b/pkg/detectors/gengo/gengo.go
index 7c9761523..bd920e089 100644
--- a/pkg/detectors/gengo/gengo.go
+++ b/pkg/detectors/gengo/gengo.go
@@ -61,6 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Gengo,
Raw: []byte(resSecretMatch),
+ RawV2: []byte(resMatch + resSecretMatch),
}
if verify {
diff --git a/pkg/detectors/geocodio/geocodio.go b/pkg/detectors/geocodio/geocodio.go
index 14d3e02bb..c4f071ae3 100644
--- a/pkg/detectors/geocodio/geocodio.go
+++ b/pkg/detectors/geocodio/geocodio.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Geocodio,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSearchMatch),
}
if verify {
diff --git a/pkg/detectors/kraken/kraken.go b/pkg/detectors/kraken/kraken.go
index 8b625f4c8..cf94d7148 100644
--- a/pkg/detectors/kraken/kraken.go
+++ b/pkg/detectors/kraken/kraken.go
@@ -2,6 +2,10 @@ package kraken
import (
"context"
+ "crypto/hmac"
+ "crypto/sha256"
+ "crypto/sha512"
+ "encoding/base64"
"io"
"net/http"
"net/url"
@@ -10,11 +14,6 @@ import (
"strings"
"time"
- "crypto/hmac"
- "crypto/sha256"
- "crypto/sha512"
- "encoding/base64"
-
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
@@ -29,7 +28,7 @@ var (
client = common.SaneHttpClient()
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.
- //Bounds have been removed because there are some cases that tokens have trailing frontslash(/) or plus sign (+)
+ // Bounds have been removed because there are some cases that tokens have trailing frontslash(/) or plus sign (+)
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"kraken"}) + `\b([0-9A-Za-z\/\+=]{56}[ "'\r\n]{1})`)
privKeyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"kraken"}) + `\b([0-9A-Za-z\/\+=]{86,88}[ "'\r\n]{1})`)
)
@@ -62,11 +61,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Kraken,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resPrivKeyMatch),
}
if verify {
- //Increasing 64-bit integer, for each request that is made with a particular API key.
+ // Increasing 64-bit integer, for each request that is made with a particular API key.
apiNonce := strconv.FormatInt(time.Now().Unix(), 10)
payload := url.Values{}
@@ -106,7 +106,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
return detectors.CleanResults(results), nil
}
-//Code from https://docs.kraken.com/rest/#section/Authentication/Headers-and-Signature
+// Code from https://docs.kraken.com/rest/#section/Authentication/Headers-and-Signature
func getKrakenSignature(url_path string, values url.Values, secret []byte) string {
sha := sha256.New()
diff --git a/pkg/detectors/kucoin/kucoin.go b/pkg/detectors/kucoin/kucoin.go
index 79574a486..b1cbc4ded 100644
--- a/pkg/detectors/kucoin/kucoin.go
+++ b/pkg/detectors/kucoin/kucoin.go
@@ -65,6 +65,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_KuCoin,
Raw: []byte(resKeyMatch),
+ RawV2: []byte(resKeyMatch + resPassphraseMatch),
}
if verify {
diff --git a/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go b/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go
index 1e6d05a77..2b0241557 100644
--- a/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go
+++ b/pkg/detectors/mattermostpersonaltoken/mattermostpersonaltoken.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_MattermostPersonalToken,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + serverRes),
}
if verify {
diff --git a/pkg/detectors/mux/mux.go b/pkg/detectors/mux/mux.go
index 0e7fadb80..4648296b0 100644
--- a/pkg/detectors/mux/mux.go
+++ b/pkg/detectors/mux/mux.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Mux,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecretMatch),
}
if verify {
diff --git a/pkg/detectors/nexmoapikey/nexmoapikey.go b/pkg/detectors/nexmoapikey/nexmoapikey.go
index 573612cf9..8460c891f 100644
--- a/pkg/detectors/nexmoapikey/nexmoapikey.go
+++ b/pkg/detectors/nexmoapikey/nexmoapikey.go
@@ -51,6 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_NexmoApiKey,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecret),
}
if verify {
diff --git a/pkg/detectors/plivo/plivo.go b/pkg/detectors/plivo/plivo.go
index f94aae117..29125f8fe 100644
--- a/pkg/detectors/plivo/plivo.go
+++ b/pkg/detectors/plivo/plivo.go
@@ -52,6 +52,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
DetectorType: detectorspb.DetectorType_Plivo,
Redacted: id,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + id),
}
stringResMatch := fmt.Sprintf("%s:%s", id, resMatch)
decodeSecret := b64.StdEncoding.EncodeToString([]byte(stringResMatch))
diff --git a/pkg/detectors/poloniex/poloniex.go b/pkg/detectors/poloniex/poloniex.go
index effd3a579..3470a499a 100644
--- a/pkg/detectors/poloniex/poloniex.go
+++ b/pkg/detectors/poloniex/poloniex.go
@@ -58,6 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Poloniex,
Raw: []byte(resSecretMatch),
+ RawV2: []byte(resMatch + resSecretMatch),
}
if verify {
diff --git a/pkg/detectors/pusherchannelkey/pusherchannelkey.go b/pkg/detectors/pusherchannelkey/pusherchannelkey.go
index 88dc74124..3fb4f9bbf 100644
--- a/pkg/detectors/pusherchannelkey/pusherchannelkey.go
+++ b/pkg/detectors/pusherchannelkey/pusherchannelkey.go
@@ -72,6 +72,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_PusherChannelKey,
Raw: []byte(resappMatch),
+ RawV2: []byte(resappMatch + reskeyMatch),
}
if verify {
diff --git a/pkg/detectors/roaring/roaring.go b/pkg/detectors/roaring/roaring.go
index aeb28a72f..c92317687 100644
--- a/pkg/detectors/roaring/roaring.go
+++ b/pkg/detectors/roaring/roaring.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Roaring,
Raw: []byte(resClient),
+ RawV2: []byte(resClient + resSecret),
}
if verify {
diff --git a/pkg/detectors/rownd/rownd.go b/pkg/detectors/rownd/rownd.go
index 5abc27600..2a03c9a98 100644
--- a/pkg/detectors/rownd/rownd.go
+++ b/pkg/detectors/rownd/rownd.go
@@ -61,6 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Rownd,
Raw: []byte(keyMatch),
+ RawV2: []byte(keyMatch + secretMatch),
}
if verify {
diff --git a/pkg/detectors/satismeterprojectkey/satismeterprojectkey.go b/pkg/detectors/satismeterprojectkey/satismeterprojectkey.go
index 95c39106a..3496bcfc3 100644
--- a/pkg/detectors/satismeterprojectkey/satismeterprojectkey.go
+++ b/pkg/detectors/satismeterprojectkey/satismeterprojectkey.go
@@ -62,6 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_SatismeterProjectkey,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resPassMatch),
}
if verify {
diff --git a/pkg/detectors/smooch/smooch.go b/pkg/detectors/smooch/smooch.go
index ee82042ba..5f2b5249e 100644
--- a/pkg/detectors/smooch/smooch.go
+++ b/pkg/detectors/smooch/smooch.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Smooch,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecret),
}
if verify {
diff --git a/pkg/detectors/strava/strava.go b/pkg/detectors/strava/strava.go
index 62a26159e..1de0356c9 100644
--- a/pkg/detectors/strava/strava.go
+++ b/pkg/detectors/strava/strava.go
@@ -60,6 +60,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Strava,
Raw: []byte(resId),
+ RawV2: []byte(resId + resSecret),
}
if verify {
diff --git a/pkg/detectors/textmagic/textmagic.go b/pkg/detectors/textmagic/textmagic.go
index c5aef540e..fc1839987 100644
--- a/pkg/detectors/textmagic/textmagic.go
+++ b/pkg/detectors/textmagic/textmagic.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Textmagic,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resUser),
}
if verify {
diff --git a/pkg/detectors/tru/tru.go b/pkg/detectors/tru/tru.go
index c09c7aebf..a08cd3599 100644
--- a/pkg/detectors/tru/tru.go
+++ b/pkg/detectors/tru/tru.go
@@ -53,6 +53,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Tru,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + resSecret),
}
if verify {
diff --git a/pkg/detectors/vouchery/vouchery.go b/pkg/detectors/vouchery/vouchery.go
index 828867390..5b977aee7 100644
--- a/pkg/detectors/vouchery/vouchery.go
+++ b/pkg/detectors/vouchery/vouchery.go
@@ -54,6 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detectorspb.DetectorType_Vouchery,
Raw: []byte(resMatch),
+ RawV2: []byte(resMatch + subMatch),
}
if verify {