fix(#429): prevent API keys from being committed via map-codebase
Defense-in-depth approach: Layer 1 - Prevention: - Add <forbidden_files> section to gsd-codebase-mapper agent - Explicitly prohibit reading .env, credentials, keys, secrets - Agent can note file existence but never quote contents Layer 2 - Detection: - Add scan_for_secrets step before commit in map-codebase workflow - Regex patterns catch: sk-*, ghp_*, AKIA*, xox*-*, JWTs, private keys - Halts with alert if secrets detected, requires user confirmation Layer 3 - Documentation: - Add Security section to README - Document Claude Code deny rules for sensitive files - Recommend defense-in-depth approach Closes #429 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
31
README.md
31
README.md
@@ -545,6 +545,37 @@ At milestone completion, GSD offers squash merge (recommended) or merge with his
|
||||
|
||||
---
|
||||
|
||||
## Security
|
||||
|
||||
### Protecting Sensitive Files
|
||||
|
||||
GSD's codebase mapping and analysis commands read files to understand your project. **Protect files containing secrets** by adding them to Claude Code's deny list:
|
||||
|
||||
1. Open Claude Code settings (`.claude/settings.json` or global)
|
||||
2. Add sensitive file patterns to the deny list:
|
||||
|
||||
```json
|
||||
{
|
||||
"permissions": {
|
||||
"deny": [
|
||||
"Read(.env)",
|
||||
"Read(.env.*)",
|
||||
"Read(**/secrets/*)",
|
||||
"Read(**/*credential*)",
|
||||
"Read(**/*.pem)",
|
||||
"Read(**/*.key)"
|
||||
]
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
This prevents Claude from reading these files entirely, regardless of what commands you run.
|
||||
|
||||
> [!IMPORTANT]
|
||||
> GSD includes built-in protections against committing secrets, but defense-in-depth is best practice. Deny read access to sensitive files as a first line of defense.
|
||||
|
||||
---
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
**Commands not found after install?**
|
||||
|
||||
Reference in New Issue
Block a user