Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions pkg/detectors/artifactory/artifactory.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}

s1.SetVerificationError(verificationErr, token)

if isVerified {
s1.AnalysisInfo = map[string]string{
"domain": url,
"token": token,
}
}
}
}

Expand Down
8 changes: 7 additions & 1 deletion pkg/detectors/atlassian/v1/atlassian.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ package atlassian

import (
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"encoding/json"

regexp "github.com/wasilibs/go-re2"

Expand Down Expand Up @@ -80,6 +80,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1.ExtraData["Organization"] = orgResponse.Data[0].Attributes.Name
}
s1.SetVerificationError(verificationErr, match)

if isVerified {
s1.AnalysisInfo = map[string]string{
"key": match,
}
}
}

results = append(results, s1)
Expand Down
7 changes: 6 additions & 1 deletion pkg/detectors/buildkite/v1/buildkite.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
extraData, isVerified, verificationErr := VerifyBuildKite(ctx, client, resMatch)
s1.Verified = isVerified
s1.SetVerificationError(verificationErr, resMatch)

s1.ExtraData = extraData

if isVerified {
s1.AnalysisInfo = map[string]string{
"key": resMatch,
}
}
}

results = append(results, s1)
Expand Down
7 changes: 7 additions & 0 deletions pkg/detectors/buildkite/v2/buildkite.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1.Verified = isVerified
s1.SetVerificationError(verificationErr, resMatch)
s1.ExtraData = extraData

if isVerified {
s1.AnalysisInfo = map[string]string{
"key": resMatch,
}
}

}

results = append(results, s1)
Expand Down
7 changes: 7 additions & 0 deletions pkg/detectors/harness/harness.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,13 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1.Verified = isVerified
s1.ExtraData = extraData
s1.SetVerificationError(verificationErr, match)

if isVerified {
s1.AnalysisInfo = map[string]string{
"key": match,
}
}

}

results = append(results, s1)
Expand Down
6 changes: 6 additions & 0 deletions pkg/detectors/mongodb/mongodb.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
continue
}
r.SetVerificationError(vErr, password)

if isVerified {
r.AnalysisInfo = map[string]string{
"key": connStr,
}
}
}
results = append(results, r)
}
Expand Down
6 changes: 5 additions & 1 deletion pkg/detectors/npmtoken/npmtoken.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package npmtoken
import (
"context"
"fmt"
regexp "github.com/wasilibs/go-re2"
"net/http"
"strings"

regexp "github.com/wasilibs/go-re2"

"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
Expand Down Expand Up @@ -59,6 +60,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
defer res.Body.Close()
if res.StatusCode >= 200 && res.StatusCode < 300 {
s1.Verified = true
s1.AnalysisInfo = map[string]string{
"key": resMatch,
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion pkg/detectors/npmtokenv2/npmtokenv2.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ package npmtokenv2
import (
"context"
"fmt"
regexp "github.com/wasilibs/go-re2"
"net/http"

regexp "github.com/wasilibs/go-re2"

"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detectorspb"
Expand Down Expand Up @@ -60,6 +61,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
defer res.Body.Close()
if res.StatusCode >= 200 && res.StatusCode < 300 {
s1.Verified = true
s1.AnalysisInfo = map[string]string{
"key": resMatch,
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions pkg/detectors/postmark/postmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1.Verified = valid
s1.ExtraData = extraData
s1.SetVerificationError(err)

if valid {
s1.AnalysisInfo = map[string]string{
"key": resMatch,
}
}
}

results = append(results, s1)
Expand Down
9 changes: 9 additions & 0 deletions pkg/detectors/salesforceoauth2/salesforceoauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ domainLoop:

s1.SetVerificationError(verificationErr, secret)
}

if isVerified {
s1.AnalysisInfo = map[string]string{
"domain": domain,
"client_id": key,
"client_secret": secret,
}

}
}

results = append(results, s1)
Expand Down
Loading