chore: add repository secret-scanning guardrails#49
Merged
Conversation
Add gitleaks-based secret scanning with a shared config, an opt-in pre-commit hook, and a CI workflow that runs on pull requests and pushes to main. Document the secrets-management convention in deploy/CONVENTIONS.md. The .gitleaks.toml synthetic-credential allowlist is temporary and can be removed once chore/datastore-mcp-eso-secrets migrates those demo creds to ESO. Generated by Coder Agents.
The gitleaks/gitleaks-action@v2 wrapper refuses to run for GitHub organizations without a paid GITLEAKS_LICENSE. Install and run the MIT-licensed gitleaks CLI directly and scan the checked-out tree. Generated by Coder Agents.
Generated by Coder Agents.
…nfig The demo_pg_admin_pw / mcp_ro_demo_pw literals were removed from the tree when the datastore-mcp credentials moved to ESO, so the allowlist is no longer needed. Generated by Coder Agents.
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 repository-wide secret-scanning guardrails. There is currently no
.github/directory or CI in this repo; this introduces gitleaks-based scanning end to end.Changes
.gitleaks.toml(repo root): extends the default gitleaks rule set (useDefault = true) with an allowlist for placeholder/template files (*.example.*,secrets.example.ya?ml, thedocs/tree) and a narrowregexesallowlist for the two synthetic in-cluster demo Postgres literals (demo_pg_admin_pw,mcp_ro_demo_pw)..pre-commit-config.yaml(repo root): a single opt-ingitleakshook (official pre-commit repo, tagv8.21.2). Developers enable it withpre-commit install..github/workflows/secret-scan.yml: GitHub Actions workflow runninggitleaks/gitleaks-action@v2onpull_requestand onpushtomain. Checkout usesfetch-depth: 0;GITLEAKS_ENABLE_UPLOAD_ARTIFACT: falseand no license env since this is a single repo.deploy/CONVENTIONS.md: adds a "Secrets management" section documenting that real secrets live in AWS Secrets Manager underusgov-coderdemo/*, synced to Kubernetes by ESO via IRSA, with placeholders only in*.example.yamland gitleaks running in pre-commit and CI.Note
The
.gitleaks.tomlsynthetic-credential allowlist (demo_pg_admin_pw,mcp_ro_demo_pw) is temporary. It keeps CI green on currentmainwhile those throwaway demo creds still exist. Oncechore/datastore-mcp-eso-secretsmigrates them to ESO and merges, thatregexesentry can be deleted.Generated by Coder Agents, on behalf of @ausbru87.