chore: harden .gitignore with security-sensitive file patterns - #613
Conversation
Add exclusions for credential files, private keys, environment files, and other sensitive patterns that should never be committed: - .env / .env.* — environment variable files with secrets - *.pem / *.key / *.p12 / *.pfx — TLS/SSL key material - .npmrc / .netrc — package registry and network credentials - *_rsa / *_ed25519 / *_ecdsa — SSH private keys - credentials.json — NemoClaw credential store - DRAFT-*.md — security disclosure drafts - .claude/ — Claude Code worktrees and local agent state Found during a comprehensive git history audit that confirmed no secrets were ever committed, but the lack of these exclusions increases the probability of a future accidental commit.
There was a problem hiding this comment.
Copilot wasn't able to review any files in this pull request.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughUpdates Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
.gitignore (1)
14-14: Consider allowing committed env templates while keeping secrets ignored.Line 14 (
.env.*) also ignores safe templates like.env.example/.env.sample, which teams often commit for onboarding.Suggested `.gitignore` refinement
.env .env.* +!.env.example +!.env.sample🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.gitignore at line 14, The current .gitignore line '.env.*' also blocks safe templates; update the ignore rules so secrets remain ignored but template files are allowed: stop using a broad '.env.*' pattern and instead explicitly ignore runtime/secret files (e.g., .env, .env.local, .env.*.local) while whitelisting common templates by adding negation entries for '.env.example' and '.env.sample' (and any other project-specific template names); modify the .gitignore to reflect these specific ignores and negations so onboarding templates can be committed but secrets remain excluded.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In @.gitignore:
- Line 14: The current .gitignore line '.env.*' also blocks safe templates;
update the ignore rules so secrets remain ignored but template files are
allowed: stop using a broad '.env.*' pattern and instead explicitly ignore
runtime/secret files (e.g., .env, .env.local, .env.*.local) while whitelisting
common templates by adding negation entries for '.env.example' and '.env.sample'
(and any other project-specific template names); modify the .gitignore to
reflect these specific ignores and negations so onboarding templates can be
committed but secrets remain excluded.
…A#613) Add exclusions for credential files, private keys, environment files, and other sensitive patterns that should never be committed: - .env / .env.* — environment variable files with secrets - *.pem / *.key / *.p12 / *.pfx — TLS/SSL key material - .npmrc / .netrc — package registry and network credentials - *_rsa / *_ed25519 / *_ecdsa — SSH private keys - credentials.json — NemoClaw credential store - DRAFT-*.md — security disclosure drafts - .claude/ — Claude Code worktrees and local agent state Found during a comprehensive git history audit that confirmed no secrets were ever committed, but the lack of these exclusions increases the probability of a future accidental commit.
…A#613) Add exclusions for credential files, private keys, environment files, and other sensitive patterns that should never be committed: - .env / .env.* — environment variable files with secrets - *.pem / *.key / *.p12 / *.pfx — TLS/SSL key material - .npmrc / .netrc — package registry and network credentials - *_rsa / *_ed25519 / *_ecdsa — SSH private keys - credentials.json — NemoClaw credential store - DRAFT-*.md — security disclosure drafts - .claude/ — Claude Code worktrees and local agent state Found during a comprehensive git history audit that confirmed no secrets were ever committed, but the lack of these exclusions increases the probability of a future accidental commit.
Summary
Add exclusions for credential files, private keys, environment files, and other sensitive patterns that should never be committed.
Patterns added
.env/.env.**.pem/*.key/*.p12/*.pfx*.jks/*.keystore.npmrc/.netrc*_rsa/*_ed25519/*_ecdsacredentials.jsonDRAFT-*.md.claude/Context
A comprehensive git history audit (399 commits, all branches, reflog, stashes, GitHub Actions logs) confirmed no secrets were ever committed. However the current
.gitignorehas no exclusions for these sensitive file types, increasing the probability of a future accidental commit as the contributor base grows.Test plan
git statusshows no unintended changesSummary by CodeRabbit