BAH-5025 | Add TruffleHog secret scanning to CI - #70
Open
vishalkarmalkarthoughtworks wants to merge 2 commits into
Open
BAH-5025 | Add TruffleHog secret scanning to CI#70vishalkarmalkarthoughtworks wants to merge 2 commits into
vishalkarmalkarthoughtworks wants to merge 2 commits into
Conversation
Adds .github/workflows/trufflehog.yml. Runs TruffleHog OSS on pull requests, pushes to the default branch, and weekly over full history. Only credentials verified live against the provider's API fail the job (--results=verified), so vendored test fixtures and .env placeholders are ignored. Both actions are pinned to commit SHAs and the workflow requests only contents: read.
GitHub disables a scheduled workflow in a public repo after 60 days with no repository activity, and the disable applies to the whole workflow, not just the cron trigger. Bahmni/bahmni-api-test-automation and Bahmni/openmrs-module-bedmanagement had already lost Semgrep on every PR this way, and GitHub does not re-enable it when the repo becomes active again. Scanning on pull_request and on push to the default branch is unchanged, and workflow_dispatch stays for an on-demand full scan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
.github/workflows/trufflehog.yml, a TruffleHog OSS secret-scanning workflow. Part of BAH-5025, rolled out identically across the 29 repos tracked by the Repo Security & Practices dashboard.Jira: https://bahmni.atlassian.net/browse/BAH-5025
Why
GitHub native secret scanning and push protection are already enabled here and report 0 open alerts. On the GitHub Free plan that is the ceiling. The two settings that would close the remaining gap are paid:
secret_scanning_non_provider_patterns(generic secrets: database connection strings, private keys, passwords) requires GitHub Team or Enterprise Cloud with Secret Protection.secret_scanning_validity_checks(is the credential actually live?) is documented as available only on GitHub Team or Enterprise with Secret Protection.TruffleHog OSS covers both at no cost, over full git history. It is distinct from the existing CodeQL and Semgrep workflows, which analyse code at HEAD for vulnerable patterns and neither read history nor verify credentials.
Cost and build impact
--results=verifiedmeans only credentials TruffleHog confirmed live against the provider's API fail the job. A full-history scan of all 29 repos found 0 verified secrets, and the 25 unverified matches (vendorednode_modulesfixtures,.envplaceholders, strings inside.jar/.zip/.omodarchives) are ignored by this setting.Test plan
TruffleHog Secret Scanworkflow runs on this PR and completes greensc_actions_pinnedpassing)contents: read(keepssc_token_permissionspassing)