updated convert api detector (#4017)
Co-authored-by: Kashif Khan <[email protected]>
This commit is contained in:
co-authored by
Kashif Khan
parent
dba70e6004
commit
4a3a38888d
@@ -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
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user