Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
added handling of forbidden state in slack webhook detector. (#3635)
Abdul Basit6c10a72a9fa7
diff --git a/pkg/detectors/slackwebhook/slackwebhook.go b/pkg/detectors/slackwebhook/slackwebhook.goindex 8453513cf..f77551cf3 100644--- a/pkg/detectors/slackwebhook/slackwebhook.go+++ b/pkg/detectors/slackwebhook/slackwebhook.go@@ -90,7 +90,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (results1.Verified = truecase res.StatusCode == http.StatusBadRequest && bytes.Equal(bodyBytes, []byte("invalid_payload")):s1.Verified = true- case res.StatusCode == http.StatusNotFound:+ case res.StatusCode == http.StatusNotFound || res.StatusCode == http.StatusForbidden:// Not a real webhook or the owning app's OAuth token has been revoked or the app has been deleted// You might want to handle this case or log it.default: