Skip to content

BAH-5025 | Add TruffleHog secret scanning to CI - #70

Open
vishalkarmalkarthoughtworks wants to merge 2 commits into
masterfrom
BAH-5025
Open

BAH-5025 | Add TruffleHog secret scanning to CI#70
vishalkarmalkarthoughtworks wants to merge 2 commits into
masterfrom
BAH-5025

Conversation

@vishalkarmalkarthoughtworks

Copy link
Copy Markdown

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

  • $0. This repo is public, and GitHub Actions on standard runners is free for public repositories. No account or token needed; the scan runs on the runner.
  • Own parallel workflow, so nothing is added to the critical path.
  • --results=verified means 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 (vendored node_modules fixtures, .env placeholders, strings inside .jar/.zip/.omod archives) are ignored by this setting.
  • Not wired into required-status-checks, so it cannot block a merge.

Test plan

  • TruffleHog Secret Scan workflow runs on this PR and completes green
  • Both actions are pinned to commit SHAs (keeps sc_actions_pinned passing)
  • Workflow declares only contents: read (keeps sc_token_permissions passing)

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant