-
Notifications
You must be signed in to change notification settings - Fork 1
PDP-684 Add TruffleHog secret scanning workflow for PR validation #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Introduces a centralized GitHub Actions workflow for scanning pull requests for secrets using TruffleHog. Includes a detailed README with setup instructions, exclusion pattern configuration, override options, and troubleshooting guidance.
The workflow now posts PR comments with secret scan findings, sets commit status to pass/fail, and provides clearer merge blocking. Documentation was updated and renamed to trufflehog_readme.md to reflect new features, including secret classification and improved fork PR support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR introduces a centralized TruffleHog secret scanning workflow that automatically validates pull requests across the organization by detecting exposed secrets such as API keys, passwords, and tokens. The workflow runs on all PRs, posts detailed findings as comments when secrets are detected, and sets commit statuses to block merges when necessary.
Key Changes:
- Implements GitHub Actions workflow with dual triggers (
pull_requestandpull_request_target) to handle both same-repo and fork PRs - Configurable exclusion patterns via
TRUFFLEHOG_EXCLUDESvariable with org-level defaults and repo-level overrides - Automated PR commenting with remediation steps and commit status updates based on scan results
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
trufflehog_readme.md |
Comprehensive documentation covering setup, configuration, exclusion patterns, workflow triggers, and troubleshooting |
.github/workflows/trufflehog-scan.yml |
GitHub Actions workflow implementing secret scanning with TruffleHog, exclusion handling, result processing, and PR status updates |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adds a workflow step to update the PR comment when previously detected secrets are resolved, marking the PR as clear. Updates documentation to clarify that exclusion patterns are additive, describes the new comment update behavior, and improves the remediation and PR comment sections for clarity.
…lved. (#18) * PDP-684: updated the workflow for updating the pullrequest comment * PDP-684: Updated to update the comment
PDP-684 : updated workflow for handling renamed files
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml for detecting the renamed files
PDP-684 : Update trufflehog-scan.yml for detecting the renamed files
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684 : Update trufflehog-scan.yml
PDP-684: updated workflow to checkout only head commit
… into brijesh-dev
PDP-684 : Updated the workflow to fetch right commit
PDP-684 : Reverting my changes for trufflehog
Summary
Introduces a centralized TruffleHog secret scanning workflow that automatically scans all pull requests for exposed secrets (API keys, passwords, tokens, etc.) across the organization.
This implementation:
Features
How It Works
Configuration
TRUFFLEHOG_EXCLUDESvariable at org or repo level for custom exclusionsTested here:
https://github.com/marklogic/copyrighttest/pull/79
https://github.com/marklogic/copyrighttest/pull/78
https://github.com/marklogic/copyrighttest/pull/77