Skip to content

Commit

Permalink
Disable sentiment verifier and update teams webhook to avoid being st…
Browse files Browse the repository at this point in the history
…ateful (#646)
  • Loading branch information
dustin-decker authored Jul 7, 2022
1 parent c4ca7d7 commit c2426df
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/detectors/microsoftteamswebhook/microsoftteamswebhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
Raw: []byte(resMatch),
}
if verify {
payload := strings.NewReader(`{'text':'This is a verification message from TruffleHog. It means that there has been a live webhook credential found.'}`)
payload := strings.NewReader(`{'text':''}`)
req, err := http.NewRequestWithContext(ctx, "POST", resMatch, payload)
if err != nil {
continue
Expand All @@ -58,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
body, err := io.ReadAll(res.Body)
res.Body.Close()
if err == nil {
if res.StatusCode >= 200 && string(body) == "1" {
if res.StatusCode >= 200 && strings.Contains(string(body), "Text is required") {
s1.Verified = true
}
}
Expand Down
3 changes: 1 addition & 2 deletions pkg/engine/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,6 @@ import (
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/sendbirdorganizationapi"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/sendgrid"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/sendinbluev2"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/sentiment"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/sentrytoken"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/serphouse"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/serpstack"
Expand Down Expand Up @@ -1184,7 +1183,7 @@ func DefaultDetectors() []detectors.Detector {
blitapp.Scanner{},
restpackhtmltopdfapi.Scanner{},
webscraping.Scanner{},
sentiment.Scanner{},
// sentiment.Scanner{},
geoapify.Scanner{},
dfuse.Scanner{},
gitter.Scanner{},
Expand Down

0 comments on commit c2426df

Please sign in to comment.