WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit 2a9fb21

Browse files
Merge branch 'main' into feat/detector-gcp-oauth2
2 parents b8142ba + b6389e2 commit 2a9fb21

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+5418
-1189
lines changed

.github/workflows/README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# GitHub Workflows
2+
3+
This directory contains GitHub Actions workflows for the TruffleHog repository.
4+
5+
## PR Approval Check (`pr-approval-check.yml`)
6+
7+
This workflow enforces that at least one PR approver must be an **active** member of the `@trufflesecurity/product-eng` team or any of its child teams.
8+
9+
### How it works:
10+
11+
1. **Triggers**: The workflow runs on:
12+
- `pull_request_review` events when a review is submitted (`submitted` type)
13+
- `pull_request` events when a PR is opened, reopened, or synchronized (`opened`, `reopened`, `synchronize` types)
14+
15+
2. **Approval Check Process**: The workflow:
16+
- Fetches all reviews for the PR using the GitHub API
17+
- Filters for reviews with state `APPROVED`
18+
- Gets all child teams of `@trufflesecurity/product-eng` using `listChildInOrg` API
19+
- Checks if any approver is an **active** member (not pending) of either:
20+
- The parent `@trufflesecurity/product-eng` team, OR
21+
- Any of its child teams
22+
- Sets a commit status accordingly
23+
24+
3. **Status Check**: Creates a commit status named `product-eng-approval` with:
25+
-**Success**: When at least one approver is an active member of `@trufflesecurity/product-eng` or any child team
26+
-**Failure**: When there are no approvals or there are approvals but none from active `@trufflesecurity/product-eng` members
27+
28+
### Error Handling
29+
30+
If there are errors listing reviews or checking team membership, the workflow reports a failure status and also fails itself.
31+
32+
### Branch Protection
33+
34+
To make this check required:
35+
36+
1. Go to Settings → Branches
37+
2. Add or edit a branch protection rule for your main branch
38+
3. Enable "Require status checks to pass before merging"
39+
4. Add `pr-approval-check` to the required status checks
40+
41+
### Permissions
42+
43+
The workflow uses the default `GITHUB_TOKEN` which has sufficient permissions to:
44+
- Read PR reviews
45+
- List child teams and check team membership (for public teams)
46+
- Create commit statuses
47+
48+
**Note**: If the `product-eng` team or its child teams are private, you may need to use a personal access token with appropriate permissions. The Github API returns 404 for non-members and for lack of permissions.

CODEOWNERS

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,23 @@
22
* @trufflesecurity/product-eng
33

44
# Scanning
5+
pkg/sources/ @trufflesecurity/Scanning
56
pkg/writers/ @trufflesecurity/Scanning
67

8+
# Integrations
9+
pkg/sources/circleci/ @trufflesecurity/Integrations
10+
pkg/sources/docker/ @trufflesecurity/Integrations
11+
pkg/sources/elasticsearch/ @trufflesecurity/Integrations
12+
pkg/sources/filesystem/ @trufflesecurity/Integrations
13+
pkg/sources/gcs/ @trufflesecurity/Integrations
14+
pkg/sources/git/ @trufflesecurity/Integrations
15+
pkg/sources/github/ @trufflesecurity/Integrations
16+
pkg/sources/gitlab/ @trufflesecurity/Integrations
17+
pkg/sources/jenkins/ @trufflesecurity/Integrations
18+
pkg/sources/postman/ @trufflesecurity/Integrations
19+
pkg/sources/s3/ @trufflesecurity/Integrations
20+
pkg/sources/travisci/ @trufflesecurity/Integrations
21+
722
# Shared
823
pkg/decoders/ @trufflesecurity/Scanning @trufflesecurity/OSS
924
pkg/engine/ @trufflesecurity/Scanning @trufflesecurity/OSS
@@ -12,8 +27,7 @@ pkg/giturl/ @trufflesecurity/Scanning @trufflesecurity/OSS
1227
pkg/handlers/ @trufflesecurity/Scanning @trufflesecurity/OSS
1328
pkg/iobuf/ @trufflesecurity/Scanning @trufflesecurity/OSS
1429
pkg/sanitizer/ @trufflesecurity/Scanning @trufflesecurity/OSS
15-
pkg/sources/ @trufflesecurity/Scanning @trufflesecurity/OSS
16-
proto/ @trufflesecurity/Scanning @trufflesecurity/OSS
30+
proto/ @trufflesecurity/Scanning @trufflesecurity/Integrations
1731

