Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
use go 1.18 (#566)
Dustin Decker4d3c2d70e5a4
diff --git a/.github/workflows/codeql-analysis.yml.todo b/.github/workflows/codeql-analysis.ymlsimilarity index 100%rename from .github/workflows/codeql-analysis.yml.todorename to .github/workflows/codeql-analysis.ymldiff --git a/.github/workflows/lint.yml b/.github/workflows/lint.ymlindex 62e2dc845..ef0bb85e5 100644--- a/.github/workflows/lint.yml+++ b/.github/workflows/lint.yml@@ -19,13 +19,13 @@ jobs:steps:- uses: actions/setup-go@v3with:- go-version: '1.17'+ go-version: '1.18'- uses: actions/checkout@v3- name: golangci-lintuses: golangci/golangci-lint-action@v3with:# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version- version: v1.43+ version: latest# Optional: working directory, useful for monorepos# working-directory: somedirdiff --git a/.github/workflows/release.yml b/.github/workflows/release.ymlindex e9da5a6d2..d5bc0fbd6 100644--- a/.github/workflows/release.yml+++ b/.github/workflows/release.yml@@ -43,7 +43,7 @@ jobs:- name: Set up Gouses: actions/setup-go@v3with:- go-version: 1.17+ go-version: '1.18'- name: Run GoReleaseruses: goreleaser/goreleaser-action@v2with:diff --git a/.github/workflows/dogfood.yml b/.github/workflows/secrets.ymlsimilarity index 69%rename from .github/workflows/dogfood.ymlrename to .github/workflows/secrets.ymlindex a1ed56ee3..f6ba3a970 100644--- a/.github/workflows/dogfood.yml+++ b/.github/workflows/secrets.yml@@ -1,5 +1,5 @@-name: Dogfood+name: Scan for secretson:push:@@ -11,16 +11,12 @@ on:jobs:test:- strategy:- matrix:- go-version: [1.17.x]- os: [ubuntu-latest]- runs-on: ${{ matrix.os }}+ runs-on: ubuntu-lateststeps:- name: Install Gouses: actions/setup-go@v3with:- go-version: ${{ matrix.go-version }}+ go-version: '1.18'- name: Checkout codeuses: actions/checkout@v3with:diff --git a/.github/workflows/snifftest.yml b/.github/workflows/snifftest.ymlindex d8dc2cf84..1fad9fe05 100644--- a/.github/workflows/snifftest.yml+++ b/.github/workflows/snifftest.yml@@ -19,7 +19,7 @@ jobs:steps:- uses: actions/setup-go@v3with:- go-version: '1.17'+ go-version: '1.18'- uses: actions/checkout@v3- name: Run Snifftestrun: make snifftest\ No newline at end of filediff --git a/.github/workflows/test.yml b/.github/workflows/test.ymlindex 35af9a38a..2ecbb6b01 100644--- a/.github/workflows/test.yml+++ b/.github/workflows/test.yml@@ -11,11 +11,7 @@ on:jobs:test:- strategy:- matrix:- go-version: [1.17.x]- os: [ubuntu-latest]- runs-on: ${{ matrix.os }}+ runs-on: ubuntu-latestpermissions:contents: 'read'id-token: 'write'@@ -23,7 +19,7 @@ jobs:- name: Install Gouses: actions/setup-go@v3with:- go-version: ${{ matrix.go-version }}+ go-version: '1.18'- name: Checkout codeuses: actions/checkout@v3- id: 'auth'@@ -34,11 +30,7 @@ jobs:- name: Testrun: make testtest-detectors:- strategy:- matrix:- go-version: [1.17.x]- os: [ubuntu-latest]- runs-on: ${{ matrix.os }}+ runs-on: ubuntu-latestpermissions:contents: 'read'id-token: 'write'@@ -46,7 +38,7 @@ jobs:- name: Install Gouses: actions/setup-go@v3with:- go-version: ${{ matrix.go-version }}+ go-version: '1.18'- name: Checkout codeuses: actions/checkout@v3- id: 'auth'diff --git a/go.mod b/go.modindex b6599ac51..bb9fa0b30 100644--- a/go.mod+++ b/go.mod@@ -1,6 +1,6 @@module github.com/trufflesecurity/trufflehog/v3-go 1.17+go 1.18replace github.com/jpillora/overseer => github.com/trufflesecurity/overseer v1.1.7-custom5diff --git a/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go b/pkg/detectors/auth0managementapitoken/auth0managementapitoken.goindex e2c5eeec9..20556f15e 100644--- a/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go+++ b/pkg/detectors/auth0managementapitoken/auth0managementapitoken.go@@ -23,7 +23,7 @@ var (// long jwt token but note this is default 8640000 seconds = 24 hours but could be set to maximum 2592000 seconds = 720 hours = 30 days// at https://manage.auth0.com/dashboard/us/dev-63memjo3/apis/management/explorermanagementApiTokenPat = regexp.MustCompile(detectors.PrefixRegex([]string{"auth0"}) + `\b(ey[a-zA-Z0-9._-]+)\b`)- domainPat = regexp.MustCompile(`([a-zA-Z0-9\-]{2,16}\.[a-zA-Z0-9_-]{2,3}\.auth0.com)`) // could be part of url+ domainPat = regexp.MustCompile(`([a-zA-Z0-9\-]{2,16}\.[a-zA-Z0-9_-]{2,3}\.auth0\.com)`) // could be part of url)// Keywords are used for efficiently pre-filtering chunks.diff --git a/pkg/detectors/auth0oauth/auth0oauth.go b/pkg/detectors/auth0oauth/auth0oauth.goindex e3b24e6da..32c6616ee 100644--- a/pkg/detectors/auth0oauth/auth0oauth.go+++ b/pkg/detectors/auth0oauth/auth0oauth.go@@ -26,7 +26,7 @@ var (clientIdPat = regexp.MustCompile(detectors.PrefixRegex([]string{"auth0"}) + `\b([a-zA-Z0-9_-]{32,60})\b`)clientSecretPat = regexp.MustCompile(`\b([a-zA-Z0-9_-]{64,})\b`)- domainPat = regexp.MustCompile(`\b([a-zA-Z0-9][a-zA-Z0-9._-]*auth0.com)\b`) // could be part of url+ domainPat = regexp.MustCompile(`\b([a-zA-Z0-9][a-zA-Z0-9._-]*auth0\.com)\b`) // could be part of url)// Keywords are used for efficiently pre-filtering chunks.diff --git a/pkg/detectors/kanban/kanban.go b/pkg/detectors/kanban/kanban.goindex d99b20e60..f5861e73b 100644--- a/pkg/detectors/kanban/kanban.go+++ b/pkg/detectors/kanban/kanban.go@@ -22,7 +22,7 @@ var (// Make sure that your group is surrounded in boundary characters such as below to reduce false positives.keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"kanban"}) + `\b([0-9A-Z]{12})\b`)- urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}.kanbantool.com)\b`)+ urlPat = regexp.MustCompile(`\b([0-9a-z]{1,}\.kanbantool\.com)\b`))// Keywords are used for efficiently pre-filtering chunks.