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
2 changes: 0 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,6 @@ require (
github.com/moby/sys/userns v0.1.0 // indirect
github.com/moby/term v0.5.2 // indirect
github.com/montanaflynn/stats v0.7.1 // indirect
github.com/morikuni/aec v1.0.0 // indirect
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
github.com/muesli/cancelreader v0.2.2 // indirect
github.com/muesli/termenv v0.16.0 // indirect
Expand Down Expand Up @@ -320,6 +319,5 @@ require (
google.golang.org/genproto/googleapis/rpc v0.0.0-20251222181119-0a764e51fe1b // indirect
google.golang.org/grpc v1.79.3 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
gotest.tools/v3 v3.5.2 // indirect
pault.ag/go/topsort v0.1.1 // indirect
)
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,7 @@ func run(state overseer.State, logSync func() error) {
feature.DatadogApiKeyDetectorEnabled.Store(true)
feature.TlyDetectorEnabled.Store(true)
feature.WitDetectorEnabled.Store(true)
feature.RevDetectorEnabled.Store(true)

conf := &config.Config{}
if *configFilename != "" {
Expand Down
5 changes: 3 additions & 2 deletions pkg/detectors/rev/rev.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@ package rev
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/detector_typepb"
Expand Down Expand Up @@ -49,7 +50,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
s1 := detectors.Result{
DetectorType: detector_typepb.DetectorType_Rev,
Raw: []byte(resUserMatch),
SecretParts: map[string]string{"key": resUserMatch},
SecretParts: map[string]string{"key": resUserMatch, "client": resClientMatch},
}

if verify {
Expand Down
16 changes: 13 additions & 3 deletions pkg/detectors/rev/rev_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"testing"
"time"

"github.com/kylelemons/godebug/pretty"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors"
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/detector_typepb"
Expand Down Expand Up @@ -98,7 +98,17 @@ func TestRev_FromChunk(t *testing.T) {
}
got[i].Raw = nil
}
if diff := pretty.Compare(got, tt.want); diff != "" {
ignoreOpts := cmpopts.IgnoreFields(
detectors.Result{},
"ExtraData",
"verificationError",
"primarySecret",
"SecretParts",
"chunkOffset",
"chunkOffsetSet",
)

if diff := cmp.Diff(got, tt.want, ignoreOpts); diff != "" {
t.Errorf("Rev.FromData() %s diff: (-got +want)\n%s", tt.name, diff)
}
})
Expand Down
4 changes: 4 additions & 0 deletions pkg/engine/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ import (
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/requestfinance"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/restpackhtmltopdfapi"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/restpackscreenshotapi"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/rev"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/revampcrm"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/ringcentral"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/ritekit"
Expand Down Expand Up @@ -1524,6 +1525,7 @@ func buildDetectorList() []detectors.Detector {
// &restpack.Scanner{},
&restpackhtmltopdfapi.Scanner{},
&restpackscreenshotapi.Scanner{},
&rev.Scanner{},
&revampcrm.Scanner{},
&ringcentral.Scanner{},
&ritekit.Scanner{},
Expand Down Expand Up @@ -1792,6 +1794,8 @@ func buildDetectorList() []detectors.Detector {
return !feature.TlyDetectorEnabled.Load()
case *wit.Scanner:
return !feature.WitDetectorEnabled.Load()
case *rev.Scanner:
return !feature.RevDetectorEnabled.Load()
default:
return false
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/engine/defaults/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ var excludedFromDefaultList = map[detector_typepb.DetectorType]struct{}{
detector_typepb.DetectorType_Guru: {},
detector_typepb.DetectorType_IPInfo: {},
detector_typepb.DetectorType_Lob: {},
detector_typepb.DetectorType_Rev: {},
detector_typepb.DetectorType_Tru: {},
detector_typepb.DetectorType_User: {},

Expand All @@ -134,6 +133,7 @@ var excludedFromDefaultList = map[detector_typepb.DetectorType]struct{}{
detector_typepb.DetectorType_Pinecone: {},
detector_typepb.DetectorType_TLy: {},
detector_typepb.DetectorType_Wit: {},
detector_typepb.DetectorType_Rev: {},

// Reserved / special types.
detector_typepb.DetectorType_CustomRegex: {}, // added dynamically via engine config, not via buildDetectorList()
Expand Down
1 change: 1 addition & 0 deletions pkg/feature/feature.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ var (
DatadogApiKeyDetectorEnabled atomic.Bool
TlyDetectorEnabled atomic.Bool
WitDetectorEnabled atomic.Bool
RevDetectorEnabled atomic.Bool
)

type AtomicString struct {
Expand Down
Loading