use go 1.18 (#566)

* use go 1.18 in CI

* require go 1.18

* use latest linter

* rename ci check

* improve regex issues identified by codeql
This commit is contained in:
Dustin Decker 2022-05-19 09:01:50 -07:00 committed by GitHub
parent 8c38708d1c
commit 4d3c2d70e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 15 additions and 27 deletions

View file

@ -19,13 +19,13 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: '1.18'
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# 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: somedir

View file

@ -43,7 +43,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.17
go-version: '1.18'
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
with:

View file

@ -1,5 +1,5 @@
name: Dogfood
name: Scan for secrets
on:
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-latest
steps:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
go-version: '1.18'
- name: Checkout code
uses: actions/checkout@v3
with:

View file

@ -19,7 +19,7 @@ jobs:
steps:
- uses: actions/setup-go@v3
with:
go-version: '1.17'
go-version: '1.18'
- uses: actions/checkout@v3
- name: Run Snifftest
run: make snifftest

View file

@ -11,11 +11,7 @@ on:
jobs:
test:
strategy:
matrix:
go-version: [1.17.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
@ -23,7 +19,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
go-version: '1.18'
- name: Checkout code
uses: actions/checkout@v3
- id: 'auth'
@ -34,11 +30,7 @@ jobs:
- name: Test
run: make test
test-detectors:
strategy:
matrix:
go-version: [1.17.x]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
permissions:
contents: 'read'
id-token: 'write'
@ -46,7 +38,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v3
with:
go-version: ${{ matrix.go-version }}
go-version: '1.18'
- name: Checkout code
uses: actions/checkout@v3
- id: 'auth'

2
go.mod
View file

@ -1,6 +1,6 @@
module github.com/trufflesecurity/trufflehog/v3
go 1.17
go 1.18
replace github.com/jpillora/overseer => github.com/trufflesecurity/overseer v1.1.7-custom5

View file

@ -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/explorer
managementApiTokenPat = 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.

View file

@ -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.

View file

@ -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.