This repository has multiple layers of protection against accidental credential commits:
- Automatically scans files before commit for potential secrets
- Checks for common patterns: passwords, API keys, tokens
- Prevents commits of dangerous files like
.zmcp.json,.env - Located in
.githooks/pre-commit
To enable: git config core.hooksPath .githooks
Explicitly ignores:
*.zmcp.json- MCP configuration files*.key,*.pem- Private keys.env*- Environment filessecrets/,credentials/- Secret directories
- Gitleaks: Scans for secrets in code and history
- Gosec: Go-specific security analysis
- Dependency scanning: Checks for vulnerable dependencies
- Custom patterns in
.gitleaks.toml - Detects MCP configs, API keys, tokens, passwords
- Allows test/example passwords
-
Immediately rotate the exposed credentials
-
Remove from history:
# Remove file from all history git filter-branch --force --index-filter \ 'git rm --cached --ignore-unmatch PATH_TO_FILE' \ --prune-empty --tag-name-filter cat -- --all # Force push (coordinate with team) git push origin --force --all git push origin --force --tags
-
Contact security team if credentials were exposed publicly
-
Never commit:
- Real passwords, API keys, or tokens
.zmcp.jsonor similar config files- Private keys or certificates
.envfiles with real values
-
Use instead:
- Environment variables
- External secret management
- Example/template files (e.g.,
.env.example) - Placeholder values in docs
-
Before committing:
- Review
git diffcarefully - Check
git statusfor unexpected files - Run
gitleaks detect --staged
- Review
# Install gitleaks
brew install gitleaks
# Scan current directory
gitleaks detect
# Scan staged changes
gitleaks detect --staged
# Scan with custom config
gitleaks detect -c .gitleaks.tomlIf you discover a security vulnerability:
- Do NOT create a public issue
- Email security concerns to [maintainer email]
- Include:
- Description of the vulnerability
- Steps to reproduce
- Potential impact
- Suggested fix (if any)
We perform regular security audits:
- Weekly automated scans via GitHub Actions
- Dependency updates monthly
- Manual review quarterly