1832
# OSS
1933
pkg/detectors/ @trufflesecurity/OSS

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,19 @@ To learn more about TruffleHog and its features and capabilities, visit our [pro
3030

3131
# :globe_with_meridians: TruffleHog Enterprise
3232

33-
Are you interested in continuously monitoring **Git, Jira, Slack, Confluence, Microsoft Teams, Sharepoint, and more..** for credentials? We have an enterprise product that can help! Learn more at <https://trufflesecurity.com/trufflehog-enterprise>.
33+
Are you interested in continuously monitoring **Git, Jira, Slack, Confluence, Microsoft Teams, Sharepoint (and more)** for credentials? We have an enterprise product that can help! Learn more at <https://trufflesecurity.com/trufflehog-enterprise>.
3434

3535
We take the revenue from the enterprise product to fund more awesome open source projects that the whole community can benefit from.
3636

3737
</div>
3838

3939
# What is TruffleHog 🐽
4040

41-
TruffleHog is the most powerful secrets **Discovery, Classification, Validation,** and **Analysis** tool. In this context, secret refers to a credential a machine uses to authenticate itself to another machine. This includes API keys, database passwords, private encryption keys, and more...
41+
TruffleHog is the most powerful secrets **Discovery, Classification, Validation,** and **Analysis** tool. In this context, secret refers to a credential a machine uses to authenticate itself to another machine. This includes API keys, database passwords, private encryption keys, and more.
4242

4343
## Discovery 🔍
4444

45-
TruffleHog can look for secrets in many places including Git, chats, wikis, logs, API testing platforms, object stores, filesystems and more
45+
TruffleHog can look for secrets in many places including Git, chats, wikis, logs, API testing platforms, object stores, filesystems and more.
4646

4747
## Classification 📁
4848

@@ -499,7 +499,7 @@ trufflehog git https://github.com/trufflesecurity/trufflehog.git
499499

500500
## Configuration
501501

502-
TruffleHog supports defining [custom regex detectors](#regex-detector-alpha)
502+
TruffleHog supports defining [custom regex detectors](#custom-regex-detector-alpha)
503503
and multiple sources in a configuration file provided via the `--config` flag.
504504
The regex detectors can be used with any subcommand, while the sources defined
505505
in configuration are only for the `multi-scan` subcommand.
@@ -675,7 +675,7 @@ TruffleHog can be used in a pre-commit hook to prevent credentials from leaking
675675
676676
See the [pre-commit hook documentation](PreCommit.md) for more information.
677677
678-
## Regex Detector (alpha)
678+
## Custom Regex Detector (alpha)
679679
680680
TruffleHog supports detection and verification of custom regular expressions.
681681
For detection, at least one **regular expression** and **keyword** is required.
@@ -696,6 +696,10 @@ your custom detector has multiple `regex` set (in this example `hogID`, and `hog
696696
### Regex Detector Example
697697
[Here](/pkg/custom_detectors/CUSTOM_DETECTORS.md) is how to setup a custom regex detector with verification server.
698698

699+
## Generic JWT Detection
700+
701+
TruffleHog supports detection and verification of a subset of generic JWTs it finds.
702+
Specifically, if a JWT uses public-key cryptography rather than HMAC and the public key can be obtained, TruffleHog can determine whether the JWT is live or not.
699703

700704
## :mag: Analyze
701705

go.mod

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/trufflesecurity/trufflehog/v3
22

3-
go 1.24
3+
go 1.24.0
44

55
toolchain go1.24.5
66

@@ -70,6 +70,7 @@ require (
7070
github.com/k0kubun/go-ansi v0.0.0-20180517002512-3bf9e2903213
7171
github.com/klauspost/pgzip v1.2.6
7272
github.com/kylelemons/godebug v1.1.0
73+
github.com/lestrrat-go/jwx/v3 v3.0.12
7374
github.com/lib/pq v1.10.9
7475
github.com/lrstanley/bubblezone v0.0.0-20250404061050-e13639e27357
7576
github.com/marusama/semaphore/v2 v2.5.0
@@ -90,7 +91,7 @@ require (
9091
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3
9192
github.com/shuheiktgw/go-travis v0.3.1
9293
github.com/shurcooL/githubv4 v0.0.0-20240727222349-48295856cce7
93-
github.com/stretchr/testify v1.10.0
94+
github.com/stretchr/testify v1.11.1
9495
github.com/testcontainers/testcontainers-go v0.34.0
9596
github.com/testcontainers/testcontainers-go/modules/elasticsearch v0.34.0
9697
github.com/testcontainers/testcontainers-go/modules/mongodb v0.34.0
@@ -105,11 +106,11 @@ require (
105106
go.uber.org/automaxprocs v1.6.0
106107
go.uber.org/mock v0.5.2
107108
go.uber.org/zap v1.27.0
108-
golang.org/x/crypto v0.41.0
109-
golang.org/x/net v0.43.0
109+
golang.org/x/crypto v0.43.0
110+
golang.org/x/net v0.45.0
110111
golang.org/x/oauth2 v0.30.0
111-
golang.org/x/sync v0.16.0
112-
golang.org/x/text v0.28.0
112+
golang.org/x/sync v0.17.0
113+
golang.org/x/text v0.30.0
113114
golang.org/x/time v0.12.0
114115
google.golang.org/api v0.247.0
115116
google.golang.org/protobuf v1.36.9
@@ -184,6 +185,7 @@ require (
184185
github.com/cpuguy83/dockercfg v0.3.2 // indirect
185186
github.com/cyphar/filepath-securejoin v0.3.6 // indirect
186187
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
188+
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
187189
github.com/distribution/reference v0.6.0 // indirect
188190
github.com/dlclark/regexp2 v1.11.0 // indirect
189191
github.com/docker/cli v28.2.2+incompatible // indirect
@@ -204,6 +206,7 @@ require (
204206
github.com/go-jose/go-jose/v4 v4.0.5 // indirect
205207
github.com/go-logr/stdr v1.2.2 // indirect
206208
github.com/go-ole/go-ole v1.2.6 // indirect
209+
github.com/goccy/go-json v0.10.3 // indirect
207210
github.com/gofrs/flock v0.12.1 // indirect
208211
github.com/gogo/protobuf v1.3.2 // indirect
209212
github.com/golang-jwt/jwt/v4 v4.5.2 // indirect
@@ -229,6 +232,11 @@ require (
229232
github.com/kevinburke/ssh_config v1.2.0 // indirect
230233
github.com/kjk/lzma v0.0.0-20161016003348-3fd93898850d // indirect
231234
github.com/klauspost/compress v1.18.0 // indirect
235+
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
236+
github.com/lestrrat-go/httpcc v1.0.1 // indirect
237+
github.com/lestrrat-go/httprc/v3 v3.0.1 // indirect
238+
github.com/lestrrat-go/option v1.0.1 // indirect
239+
github.com/lestrrat-go/option/v2 v2.0.0 // indirect
232240
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
233241
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
234242
github.com/magiconair/properties v1.8.7 // indirect
@@ -265,6 +273,7 @@ require (
265273
github.com/prometheus/procfs v0.15.1 // indirect
266274
github.com/rivo/uniseg v0.4.7 // indirect
267275
github.com/sahilm/fuzzy v0.1.1-0.20230530133925-c48e322e2a8f // indirect
276+
github.com/segmentio/asm v1.2.1 // indirect
268277
github.com/sendgrid/rest v2.6.9+incompatible // indirect
269278
github.com/shirou/gopsutil/v3 v3.23.12 // indirect
270279
github.com/shoenig/go-m1cpu v0.1.6 // indirect
@@ -307,9 +316,9 @@ require (
307316
go.uber.org/multierr v1.11.0 // indirect
308317
go4.org v0.0.0-20230225012048-214862532bf5 // indirect
309318
golang.org/x/exp v0.0.0-20241217172543-b2144cdd0a67 // indirect
310-
golang.org/x/mod v0.26.0 // indirect
311-
golang.org/x/sys v0.35.0 // indirect
312-
golang.org/x/term v0.34.0 // indirect
319+
golang.org/x/mod v0.28.0 // indirect
320+
golang.org/x/sys v0.37.0 // indirect
321+
golang.org/x/term v0.36.0 // indirect
313322
google.golang.org/genproto v0.0.0-20250603155806-513f23925822 // indirect
314323
google.golang.org/genproto/googleapis/api v0.0.0-20250818200422-3122310a409c // indirect
315324
google.golang.org/genproto/googleapis/rpc v0.0.0-20250818200422-3122310a409c // indirect

0 commit comments

Comments
 (0)