feat: add trufflehog secret scanning - #114
Merged
Merged
Conversation
Add trufflehog-based secret scanning at three points, mirroring contentstack/rte-micro-frontend#66: - husky pre-commit and pre-push hooks for local feedback - a Secret Scan GitHub Actions workflow on PRs and pushes to master All three run the same scripts/trufflehog-scan.sh so CI and developer machines cannot drift apart. The script scans the current filesystem (tracked + untracked, non-gitignored files mirrored to a temp tree) rather than git history or the PR diff. Repo-specific deviations from the source PR: - prepare was already "npm run build" for publishing, so husky is chained as "npm run build && (husky || true)" to keep publish and consumer installs working where no git dir exists - lib/ added to the exclude list, as this repo's build output 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 trufflehog-based secret scanning, mirroring contentstack/rte-micro-frontend#66.
What
Secrets are checked at three points, all running the same
scripts/trufflehog-scan.shso CI and developer machines cannot drift apart:.husky/pre-commitgit commit.husky/pre-pushgit push.github/workflows/secret-scan.ymlmasterThe script scans the current filesystem — tracked + untracked non-gitignored files, mirrored into a temp tree — rather than git history or the PR diff. Two consequences worth noting:
.npmrcauth token) are excluded from the scan set, so they cannot fail anyone's hook.The script fails closed: a missing trufflehog binary, a
git/rsyncfailure, or an empty scan set all abort rather than pass, on the principle that an unverifiable tree is not a clean one.Deviations from the source PR
Both are repo-specific, not stylistic:
preparewas alreadynpm run build(needed for publishing this package), so husky is chained asnpm run build && (husky || true)rather than replacing it. The|| truekeepsnpm publishand consumer installs working in checkouts with no git directory.lib/added toscripts/trufflehog-exclude.txt, as it's this repo's build output.Testing
Verified locally against both paths:
no secrets found. The hooks fired on this branch's own commit and push.Note that findings come through as
unverifiedwhen trufflehog can't reach the provider to confirm a key is live; the script still blocks, matching #66 (--results=verified,unknown,unverified). Expect occasional false positives on high-entropy test fixtures —--no-verifyis the escape hatch.The workflow itself is unverified until it runs on this PR; please confirm the Secret Scan check goes green before merging.
Contentstack developers will need
brew install trufflehoglocally, or their commits will be blocked with install instructions.🤖 Generated with Claude Code