Skip to content

Commit 9543022

Browse files
fix: onboard new trufflehog action (#280)
This PR updates version of Trufflehog action - secrets scanning tool. edplato/trufflehog-actions-scan@v0.9l-beta is an quite old action (last update Dec 9, 2021) basaed on Trufflehog CLI version 2.2.1 (code missing on github for releases older than v3) New action is officially Trufflehog supported [action](https://github.com/trufflesecurity/trufflehog?tab=readme-ov-file#octocat-trufflehog-github-action) Arguments removed: --max-dept - trufflehog scan with default settings shall fulfill our needs ([reference](https://github.com/marketplace/actions/trufflehog-oss#octocat-trufflehog-github-action)) --allow - all related files (trufflehog-false-positive.json) in github are empty. If need comes for marking false positives, then inline comment `trufflehog:ignore` can be used Tests negative: https://github.com/splunk/splunk-add-on-for-servicenow/actions/runs/9280369321/job/25540435238 https://github.com/splunk/splunk-add-on-for-amazon-web-services/actions/runs/9268640851/job/25540437971 Test positive: https://github.com/splunk/test-addonfactory-repo/actions/runs/9281576021/job/25540353760 Test negative with added file to excluded: https://github.com/splunk/test-addonfactory-repo/actions/runs/9282480287/job/25540598592
1 parent 76b3ef3 commit 9543022

File tree

3 files changed

+13
-20
lines changed

3 files changed

+13
-20
lines changed

.github/workflows/reusable-build-test-release.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,11 +264,12 @@ jobs:
264264
submodules: false
265265
fetch-depth: "0"
266266
ref: ${{ github.head_ref }}
267-
- name: Trufflehog Actions Scan
268-
uses: edplato/trufflehog-actions-scan@v0.9l-beta
267+
- name: Secret Scanning Trufflehog
268+
uses: trufflesecurity/trufflehog@v3.77.0
269269
with:
270-
scanArguments: "--max_dept 5 -x .github/workflows/exclude-patterns.txt --allow .github/workflows/trufflehog-false-positive.json"
271-
270+
extra_args: -x .github/workflows/exclude-patterns.txt --json
271+
version: 3.77.0
272+
272273
semgrep:
273274
runs-on: ubuntu-latest
274275
name: security-sast-semgrep

README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -162,36 +162,31 @@ security-detect-secrets
162162

163163
**Description:**
164164

165-
- This action is intended as a Continuous Integration secret scan in an already "clean" repository. The default commit scan depth is the last 50 commits and can be adjusted using Custom Arguments
165+
- This action is intended as a Continuous Integration secret scan in an already "clean" repository.
166166

167-
- The stage checks for addition/deletion of any secret/sensitive data in last 50 commits of the repository.
167+
- The stage checks for addition/deletion of any secret/sensitive data in referenced commits (commits pushed or commits within PR).
168168

169-
**Action used** https://github.com/edplato/trufflehog-actions-scan
169+
**Action used** https://github.com/trufflesecurity/trufflehog
170170

171171
**Pass/fail behaviour**
172172

173-
- The stage is likely to fail if there is some sensitive or secrets or confidential data had been removed or added in the last 50 commits.
173+
- The stage is likely to fail if any sensitive secrets or confidential data were removed or added in the referenced commits.
174174

175175
**Troubleshooting steps for failures if any**
176176

177177
- User would need to update the commit history where the sensitive information is detected.
178178

179179
**Exception File**
180180

181-
- To ignore the file add the path of the file having the false positive in the `.github/workflows/exclude-patterns.txt`, ideally this should be avoided and only specific false positives should be added in exception files.
181+
- To ignore the file add the path of the file having the false positive in the `.github/workflows/exclude-patterns.txt`, ideally this should be avoided and only specific false positives should be added in exception files. This is file with newline separated regexes for files to exclude in scan.
182182

183183
- False positives include: public keys, random / dummy session keys or tokens.
184184

185-
- We can use this file `.github/workflows/trufflehog-false-positive.json` from action version `>=v0.9l-beta` to add specific failures or regexes.
186-
187-
- ref for how to add regex to json file : https://github.com/edplato/trufflehog-actions-scan#usage
188-
189-
- **NOTE:** The usage of `.github/workflows/trufflehog-false-positive.json` is not rolled out yet, PR for feature support: https://github.com/splunk/addonfactory-workflow-addon-release/pull/32
190-
185+
- User can add a `trufflehog:ignore` comment on the line containing the secret to ignore that secrets.
191186

192187
**Artifacts:**
193188

194-
- No additional artifacts, the commit info is available in the logs.
189+
- No additional artifacts, the commit info and secrets details are available in the logs.
195190

196191

197192
security-sast-semgrep

renovate.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,5 @@
55
":semanticCommitTypeAll(chore)",
66
"schedule:earlyMondays",
77
":disableDependencyDashboard"
8-
],
9-
"ignoreDeps": [
10-
"edplato/trufflehog-actions-scan"
118
]
12-
}
9+
}

0 commit comments

Comments
 (0)