mirror of
https://github.com/trufflesecurity/trufflehog.git
synced 2024-11-13 00:17:18 +00:00
A few improvements (#809)
* Run integration tests * Update examples * Import mongodb
This commit is contained in:
parent
4382fd3441
commit
fcd580406e
4 changed files with 9 additions and 4 deletions
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
|
@ -28,7 +28,7 @@ jobs:
|
||||||
workload_identity_provider: 'projects/811013774421/locations/global/workloadIdentityPools/github-pool/providers/github-provider'
|
workload_identity_provider: 'projects/811013774421/locations/global/workloadIdentityPools/github-pool/providers/github-provider'
|
||||||
service_account: 'github-ci-external@trufflehog-testing.iam.gserviceaccount.com'
|
service_account: 'github-ci-external@trufflehog-testing.iam.gserviceaccount.com'
|
||||||
- name: Test
|
- name: Test
|
||||||
run: make test
|
run: make test-integration
|
||||||
test-detectors:
|
test-detectors:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
|
|
3
Makefile
3
Makefile
|
@ -30,6 +30,9 @@ test-failing:
|
||||||
test:
|
test:
|
||||||
CGO_ENABLED=0 go test -timeout=5m $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
|
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:
|
test-race:
|
||||||
CGO_ENABLED=1 go test -timeout=5m -race $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
|
CGO_ENABLED=1 go test -timeout=5m -race $(shell go list ./... | grep -v /vendor/ | grep -v pkg/detectors)
|
||||||
|
|
||||||
|
|
|
@ -170,7 +170,7 @@ docker run -it -v "$PWD:/pwd" trufflesecurity/trufflehog:latest github --org=tru
|
||||||
# Scan commits until here (usually dev branch).
|
# Scan commits until here (usually dev branch).
|
||||||
head: # optional
|
head: # optional
|
||||||
# Extra args to be passed to the trufflehog cli.
|
# 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
|
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:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
- name: TruffleHog OSS
|
- name: TruffleHog OSS
|
||||||
uses: trufflesecurity/trufflehog@v3.4.3
|
uses: trufflesecurity/trufflehog@main
|
||||||
with:
|
with:
|
||||||
path: ./
|
path: ./
|
||||||
base: ${{ github.event.repository.default_branch }}
|
base: ${{ github.event.repository.default_branch }}
|
||||||
head: HEAD
|
head: HEAD
|
||||||
extra_args: --debug
|
extra_args: --debug --only-verified
|
||||||
```
|
```
|
||||||
|
|
||||||
### Precommit Hook
|
### Precommit Hook
|
||||||
|
|
|
@ -399,6 +399,7 @@ import (
|
||||||
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/mockaroo"
|
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/mockaroo"
|
||||||
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/moderation"
|
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/moderation"
|
||||||
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/monday"
|
"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/monkeylearn"
|
||||||
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/moonclerck"
|
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/moonclerck"
|
||||||
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/moonclerk"
|
"github.com/trufflesecurity/trufflehog/v3/pkg/detectors/moonclerk"
|
||||||
|
@ -1471,5 +1472,6 @@ func DefaultDetectors() []detectors.Detector {
|
||||||
prodpad.Scanner{},
|
prodpad.Scanner{},
|
||||||
transferwise.Scanner{},
|
transferwise.Scanner{},
|
||||||
codemagic.Scanner{},
|
codemagic.Scanner{},
|
||||||
|
mongodb.Scanner{},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue