Repository navigation
security(repo): enable secret scanning and push protection (#485) - #640
Open
michealross wants to merge 4 commits into
Open
michealross wants to merge 4 commits into
michealross wants to merge 4 commits into
Conversation
…Issue#485) GitHub's secret-protection features live in the repository settings, not in the tree, so this change adds the in-repo half of the protection plus the tooling that makes the settings verifiable and reproducible: - .github/workflows/secret-scan.yml: gitleaks gate on pushes to main and on incoming pull requests. Pinned release verified against the published checksum, always run with --redact, and the SARIF result is uploaded to code scanning so findings show up in the Security tab. - .gitleaks.toml: default gitleaks rules with a minimal allowlist for the values in this repo that look like credentials but are not (Stellar contract IDs, account IDs and SHA-256 hashes in fixtures, mainnet artifacts and demo traces). The allowlist pairs file paths with value shapes, so a real credential in those files does not match it and still fails the job. - scripts/check-secret-protection.mjs: reads, and with --enable turns on, secret_scanning, secret_scanning_push_protection, secret_scanning_non_provider_patterns and secret_scanning_validity_checks through the GitHub API. It reports every protection and exits non-zero when a required one is off or not reported at all; optional protections the plan does not offer are reported as not available instead of failing. - scripts/check-secret-protection.test.mjs: unit tests against a fake API server (enabled, disabled, unavailable, unreadable, enable flow). - docs/SECRET_PROTECTION.md: the settings, how to enable and verify them, what each one covers for main and incoming pull requests, and how to review alerts without posting secret values. The settings themselves need Administration: write on the repository, which a contributor token does not have, so a maintainer runs `pnpm secrets:enable` and then `pnpm secrets:check` to confirm the state. The initial scan of the full history (402 commits) with these rules found no credential: the only matches were generic-api-key hits on public, non-secret values, all of them allowlisted in .gitleaks.toml. No rotation and no history rewrite are needed, and no secret value is reproduced here. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
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.
Fixes #485