updated convert api detector (#4017)

Co-authored-by: Kashif Khan <[email protected]>
This commit is contained in:
Nabeel Alam
2025-04-09 17:38:51 +05:00
committed by GitHub
co-authored by Kashif Khan
parent dba70e6004
commit 4a3a38888d
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -22,7 +22,7 @@ var (
client = common.SaneHttpClient()
// Make sure that your group is surrounded in boundary characters such as below to reduce false positives
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"convertapi"}) + `\b([0-9a-zA-Z]{16})\b`)
keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"convertapi"}) + `\b(secret_[0-9a-zA-Z]{16})\b`)
)
// Keywords are used for efficiently pre-filtering chunks.
@@ -46,7 +46,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://v2.convertapi.com/user?Secret=%s", resMatch), nil)
req, err := http.NewRequestWithContext(ctx, "GET", fmt.Sprintf("https://v2.convertapi.com/user?auth=%s", resMatch), nil)
if err != nil {
continue
}
+3 -3
View File
@@ -22,14 +22,14 @@ var (
api:
auth_type: "API-Key"
in: "Path"
convertapi_key: "H9ZGTfAERfN5W0AX"
base_url: "https://api.example.com/v1/user?Secret=$convertapi_key"
convertapi_key: "secret_H9ZGTfAERfN5W0AX"
base_url: "https://api.example.com/v1/user?auth=$convertapi_key"
# Notes:
# - Remember to rotate the secret every 90 days.
# - The above credentials should only be used in a secure environment.
`
secret = "H9ZGTfAERfN5W0AX"
secret = "secret_H9ZGTfAERfN5W0AX"
)
func TestConvertAPI_Pattern(t *testing.T) {