Repository navigation
ci: scan pull requests for committed secrets with gitleaks (#224) - #245
Conversation
…otocol#224) Add a Secret Scan workflow that runs the gitleaks CLI (pinned 8.28.0, checksum-verified) over each PR's commit range and fails on findings. .gitleaks.toml extends the default rules with a Stellar secret-seed rule and documents a narrow allowlist (placeholder seeds, a known testnet vector in examples/, public G... account IDs, one bundle false positive). CONTRIBUTING.md says what to do when it fires. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@fernando-mendoza one more thing on this PR, unrelated to the gitleaks setup itself: the gitleaks scan (running it locally against full history, not just this PR's diff) turned up a real Stellar secret seed committed in Do you recognize this account? If it's one of ours, please rotate it. If it's not, no action needed on our end - just flagging since it's sitting in our git history either way. (Marked |
Eras256
left a comment
There was a problem hiding this comment.
Checks green, scoped to its own issue, no touch on auth/secrets/CORS. Merging.
What
Adds a Secret Scan workflow that runs gitleaks on every pull request into
mainand fails the check when it finds a key..github/workflows/secret-scan.yml:pull_request→main,permissions: contents: read,actions/checkout@v7withfetch-depth: 0..gitleaks.toml: gitleaks' default rules plus astellar-secret-seedrule (S+ 55 base32 chars), which the defaults don't cover. Every allowlist entry is narrow and commented.CONTRIBUTING.md: one line saying what to do when the check fires (rotate, remove from the branch, or add a narrow commented allowlist entry for a real false positive).Why / design choices
gitleaks/gitleaks-action. The action needs a paidGITLEAKS_LICENSEfor repos owned by an organization. The workflow downloads gitleaks 8.28.0 and checks its SHA-256 before running it.base.sha..head.sha), so old history doesn't block new PRs. Rewriting history is out of scope, per the issue.SXXXX…placeholder seed in the docsexamples/only, the one published testnet test vector inexamples/rust-x402/tests/integration.rs. Any other seed inexamples/still fails.G…account IDs, which the defaultgeneric-api-keyrule flags in test fixtures. AG…strkey is always public.hasV2Preconditions) inactions/verify-audit-cid/dist/index.js. It requires both the path and the value to match.targetRulesfor extended default rules, so theG…entry is global.How tested
gitleaks diron the currentmaintree with this config: no leaks found. Without the config, it finds 12, all of them false positives covered above.gitleaks gitover the full history: one finding, a Stellar seed inpackages/cli/test/pay-serve.test.jsadded in050104e. It has since been removed from the tree. PR-range scans don't see it, but I'm flagging it here.examples/, a new random seed insideexamples/, an RSA private key, the allowlisted test vector outsideexamples/,hasV2Preconditionsoutsidedist/, a GitHub PAT insideexamples/G…address, the test vector insideexamples/actionlint1.7.7: clean.stellar-secret-seedandaws-access-tokeninpackages/sdk/tmp/leak.envand exited 1.To make this actually block merges,
Secret Scan / gitleaksneeds to be added as a required status check in branch protection. That's a maintainer setting.Closes #224