feat: add trufflehog secret scanning (hooks + CI) - #39
Merged
Conversation
Adds filesystem secret scanning with trufflehog, wired identically into local git hooks and CI so the two cannot drift apart: - scripts/trufflehog-scan.sh: shared scan script. Scans the current filesystem (tracked + untracked, non-gitignored files mirrored into a temp tree), never git history. Treats a scan it cannot complete as a failure rather than a pass. - .husky/pre-commit and .husky/pre-push run that script locally. - .github/workflows/secret-scan.yml runs it on PRs and pushes to main. - scripts/trufflehog-exclude.txt: excluded paths. Mirrors contentstack/rte-micro-frontend#66. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
vivekcontentstack
approved these changes
Aug 13, 2026
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.
Adds filesystem secret scanning with trufflehog, wired identically into local git hooks and CI so the two cannot drift apart. Mirrors contentstack/rte-micro-frontend#66.
What's included
scripts/trufflehog-scan.sh— the shared scan script. Scans the current filesystem (tracked + untracked, non-gitignored files mirrored into a temp tree), never git history. Mirroring means gitignored local files such as an.npmrcauth token can't fail the hook. It fails closed: an empty scan set, a missingtrufflehog, or a broken scan all block rather than pass..husky/pre-commitand.husky/pre-push— run that script locally.huskyadded as a devDependency with"prepare": "husky"..github/workflows/secret-scan.yml— runs the same script on PRs and pushes tomain. Scans the whole checked-out tree rather than the PR diff: a secret already on the branch is a leak regardless of which commit introduced it.scripts/trufflehog-exclude.txt— excluded paths (node_modules/,dist/,build/,coverage/,package-lock.json,.npmrc).Difference from the reference PR: the CI
pushtrigger targetsmain, this repo's default branch, rather thanmaster.Testing
Verified locally with trufflehog 3.96.0:
no secrets found, exit 0potential secrets found. Aborted., exit 1git commitwith that file stagedgit pushNote for reviewers
Developers need trufflehog installed locally (
brew install trufflehog) or the hooks will block with install instructions.package-lock.jsonalso carries some npm-generated churn beyond thehuskyentry, from regenerating against the current tree.🤖 Generated with Claude Code