Skip to content

Commit 040036a

Browse files
committed
Merge branch 'main' into cursor/require-product-eng-approval-for-prs-f38f
2 parents 349d1c7 + b84c3d1 commit 040036a

39 files changed

+2930
-1725
lines changed

README.md

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ This requires Cosign binary to be installed prior to running the installation sc
185185
Command:
186186

187187
```bash
188-
trufflehog git https://github.com/trufflesecurity/test_keys --results=verified,unknown
188+
trufflehog git https://github.com/trufflesecurity/test_keys --results=verified
189189
```
190190

191191
Expected output:
@@ -209,15 +209,15 @@ Timestamp: 2022-06-16 10:17:40 -0700 PDT
209209
## 2: Scan a GitHub Org for only verified secrets
210210

211211
```bash
212-
trufflehog github --org=trufflesecurity --results=verified,unknown
212+
trufflehog github --org=trufflesecurity --results=verified
213213
```
214214

215-
## 3: Scan a GitHub Repo for only verified keys and get JSON output
215+
## 3: Scan a GitHub Repo for only verified secrets and get JSON output
216216

217217
Command:
218218

219219
```bash
220-
trufflehog git https://github.com/trufflesecurity/test_keys --results=verified,unknown --json
220+
trufflehog git https://github.com/trufflesecurity/test_keys --results=verified --json
221221
```
222222

223223
Expected output:
@@ -233,7 +233,7 @@ Expected output:
233233
trufflehog github --repo=https://github.com/trufflesecurity/test_keys --issue-comments --pr-comments
234234
```
235235

236-
## 5: Scan an S3 bucket for verified keys
236+
## 5: Scan an S3 bucket for high-confidence results (verified + unknown)
237237

238238
```bash
239239
trufflehog s3 --bucket=<bucket name> --results=verified,unknown
@@ -269,25 +269,27 @@ Run trufflehog from the parent directory (outside the git repo).
269269
$ trufflehog git file://test_keys --results=verified,unknown
270270
```
271271

272-
## 10: Scan GCS buckets for verified secrets
272+
To guard against malicious git configs in local scanning (see CVE-2025-41390), TruffleHog clones local git repositories to a temporary directory prior to scanning. This follows [Git's security best practices](https://git-scm.com/docs/git#_security). If you want to specify a custom path to clone the repository to (instead of tmp), you can use the `--clone-path` flag. If you'd like to skip the local cloning process and scan the repository directly (only do this for trusted repos), you can use the `--trust-local-git-config` flag.
273+
274+
## 10: Scan GCS buckets for only verified secrets
273275

274276
```bash
275-
trufflehog gcs --project-id=<project-ID> --cloud-environment --results=verified,unknown
277+
trufflehog gcs --project-id=<project-ID> --cloud-environment --results=verified
276278
```
277279

278-
## 11: Scan a Docker image for verified secrets
280+
## 11: Scan a Docker image for only verified secrets
279281

280282
Use the `--image` flag multiple times to scan multiple images.
281283

282284
```bash
283285
# to scan from a remote registry
284-
trufflehog docker --image trufflesecurity/secrets --results=verified,unknown
286+
trufflehog docker --image trufflesecurity/secrets --results=verified
285287

286288
# to scan from the local docker daemon
287-
trufflehog docker --image docker://new_image:tag --results=verified,unknown
289+
trufflehog docker --image docker://new_image:tag --results=verified
288290

289291
# to scan from an image saved as a tarball
290-
trufflehog docker --image file://path_to_image.tar --results=verified,unknown
292+
trufflehog docker --image file://path_to_image.tar --results=verified
291293
```
292294

293295
## 12: Scan in CI
@@ -389,7 +391,7 @@ aws s3 cp s3://example/gzipped/data.gz - | gunzip -c | trufflehog stdin
389391
- Why is the scan taking a long time when I scan a GitHub org
390392
- Unauthenticated GitHub scans have rate limits. To improve your rate limits, include the `--token` flag with a personal access token
391393
- It says a private key was verified, what does that mean?
392-
- Check out our Driftwood blog post to learn how to do this, in short we've confirmed the key can be used live for SSH or SSL [Blog post](https://trufflesecurity.com/blog/driftwood-know-if-private-keys-are-sensitive/)
394+
- A verified result means TruffleHog confirmed the credential is valid by testing it against the service's API. For private keys, we've confirmed the key can be used live for SSH or SSL authentication. Check out our Driftwood blog post to learn more [Blog post](https://trufflesecurity.com/blog/driftwood-know-if-private-keys-are-sensitive/)
393395
- Is there an easy way to ignore specific secrets?
394396
- If the scanned source [supports line numbers](https://github.com/trufflesecurity/trufflehog/blob/d6375ba92172fd830abb4247cca15e3176448c5d/pkg/engine/engine.go#L358-L365), then you can add a `trufflehog:ignore` comment on the line containing the secret to ignore that secrets.
395397

@@ -405,7 +407,13 @@ TruffleHog v3 is a complete rewrite in Go with many new powerful features.
405407

406408
## What is credential verification?
407409

408-
For every potential credential that is detected, we've painstakingly implemented programmatic verification against the API that we think it belongs to. Verification eliminates false positives. For example, the [AWS credential detector](pkg/detectors/aws/aws.go) performs a `GetCallerIdentity` API call against the AWS API to verify if an AWS credential is active.
410+
For every potential credential that is detected, we've painstakingly implemented programmatic verification against the API that we think it belongs to. Verification eliminates false positives and provides three result statuses:
411+
412+
- **verified**: Credential confirmed as valid and active by API testing
413+
- **unverified**: Credential detected but not confirmed valid (may be invalid, expired, or verification disabled)
414+
- **unknown**: Verification attempted but failed due to errors, such as a network or API failure
415+
416+
For example, the [AWS credential detector](pkg/detectors/aws/aws.go) performs a `GetCallerIdentity` API call against the AWS API to verify if an AWS credential is active.
409417

410418
# :memo: Usage
411419

@@ -444,7 +452,7 @@ Flags:
444452
--github-actions Output in GitHub Actions format.
445453
--concurrency=20 Number of concurrent workers.
446454
--no-verification Don't verify the results.
447-
--results=RESULTS Specifies which type(s) of results to output: verified, unknown, unverified, filtered_unverified. Defaults to all types.
455+
--results=RESULTS Specifies which type(s) of results to output: verified (confirmed valid by API), unknown (verification failed due to error), unverified (detected but not verified), filtered_unverified (unverified but would have been filtered out). Defaults to all types.
448456
--allow-verification-overlap
449457
Allow verification of similar credentials across detectors
450458
--filter-unverified Only output first unverified result per chunk per detector if there are more than one results.
@@ -677,7 +685,7 @@ webhook is used containing the regular expression matches.
677685
678686
TruffleHog will send a JSON POST request containing the regex matches to a
679687
configured webhook endpoint. If the endpoint responds with a `200 OK` response
680-
status code, the secret is considered verified.
688+
status code, the secret is considered verified. If verification fails due to network/API errors, the result is marked as unknown.
681689

682690
Custom Detectors support a few different filtering mechanisms: entropy, regex targeting the entire match, regex targeting the captured secret,
683691
and excluded word lists checked against the secret (captured group if present, entire match if capture group is not present). Note that if

go.mod

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ require (
9191
github.com/shuheiktgw/go-travis v0.3.1
9292
github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7
9393
github.com/stretchr/testify v1.10.0
94-
github.com/tailscale/depaware v0.0.0-20250112153213-b748de04d81b
9594
github.com/testcontainers/testcontainers-go v0.34.0
9695
github.com/testcontainers/testcontainers-go/modules/elasticsearch v0.34.0
9796
github.com/testcontainers/testcontainers-go/modules/mongodb v0.34.0
@@ -212,7 +211,6 @@ require (
212211
github.com/golang-sql/sqlexp v0.1.0 // indirect
213212
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
214213
github.com/golang/snappy v1.0.0 // indirect
215-
github.com/google/go-github/v69 v69.0.0 // indirect
216214
github.com/google/go-github/v72 v72.0.0 // indirect
217215
github.com/google/go-querystring v1.1.0 // indirect
218216
github.com/google/pprof v0.0.0-20240227163752-401108e1b7e7 // indirect
@@ -253,14 +251,12 @@ require (
253251
github.com/muesli/cancelreader v0.2.2 // indirect
254252
github.com/muesli/termenv v0.16.0 // indirect
255253
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
256-
github.com/nwaples/rardecode/v2 v2.0.0-beta.4.0.20241112120701-034e449c6e78 // indirect
257-
github.com/olekukonko/tablewriter v0.0.5 // indirect
254+
github.com/nwaples/rardecode/v2 v2.2.1 // indirect
258255
github.com/onsi/ginkgo v1.16.5 // indirect
259256
github.com/opencontainers/go-digest v1.0.0 // indirect
260257
github.com/opencontainers/image-spec v1.1.1 // indirect
261258
github.com/pierrec/lz4/v4 v4.1.21 // indirect
262259
github.com/pjbgf/sha1cd v0.3.2 // indirect
263-
github.com/pkg/diff v0.0.0-20200914180035-5b29258ca4f7 // indirect
264260
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
265261
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
266262
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
@@ -314,7 +310,6 @@ require (
314310
golang.org/x/mod v0.26.0 // indirect
315311
golang.org/x/sys v0.35.0 // indirect
316312
golang.org/x/term v0.34.0 // indirect
317-
golang.org/x/tools v0.35.0 // indirect
318313
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
319314
google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
320315
google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect

0 commit comments

Comments
 (0)