A few improvements (#809)

* Run integration tests

* Update examples

* Import mongodb
This commit is contained in:
Dustin Decker 2022-09-19 13:23:25 -07:00 committed by GitHub
parent 4382fd3441
commit fcd580406e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 4 deletions

View file

@ -28,7 +28,7 @@ jobs:
workload_identity_provider: 'projects/811013774421/locations/global/workloadIdentityPools/github-pool/providers/github-provider'
service_account: 'github-ci-external@trufflehog-testing.iam.gserviceaccount.com'
- name: Test
run: make test
run: make test-integration
test-detectors:
runs-on: ubuntu-latest
permissions:

View file

@ -30,6 +30,9 @@ test-failing:
test:
CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
test-integration:
CGO_ENABLED=0 go test -timeout=5m -tags=integration $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
test-race:
CGO_ENABLED=1 go test -timeout=5m -race $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)

View file

@ -170,7 +170,7 @@ docker run -it -v "$PWD:/pwd" trufflesecurity/trufflehog:latest github --org=tru
# Scan commits until here (usually dev branch).
head: # optional
# Extra args to be passed to the trufflehog cli.
extra_args: # optional
extra_args: --debug --only-verified
```
The TruffleHog OSS Github Action can be used to scan a range of commits for leaked credentials. The action will fail if
@ -189,12 +189,12 @@ jobs:
with:
fetch-depth: 0
- name: TruffleHog OSS
uses: trufflesecurity/trufflehog@v3.4.3
uses: trufflesecurity/trufflehog@main
with:
path: ./
base: ${{ github.event.repository.default_branch }}
head: HEAD
extra_args: --debug
extra_args: --debug --only-verified
```
### Precommit Hook

View file

@ -399,6 +399,7 @@ import (
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/mockaroo"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/moderation"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/monday"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/mongodb"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/monkeylearn"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/moonclerck"
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/moonclerk"
@ -1471,5 +1472,6 @@ func DefaultDetectors() []detectors.Detector {
prodpad.Scanner{},
transferwise.Scanner{},
codemagic.Scanner{},
mongodb.Scanner{},
}
}