Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
[chore] - ioutil.ReadFile is deprecated (#753)
ahrav37c4eea66a8f
diff --git a/hack/generate/generate.go b/hack/generate/generate.goindex 7fd8a8994..47ccc50b0 100644--- a/hack/generate/generate.go+++ b/hack/generate/generate.go@@ -2,7 +2,6 @@ package mainimport ("fmt"- "io/ioutil""log""os""path/filepath"@@ -77,7 +76,7 @@ func mustWriteTemplates(jobs []templateJob) {// Write the files from templates.for _, job := range jobs {- tmplBytes, err := ioutil.ReadFile(job.TemplatePath)+ tmplBytes, err := os.ReadFile(job.TemplatePath)if err != nil {log.Fatal(err)}diff --git a/pkg/detectors/abuseipdb/abuseipdb.go b/pkg/detectors/abuseipdb/abuseipdb.goindex fc538f7ec..f081bff72 100644--- a/pkg/detectors/abuseipdb/abuseipdb.go+++ b/pkg/detectors/abuseipdb/abuseipdb.go@@ -2,14 +2,12 @@ package abuseipdbimport ("context"- "io/ioutil"-+ "io"+ "net/http"// "log""regexp""strings"- "net/http"-"github.com/trufflesecurity/trufflehog/v3/pkg/common""github.com/trufflesecurity/trufflehog/v3/pkg/detectors""github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"@@ -58,11 +56,11 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("Key", resMatch)res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `ipAddress`)- //errCode := strings.Contains(bodyString, `AbuseIPDB APIv2 Server.`)+ // errCode := strings.Contains(bodyString, `AbuseIPDB APIv2 Server.`)defer res.Body.Close()if res.StatusCode >= 200 && res.StatusCode < 300 {diff --git a/pkg/detectors/allsports/allsports.go b/pkg/detectors/allsports/allsports.goindex 3b3ef2ce4..4dc997f16 100644--- a/pkg/detectors/allsports/allsports.go+++ b/pkg/detectors/allsports/allsports.go@@ -2,14 +2,12 @@ package allsportsimport ("context"- "io/ioutil"-+ "io"+ "net/http"// "log""regexp""strings"- "net/http"-"github.com/trufflesecurity/trufflehog/v3/pkg/common""github.com/trufflesecurity/trufflehog/v3/pkg/detectors""github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"@@ -58,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/amadeus/amadeus.go b/pkg/detectors/amadeus/amadeus.goindex cef1d86c4..ae788af97 100644--- a/pkg/detectors/amadeus/amadeus.go+++ b/pkg/detectors/amadeus/amadeus.go@@ -2,7 +2,7 @@ package amadeusimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/api2cart/api2cart.go b/pkg/detectors/api2cart/api2cart.goindex 9568dafb8..01204a7c1 100644--- a/pkg/detectors/api2cart/api2cart.go+++ b/pkg/detectors/api2cart/api2cart.go@@ -4,7 +4,7 @@ import ("context""encoding/json""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- body, errBody := ioutil.ReadAll(res.Body)+ body, errBody := io.ReadAll(res.Body)var result Responseif errBody == nil {diff --git a/pkg/detectors/appointedd/appointedd.go b/pkg/detectors/appointedd/appointedd.goindex c13c8cd45..0b6782341 100644--- a/pkg/detectors/appointedd/appointedd.go+++ b/pkg/detectors/appointedd/appointedd.go@@ -2,11 +2,11 @@ package appointeddimport ("context"+ "io""net/http""regexp""strings"- "io/ioutil"-+"github.com/trufflesecurity/trufflehog/v3/pkg/common""github.com/trufflesecurity/trufflehog/v3/pkg/detectors""github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"@@ -20,7 +20,7 @@ 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 positiveskeyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"appointedd"}) + `\b([a-zA-Z0-9=+]{88})`))@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/apptivo/apptivo.go b/pkg/detectors/apptivo/apptivo.goindex 6a7d65403..084329433 100644--- a/pkg/detectors/apptivo/apptivo.go+++ b/pkg/detectors/apptivo/apptivo.go@@ -3,7 +3,7 @@ package apptivoimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -63,7 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/audd/audd.go b/pkg/detectors/audd/audd.goindex 6fdde0714..9cb549e47 100644--- a/pkg/detectors/audd/audd.go+++ b/pkg/detectors/audd/audd.go@@ -3,7 +3,7 @@ package auddimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"status":"success"`)diff --git a/pkg/detectors/auth0oauth/auth0oauth.go b/pkg/detectors/auth0oauth/auth0oauth.goindex 47a89661a..56af8b690 100644--- a/pkg/detectors/auth0oauth/auth0oauth.go+++ b/pkg/detectors/auth0oauth/auth0oauth.go@@ -2,7 +2,7 @@ package auth0oauthimport ("context"- "io/ioutil"+ "io""net/http""net/url""regexp"@@ -88,7 +88,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/autoklose/autoklose.go b/pkg/detectors/autoklose/autoklose.goindex b96983eb4..311f3159f 100644--- a/pkg/detectors/autoklose/autoklose.go+++ b/pkg/detectors/autoklose/autoklose.go@@ -4,7 +4,7 @@ import ("context""encoding/json""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/baseapiio/baseapiio.go b/pkg/detectors/baseapiio/baseapiio.goindex ec571fad9..ed8a46070 100644--- a/pkg/detectors/baseapiio/baseapiio.go+++ b/pkg/detectors/baseapiio/baseapiio.go@@ -3,7 +3,7 @@ package baseapiioimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/besttime/besttime.go b/pkg/detectors/besttime/besttime.goindex 0869e1464..28b7f7e63 100644--- a/pkg/detectors/besttime/besttime.go+++ b/pkg/detectors/besttime/besttime.go@@ -2,7 +2,7 @@ package besttimeimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/borgbase/borgbase.go b/pkg/detectors/borgbase/borgbase.goindex afca05950..7e5374e98 100644--- a/pkg/detectors/borgbase/borgbase.go+++ b/pkg/detectors/borgbase/borgbase.go@@ -3,7 +3,7 @@ package borgbaseimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"sshList":[]`)diff --git a/pkg/detectors/braintreepayments/braintreepayments.go b/pkg/detectors/braintreepayments/braintreepayments.goindex d68bab96b..fd11698f9 100644--- a/pkg/detectors/braintreepayments/braintreepayments.go+++ b/pkg/detectors/braintreepayments/braintreepayments.go@@ -2,7 +2,7 @@ package braintreepaymentsimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -20,7 +20,7 @@ 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 positiveskeyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"braintree"}) + `\b([0-9a-f]{32})\b`)idPat = regexp.MustCompile(detectors.PrefixRegex([]string{"braintree"}) + `\b([0-9a-z]{16})\b`))@@ -67,7 +67,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.SetBasicAuth(resIdMatch, resMatch)res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}@@ -79,7 +79,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultif res.StatusCode >= 200 && res.StatusCode < 300 && validResponse {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 keyif detectors.IsKnownFalsePositive(resMatch, detectors.DefaultFalsePositives, true) {continue}diff --git a/pkg/detectors/bulbul/bulbul.go b/pkg/detectors/bulbul/bulbul.goindex c5d4e0d15..1207f3239 100644--- a/pkg/detectors/bulbul/bulbul.go+++ b/pkg/detectors/bulbul/bulbul.go@@ -3,7 +3,7 @@ package bulbulimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continuediff --git a/pkg/detectors/cexio/cexio.go b/pkg/detectors/cexio/cexio.goindex 8d1119bd2..7f72fbd4e 100644--- a/pkg/detectors/cexio/cexio.go+++ b/pkg/detectors/cexio/cexio.go@@ -7,7 +7,7 @@ import ("encoding/hex""encoding/json""fmt"- "io/ioutil"+ "io""net/http""net/url""regexp"@@ -92,7 +92,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultif err == nil {defer res.Body.Close()- body, err := ioutil.ReadAll(res.Body)+ body, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/coinlayer/coinlayer.go b/pkg/detectors/coinlayer/coinlayer.goindex 1d34da144..47623dd25 100644--- a/pkg/detectors/coinlayer/coinlayer.go+++ b/pkg/detectors/coinlayer/coinlayer.go@@ -3,7 +3,7 @@ package coinlayerimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"success": true`) || strings.Contains(bodyString, `"info":"Access Restricted - Your current Subscription Plan does not support HTTPS Encryption."`)diff --git a/pkg/detectors/commodities/commodities.go b/pkg/detectors/commodities/commodities.goindex e63fbd32c..6f4a8285f 100644--- a/pkg/detectors/commodities/commodities.go+++ b/pkg/detectors/commodities/commodities.go@@ -2,7 +2,7 @@ package commoditiesimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/convier/convier.go b/pkg/detectors/convier/convier.goindex e65f01902..c4ce78f8f 100644--- a/pkg/detectors/convier/convier.go+++ b/pkg/detectors/convier/convier.go@@ -3,7 +3,7 @@ package convierimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/cryptocompare/cryptocompare.go b/pkg/detectors/cryptocompare/cryptocompare.goindex 98367ff8b..65f952d0c 100644--- a/pkg/detectors/cryptocompare/cryptocompare.go+++ b/pkg/detectors/cryptocompare/cryptocompare.go@@ -2,7 +2,7 @@ package cryptocompareimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/currencycloud/currencycloud.go b/pkg/detectors/currencycloud/currencycloud.goindex a1a04481b..d13710559 100644--- a/pkg/detectors/currencycloud/currencycloud.go+++ b/pkg/detectors/currencycloud/currencycloud.go@@ -2,7 +2,7 @@ package currencycloudimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/currencylayer/currencylayer.go b/pkg/detectors/currencylayer/currencylayer.goindex dd753985f..eb339a913 100644--- a/pkg/detectors/currencylayer/currencylayer.go+++ b/pkg/detectors/currencylayer/currencylayer.go@@ -3,7 +3,7 @@ package currencylayerimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err2 := ioutil.ReadAll(res.Body)+ bodyBytes, err2 := io.ReadAll(res.Body)if err2 == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"success": true`) || strings.Contains(bodyString, `"info":"Access Restricted - Your current Subscription Plan does not support HTTPS Encryption."`)diff --git a/pkg/detectors/dareboost/dareboost.go b/pkg/detectors/dareboost/dareboost.goindex 3707eae2e..14162ba75 100644--- a/pkg/detectors/dareboost/dareboost.go+++ b/pkg/detectors/dareboost/dareboost.go@@ -2,7 +2,7 @@ package dareboostimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("Content-Type", "application/json")res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/diffbot/diffbot.go b/pkg/detectors/diffbot/diffbot.goindex 309b7ca38..1ae1e9d7d 100644--- a/pkg/detectors/diffbot/diffbot.go+++ b/pkg/detectors/diffbot/diffbot.go@@ -3,7 +3,7 @@ package diffbotimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"token":`) && strings.Contains(bodyString, `"planCredits":`)diff --git a/pkg/detectors/dynalist/dynalist.go b/pkg/detectors/dynalist/dynalist.goindex 75f17b448..b84c19b02 100644--- a/pkg/detectors/dynalist/dynalist.go+++ b/pkg/detectors/dynalist/dynalist.go@@ -3,7 +3,7 @@ package dynalistimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("Content-Type", "application/json")res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"_code":"Ok"`)diff --git a/pkg/detectors/dyspatch/dyspatch.go b/pkg/detectors/dyspatch/dyspatch.goindex 2392eb273..949e67653 100644--- a/pkg/detectors/dyspatch/dyspatch.go+++ b/pkg/detectors/dyspatch/dyspatch.go@@ -3,7 +3,7 @@ package dyspatchimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/fakejson/fakejson.go b/pkg/detectors/fakejson/fakejson.goindex 95c000836..74121ddb3 100644--- a/pkg/detectors/fakejson/fakejson.go+++ b/pkg/detectors/fakejson/fakejson.go@@ -3,7 +3,7 @@ package fakejsonimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("Content-Type", "application/json")res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"user_email":`)diff --git a/pkg/detectors/fetchrss/fetchrss.go b/pkg/detectors/fetchrss/fetchrss.goindex 7e98cb38e..d47d2f82b 100644--- a/pkg/detectors/fetchrss/fetchrss.go+++ b/pkg/detectors/fetchrss/fetchrss.go@@ -2,7 +2,7 @@ package fetchrssimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/fileio/fileio.go b/pkg/detectors/fileio/fileio.goindex b87b83d17..4ea1dc6ee 100644--- a/pkg/detectors/fileio/fileio.go+++ b/pkg/detectors/fileio/fileio.go@@ -4,7 +4,7 @@ import ("context""encoding/json""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {isJson := json.Valid(bodyBytes)defer res.Body.Close()diff --git a/pkg/detectors/financialmodelingprep/financialmodelingprep.go b/pkg/detectors/financialmodelingprep/financialmodelingprep.goindex 3e924a94c..bc9cd3abe 100644--- a/pkg/detectors/financialmodelingprep/financialmodelingprep.go+++ b/pkg/detectors/financialmodelingprep/financialmodelingprep.go@@ -3,7 +3,7 @@ package financialmodelingprepimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)bodyString := string(bodyBytes)if err == nil {// valid response should be an array of currenciesdiff --git a/pkg/detectors/fixerio/fixerio.go b/pkg/detectors/fixerio/fixerio.goindex 3f55305a7..3666fd9bd 100644--- a/pkg/detectors/fixerio/fixerio.go+++ b/pkg/detectors/fixerio/fixerio.go@@ -2,7 +2,7 @@ package fixerioimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/flickr/flickr.go b/pkg/detectors/flickr/flickr.goindex e0593adbf..106405c37 100644--- a/pkg/detectors/flickr/flickr.go+++ b/pkg/detectors/flickr/flickr.go@@ -3,7 +3,7 @@ package flickrimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/flightlabs/flightlabs.go b/pkg/detectors/flightlabs/flightlabs.goindex a7cf18929..f17f2daac 100644--- a/pkg/detectors/flightlabs/flightlabs.go+++ b/pkg/detectors/flightlabs/flightlabs.go@@ -3,7 +3,7 @@ package flightlabsimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -21,7 +21,7 @@ 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 positiveskeyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"flightlabs"}) + `\b(ey[a-zA-Z0-9]{34}.ey[a-zA-Z0-9._-]{300,350})\b`))@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultif res.StatusCode >= 200 && res.StatusCode < 300 && validResponse {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 keyif detectors.IsKnownFalsePositive(resMatch, detectors.DefaultFalsePositives, true) {continue}diff --git a/pkg/detectors/flightstats/flightstats.go b/pkg/detectors/flightstats/flightstats.goindex 5b0eded3b..303c8ad57 100644--- a/pkg/detectors/flightstats/flightstats.go+++ b/pkg/detectors/flightstats/flightstats.go@@ -3,7 +3,7 @@ package flightstatsimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -65,7 +65,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/flowflu/flowflu.go b/pkg/detectors/flowflu/flowflu.goindex ff8f0a5fe..960c9a414 100644--- a/pkg/detectors/flowflu/flowflu.go+++ b/pkg/detectors/flowflu/flowflu.go@@ -3,7 +3,7 @@ package flowfluimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -64,7 +64,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/formbucket/formbucket.go b/pkg/detectors/formbucket/formbucket.goindex cbdcbe207..cc3ef787e 100644--- a/pkg/detectors/formbucket/formbucket.go+++ b/pkg/detectors/formbucket/formbucket.go@@ -3,7 +3,7 @@ package formbucketimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- body, errBody := ioutil.ReadAll(res.Body)+ body, errBody := io.ReadAll(res.Body)if errBody != nil {continue}diff --git a/pkg/detectors/freshbooks/freshbooks.go b/pkg/detectors/freshbooks/freshbooks.goindex 39f3a6386..8fafe7407 100644--- a/pkg/detectors/freshbooks/freshbooks.go+++ b/pkg/detectors/freshbooks/freshbooks.go@@ -3,7 +3,7 @@ package freshbooksimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -63,7 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/gengo/gengo.go b/pkg/detectors/gengo/gengo.goindex bd920e089..129dd5cf6 100644--- a/pkg/detectors/gengo/gengo.go+++ b/pkg/detectors/gengo/gengo.go@@ -7,7 +7,7 @@ import ("encoding/hex""encoding/json""fmt"- "io/ioutil"+ "io""net/http""regexp""strconv"@@ -77,7 +77,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- body, errBody := ioutil.ReadAll(res.Body)+ body, errBody := io.ReadAll(res.Body)if errBody == nil {var response Responsediff --git a/pkg/detectors/geocode/geocode.go b/pkg/detectors/geocode/geocode.goindex e3dd8d182..b67590abf 100644--- a/pkg/detectors/geocode/geocode.go+++ b/pkg/detectors/geocode/geocode.go@@ -3,7 +3,7 @@ package geocodeimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"remaining_credits" :`)diff --git a/pkg/detectors/getemail/getemail.go b/pkg/detectors/getemail/getemail.goindex dbe3626a5..3ee4d624d 100644--- a/pkg/detectors/getemail/getemail.go+++ b/pkg/detectors/getemail/getemail.go@@ -3,7 +3,7 @@ package getemailimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/gocanvas/gocanvas.go b/pkg/detectors/gocanvas/gocanvas.goindex 2a6bba6d9..a24297457 100644--- a/pkg/detectors/gocanvas/gocanvas.go+++ b/pkg/detectors/gocanvas/gocanvas.go@@ -4,7 +4,7 @@ import ("context""encoding/xml""fmt"- "io/ioutil"+ "io""net/http""net/url""regexp"@@ -72,7 +72,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- body, errBody := ioutil.ReadAll(res.Body)+ body, errBody := io.ReadAll(res.Body)if errBody == nil {response := Response{}diff --git a/pkg/detectors/heatmapapi/heatmapapi.go b/pkg/detectors/heatmapapi/heatmapapi.goindex 7143c844c..bcd265957 100644--- a/pkg/detectors/heatmapapi/heatmapapi.go+++ b/pkg/detectors/heatmapapi/heatmapapi.go@@ -2,11 +2,12 @@ package heatmapapiimport ("context"+ "fmt"+ "io""net/http""regexp""strings"- "io/ioutil"- "fmt"+"github.com/trufflesecurity/trufflehog/v3/pkg/common""github.com/trufflesecurity/trufflehog/v3/pkg/detectors""github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"@@ -20,7 +21,7 @@ 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 positiveskeyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"heatmapapi"}) + `\b([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})\b`))@@ -48,14 +49,14 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}if verify {- req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://www.heatmapapi.com/javascript/HeatmapAPI2.aspx?k=%s",resMatch), nil)+ req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("http://www.heatmapapi.com/javascript/HeatmapAPI2.aspx?k=%s", resMatch), nil)if err != nil {continue}res, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/holistic/holistic.go b/pkg/detectors/holistic/holistic.goindex adce07d8b..7ec062461 100644--- a/pkg/detectors/holistic/holistic.go+++ b/pkg/detectors/holistic/holistic.go@@ -2,7 +2,7 @@ package holisticimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -20,7 +20,7 @@ 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 positiveskeyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"holistic"}) + `\b([0-9a-f]{64})\b`))@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("x-api-key", resMatch)res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}@@ -67,7 +67,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultif res.StatusCode >= 200 && res.StatusCode < 300 && !errorResponse {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 keyif detectors.IsKnownFalsePositive(resMatch, detectors.DefaultFalsePositives, true) {continue}diff --git a/pkg/detectors/humanity/humanity.go b/pkg/detectors/humanity/humanity.goindex ceeedb722..8465044bd 100644--- a/pkg/detectors/humanity/humanity.go+++ b/pkg/detectors/humanity/humanity.go@@ -2,7 +2,7 @@ package humanityimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/ipapi/ipapi.go b/pkg/detectors/ipapi/ipapi.goindex 5749b31e2..6d761bdae 100644--- a/pkg/detectors/ipapi/ipapi.go+++ b/pkg/detectors/ipapi/ipapi.go@@ -3,7 +3,7 @@ package ipapiimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)diff --git a/pkg/detectors/ipinfodb/ipinfodb.go b/pkg/detectors/ipinfodb/ipinfodb.goindex ab68a2130..07b6676be 100644--- a/pkg/detectors/ipinfodb/ipinfodb.go+++ b/pkg/detectors/ipinfodb/ipinfodb.go@@ -3,7 +3,7 @@ package ipinfodbimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"statusCode": "OK"`)diff --git a/pkg/detectors/ipquality/ipquality.go b/pkg/detectors/ipquality/ipquality.goindex 6535c604f..53273a474 100644--- a/pkg/detectors/ipquality/ipquality.go+++ b/pkg/detectors/ipquality/ipquality.go@@ -3,7 +3,7 @@ package ipqualityimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/ipstack/ipstack.go b/pkg/detectors/ipstack/ipstack.goindex 3f62889ec..82a7d0a7e 100644--- a/pkg/detectors/ipstack/ipstack.go+++ b/pkg/detectors/ipstack/ipstack.go@@ -2,7 +2,7 @@ package ipstackimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/languagelayer/languagelayer.go b/pkg/detectors/languagelayer/languagelayer.goindex fa38f9ef1..17799ec2a 100644--- a/pkg/detectors/languagelayer/languagelayer.go+++ b/pkg/detectors/languagelayer/languagelayer.go@@ -3,7 +3,7 @@ package languagelayerimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `results`) || strings.Contains(bodyString, `"info":"Access Restricted - Your current Subscription Plan does not support HTTPS Encryption."`)diff --git a/pkg/detectors/linearapi/linearapi.go b/pkg/detectors/linearapi/linearapi.goindex 36022b642..a1f5920aa 100644--- a/pkg/detectors/linearapi/linearapi.go+++ b/pkg/detectors/linearapi/linearapi.go@@ -2,7 +2,7 @@ package linearapiimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -59,7 +59,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/mailboxlayer/mailboxlayer.go b/pkg/detectors/mailboxlayer/mailboxlayer.goindex d7b8800f8..d51484f99 100644--- a/pkg/detectors/mailboxlayer/mailboxlayer.go+++ b/pkg/detectors/mailboxlayer/mailboxlayer.go@@ -2,7 +2,7 @@ package mailboxlayerimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/mesibo/mesibo.go b/pkg/detectors/mesibo/mesibo.goindex fdbf071af..541a444ef 100644--- a/pkg/detectors/mesibo/mesibo.go+++ b/pkg/detectors/mesibo/mesibo.go@@ -2,7 +2,7 @@ package mesiboimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/metaapi/metaapi.go b/pkg/detectors/metaapi/metaapi.goindex 51d0975eb..e2ca68644 100644--- a/pkg/detectors/metaapi/metaapi.go+++ b/pkg/detectors/metaapi/metaapi.go@@ -3,7 +3,7 @@ package metaapiimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- body, errBody := ioutil.ReadAll(res.Body)+ body, errBody := io.ReadAll(res.Body)if errBody == nil {bodyStr := string(body)diff --git a/pkg/detectors/mindmeister/mindmeister.go b/pkg/detectors/mindmeister/mindmeister.goindex 80ad81944..bbeca142b 100644--- a/pkg/detectors/mindmeister/mindmeister.go+++ b/pkg/detectors/mindmeister/mindmeister.go@@ -3,7 +3,7 @@ package mindmeisterimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"stat":"ok"`)diff --git a/pkg/detectors/moosend/moosend.go b/pkg/detectors/moosend/moosend.goindex c3325b89f..e3f8c24c1 100644--- a/pkg/detectors/moosend/moosend.go+++ b/pkg/detectors/moosend/moosend.go@@ -2,7 +2,7 @@ package moosendimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/mrticktock/mrticktock.go b/pkg/detectors/mrticktock/mrticktock.goindex 72367e38b..fbebf2d72 100644--- a/pkg/detectors/mrticktock/mrticktock.go+++ b/pkg/detectors/mrticktock/mrticktock.go@@ -3,7 +3,7 @@ package mrticktockimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/numverify/numverify.go b/pkg/detectors/numverify/numverify.goindex 9a2062f88..2a6e5a779 100644--- a/pkg/detectors/numverify/numverify.go+++ b/pkg/detectors/numverify/numverify.go@@ -3,7 +3,7 @@ package numverifyimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -50,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `country_code`) || strings.Contains(bodyString, `"info":"Access Restricted - Your current Subscription Plan does not support HTTPS Encryption."`)diff --git a/pkg/detectors/onedesk/onedesk.go b/pkg/detectors/onedesk/onedesk.goindex e11b87f88..8d1411ac0 100644--- a/pkg/detectors/onedesk/onedesk.go+++ b/pkg/detectors/onedesk/onedesk.go@@ -3,7 +3,7 @@ package onedeskimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -65,7 +65,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/paralleldots/paralleldots.go b/pkg/detectors/paralleldots/paralleldots.goindex af4cadded..acf566c3a 100644--- a/pkg/detectors/paralleldots/paralleldots.go+++ b/pkg/detectors/paralleldots/paralleldots.go@@ -4,7 +4,6 @@ import ("bytes""context""io"- "io/ioutil""mime/multipart""net/http""regexp"@@ -78,7 +77,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/pdflayer/pdflayer.go b/pkg/detectors/pdflayer/pdflayer.goindex 1ce464729..c64325462 100644--- a/pkg/detectors/pdflayer/pdflayer.go+++ b/pkg/detectors/pdflayer/pdflayer.go@@ -3,7 +3,7 @@ package pdflayerimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `Contents`)diff --git a/pkg/detectors/planyo/planyo.go b/pkg/detectors/planyo/planyo.goindex d94de4d46..6291d1d97 100644--- a/pkg/detectors/planyo/planyo.go+++ b/pkg/detectors/planyo/planyo.go@@ -3,7 +3,7 @@ package planyoimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/raven/raven.go b/pkg/detectors/raven/raven.goindex 946211e94..e866a6e0c 100644--- a/pkg/detectors/raven/raven.go+++ b/pkg/detectors/raven/raven.go@@ -4,7 +4,7 @@ import ("context""encoding/json""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/reallysimplesystems/reallysimplesystems.go b/pkg/detectors/reallysimplesystems/reallysimplesystems.goindex dde05f4ab..d3bee2f14 100644--- a/pkg/detectors/reallysimplesystems/reallysimplesystems.go+++ b/pkg/detectors/reallysimplesystems/reallysimplesystems.go@@ -4,7 +4,7 @@ import ("context""encoding/json""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("Authorization", fmt.Sprintf("Bearer %s", resMatch))res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/scrapersite/scrapersite.go b/pkg/detectors/scrapersite/scrapersite.goindex 902e6352b..2b14a3b9a 100644--- a/pkg/detectors/scrapersite/scrapersite.go+++ b/pkg/detectors/scrapersite/scrapersite.go@@ -3,7 +3,7 @@ package scrapersiteimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/scrapestack/scrapestack.go b/pkg/detectors/scrapestack/scrapestack.goindex dbc260388..41eb3f5d7 100644--- a/pkg/detectors/scrapestack/scrapestack.go+++ b/pkg/detectors/scrapestack/scrapestack.go@@ -3,7 +3,7 @@ package scrapestackimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `html`) || strings.Contains(bodyString, `"info":"Access Restricted - Your current Subscription Plan does not support HTTPS Encryption."`)diff --git a/pkg/detectors/screenshotlayer/screenshotlayer.go b/pkg/detectors/screenshotlayer/screenshotlayer.goindex 530c0bbfd..8fa64590c 100644--- a/pkg/detectors/screenshotlayer/screenshotlayer.go+++ b/pkg/detectors/screenshotlayer/screenshotlayer.go@@ -3,7 +3,7 @@ package screenshotlayerimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `PNG`)diff --git a/pkg/detectors/semaphore/semaphore.go b/pkg/detectors/semaphore/semaphore.goindex 4926c6e42..bddecc80b 100644--- a/pkg/detectors/semaphore/semaphore.go+++ b/pkg/detectors/semaphore/semaphore.go@@ -3,7 +3,7 @@ package semaphoreimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -61,7 +61,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/serpstack/serpstack.go b/pkg/detectors/serpstack/serpstack.goindex b26f2bc13..8fac9dcfa 100644--- a/pkg/detectors/serpstack/serpstack.go+++ b/pkg/detectors/serpstack/serpstack.go@@ -3,7 +3,7 @@ package serpstackimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `search_url`) || strings.Contains(bodyString, `"info":"Access Restricted - Your current Subscription Plan does not support HTTPS Encryption."`)diff --git a/pkg/detectors/shortcut/shortcut.go b/pkg/detectors/shortcut/shortcut.goindex b420c81de..3e9194855 100644--- a/pkg/detectors/shortcut/shortcut.go+++ b/pkg/detectors/shortcut/shortcut.go@@ -2,7 +2,7 @@ package shortcutimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/simfin/simfin.go b/pkg/detectors/simfin/simfin.goindex 6df2081db..45b8b038e 100644--- a/pkg/detectors/simfin/simfin.go+++ b/pkg/detectors/simfin/simfin.go@@ -3,7 +3,7 @@ package simfinimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -21,7 +21,7 @@ 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 positiveskeyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"simfin"}) + `\b([a-zA-Z0-9]{32})\b`))@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}@@ -66,7 +66,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultif res.StatusCode >= 200 && res.StatusCode < 300 && validResponse {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 keyif detectors.IsKnownFalsePositive(resMatch, detectors.DefaultFalsePositives, true) {continue}diff --git a/pkg/detectors/slackwebhook/slackwebhook.go b/pkg/detectors/slackwebhook/slackwebhook.goindex 1969d6827..739ba721c 100644--- a/pkg/detectors/slackwebhook/slackwebhook.go+++ b/pkg/detectors/slackwebhook/slackwebhook.go@@ -2,7 +2,7 @@ package slackwebhookimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/sonarcloud/sonarcloud.go b/pkg/detectors/sonarcloud/sonarcloud.goindex 91a5c7560..39e1c1ea2 100644--- a/pkg/detectors/sonarcloud/sonarcloud.go+++ b/pkg/detectors/sonarcloud/sonarcloud.go@@ -2,7 +2,7 @@ package sonarcloudimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/tefter/tefter.go b/pkg/detectors/tefter/tefter.goindex 296bb02b8..9767c3c99 100644--- a/pkg/detectors/tefter/tefter.go+++ b/pkg/detectors/tefter/tefter.go@@ -3,7 +3,7 @@ package tefterimport ("context""encoding/json"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -21,7 +21,7 @@ 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 positiveskeyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"tefter"}) + `\b([0-9a-zA-Z]{20})\b`))@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("X-User-Token", resMatch)res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}@@ -68,7 +68,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultif res.StatusCode >= 200 && res.StatusCode < 300 && validResponse {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 keyif detectors.IsKnownFalsePositive(resMatch, detectors.DefaultFalsePositives, true) {continue}diff --git a/pkg/detectors/teletype/teletype.go b/pkg/detectors/teletype/teletype.goindex d3199dd01..905bf6a8d 100644--- a/pkg/detectors/teletype/teletype.go+++ b/pkg/detectors/teletype/teletype.go@@ -2,7 +2,7 @@ package teletypeimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultreq.Header.Add("X-Auth-Token", resMatch)res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/text2data/text2data.go b/pkg/detectors/text2data/text2data.goindex 2fed92bfb..2e5ed68fd 100644--- a/pkg/detectors/text2data/text2data.go+++ b/pkg/detectors/text2data/text2data.go@@ -2,7 +2,7 @@ package text2dataimport ("context"- "io/ioutil"+ "io""net/http""net/url""regexp"@@ -63,7 +63,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- body, errBody := ioutil.ReadAll(res.Body)+ body, errBody := io.ReadAll(res.Body)if errBody == nil {bodyString := string(body)diff --git a/pkg/detectors/thinkific/thinkific.go b/pkg/detectors/thinkific/thinkific.goindex d46834c43..11e96f9c0 100644--- a/pkg/detectors/thinkific/thinkific.go+++ b/pkg/detectors/thinkific/thinkific.go@@ -3,7 +3,7 @@ package thinkificimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -67,7 +67,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/twelvedata/twelvedata.go b/pkg/detectors/twelvedata/twelvedata.goindex c163d6f1d..e0c99e6dc 100644--- a/pkg/detectors/twelvedata/twelvedata.go+++ b/pkg/detectors/twelvedata/twelvedata.go@@ -2,7 +2,7 @@ package twelvedataimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/unifyid/unifyid.go b/pkg/detectors/unifyid/unifyid.goindex bbf8d69d4..0a128db45 100644--- a/pkg/detectors/unifyid/unifyid.go+++ b/pkg/detectors/unifyid/unifyid.go@@ -2,7 +2,7 @@ package unifyidimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/upcdatabase/upcdatabase.go b/pkg/detectors/upcdatabase/upcdatabase.goindex 5bea46f83..62cb3c71a 100644--- a/pkg/detectors/upcdatabase/upcdatabase.go+++ b/pkg/detectors/upcdatabase/upcdatabase.go@@ -3,7 +3,7 @@ package upcdatabaseimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `added_time`)diff --git a/pkg/detectors/uptimerobot/uptimerobot.go b/pkg/detectors/uptimerobot/uptimerobot.goindex 050500e66..afe4ae6b5 100644--- a/pkg/detectors/uptimerobot/uptimerobot.go+++ b/pkg/detectors/uptimerobot/uptimerobot.go@@ -2,7 +2,7 @@ package uptimerobotimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/userstack/userstack.go b/pkg/detectors/userstack/userstack.goindex 461359645..07ccc7312 100644--- a/pkg/detectors/userstack/userstack.go+++ b/pkg/detectors/userstack/userstack.go@@ -3,7 +3,7 @@ package userstackimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)valid := strings.Contains(bodyString, `is_mobile_device`) || strings.Contains(bodyString, `"info":"Access Restricted - Your current Subscription Plan does not support HTTPS Encryption."`)diff --git a/pkg/detectors/vatlayer/vatlayer.go b/pkg/detectors/vatlayer/vatlayer.goindex e0772ec43..e036e0960 100644--- a/pkg/detectors/vatlayer/vatlayer.go+++ b/pkg/detectors/vatlayer/vatlayer.go@@ -3,7 +3,7 @@ package vatlayerimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `vat_number`) || strings.Contains(bodyString, `"info":"Access Restricted - Your current Subscription Plan does not support HTTPS Encryption."`)diff --git a/pkg/detectors/walkscore/walkscore.go b/pkg/detectors/walkscore/walkscore.goindex e84089224..b3316aaff 100644--- a/pkg/detectors/walkscore/walkscore.go+++ b/pkg/detectors/walkscore/walkscore.go@@ -3,7 +3,7 @@ package walkscoreimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/weatherstack/weatherstack.go b/pkg/detectors/weatherstack/weatherstack.goindex 41e4efe88..df8d9f6a8 100644--- a/pkg/detectors/weatherstack/weatherstack.go+++ b/pkg/detectors/weatherstack/weatherstack.go@@ -3,7 +3,7 @@ package weatherstackimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/webscraping/webscraping.go b/pkg/detectors/webscraping/webscraping.goindex 8bb147262..3582f7f63 100644--- a/pkg/detectors/webscraping/webscraping.go+++ b/pkg/detectors/webscraping/webscraping.go@@ -2,7 +2,7 @@ package webscrapingimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/websitepulse/websitepulse.go b/pkg/detectors/websitepulse/websitepulse.goindex a10caa926..403f7b711 100644--- a/pkg/detectors/websitepulse/websitepulse.go+++ b/pkg/detectors/websitepulse/websitepulse.go@@ -2,11 +2,12 @@ package websitepulseimport ("context"+ "fmt"+ "io""net/http""regexp""strings"- "io/ioutil"-"fmt"+"github.com/trufflesecurity/trufflehog/v3/pkg/common""github.com/trufflesecurity/trufflehog/v3/pkg/detectors""github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"@@ -20,9 +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 positiveskeyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"websitepulse"}) + `\b([0-9a-f]{32})\b`)- idPat = regexp.MustCompile(detectors.PrefixRegex([]string{"websitepulse"}) + `\b([0-9a-zA-Z._]{4,22})\b`)+ idPat = regexp.MustCompile(detectors.PrefixRegex([]string{"websitepulse"}) + `\b([0-9a-zA-Z._]{4,22})\b`))// Keywords are used for efficiently pre-filtering chunks.@@ -54,13 +55,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultRaw: []byte(resMatch),}if verify {- req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.websitepulse.com/textserver.php?method=GetContacts&username=%s&key=%s",resIdMatch,resMatch), nil)+ req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://api.websitepulse.com/textserver.php?method=GetContacts&username=%s&key=%s", resIdMatch, resMatch), nil)if err != nil {continue}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}@@ -75,10 +76,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}}}-+results = append(results, s1)}-+}return detectors.CleanResults(results), nildiff --git a/pkg/detectors/whoxy/whoxy.go b/pkg/detectors/whoxy/whoxy.goindex 394c7f73d..a59ad2a0f 100644--- a/pkg/detectors/whoxy/whoxy.go+++ b/pkg/detectors/whoxy/whoxy.go@@ -3,7 +3,7 @@ package whoxyimport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -57,7 +57,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/worldcoinindex/worldcoinindex.go b/pkg/detectors/worldcoinindex/worldcoinindex.goindex cf8fc9729..2c171660a 100644--- a/pkg/detectors/worldcoinindex/worldcoinindex.go+++ b/pkg/detectors/worldcoinindex/worldcoinindex.go@@ -3,7 +3,7 @@ package worldcoinindeximport ("context""fmt"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result}res, err := client.Do(req)if err == nil {- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err == nil {bodyString := string(bodyBytes)validResponse := strings.Contains(bodyString, `"Markets"`)diff --git a/pkg/detectors/zenscrape/zenscrape.go b/pkg/detectors/zenscrape/zenscrape.goindex 816054e99..e98056812 100644--- a/pkg/detectors/zenscrape/zenscrape.go+++ b/pkg/detectors/zenscrape/zenscrape.go@@ -2,7 +2,7 @@ package zenscrapeimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -56,7 +56,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/zenserp/zenserp.go b/pkg/detectors/zenserp/zenserp.goindex 3d9fe45f3..4a3827349 100644--- a/pkg/detectors/zenserp/zenserp.go+++ b/pkg/detectors/zenserp/zenserp.go@@ -2,7 +2,7 @@ package zenserpimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -54,7 +54,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/detectors/zerobounce/zerobounce.go b/pkg/detectors/zerobounce/zerobounce.goindex b4b8eec48..c42a61a29 100644--- a/pkg/detectors/zerobounce/zerobounce.go+++ b/pkg/detectors/zerobounce/zerobounce.go@@ -2,7 +2,7 @@ package zerobounceimport ("context"- "io/ioutil"+ "io""net/http""regexp""strings"@@ -55,7 +55,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (resultres, err := client.Do(req)if err == nil {defer res.Body.Close()- bodyBytes, err := ioutil.ReadAll(res.Body)+ bodyBytes, err := io.ReadAll(res.Body)if err != nil {continue}diff --git a/pkg/updater/updater.go b/pkg/updater/updater.goindex 5026cf811..e728a5647 100644--- a/pkg/updater/updater.go+++ b/pkg/updater/updater.go@@ -7,7 +7,6 @@ import ("compress/gzip""encoding/json""io"- "io/ioutil""net/http""runtime""strings"@@ -34,7 +33,7 @@ type OSS struct {// Init validates the provided configfunc (g *OSS) Init() error {- //initiate OSS connection+ // initiate OSS connectionreturn nil}@@ -81,7 +80,7 @@ func (g *OSS) Fetch() (io.Reader, error) {log.Debug("fetching trufflehog update")- newBinBytes, err := ioutil.ReadAll(resp.Body)+ newBinBytes, err := io.ReadAll(resp.Body)if err != nil {return nil, err}