Skip to content

Add comprehensive .gitignore patterns for private keys and credentials#40

Open
Copilot wants to merge 10 commits intomasterfrom
copilot/add-gitignore-for-privkeys
Open

Add comprehensive .gitignore patterns for private keys and credentials#40
Copilot wants to merge 10 commits intomasterfrom
copilot/add-gitignore-for-privkeys

Conversation

Copy link

Copilot AI commented Feb 10, 2026

Existing .gitignore had incomplete coverage for private keys and credentials, with incorrect SSH key patterns (*.id_rsa never matches id_rsa).

Changes

Fixed Patterns

  • SSH keys: *.id_rsaid_rsa, id_ed25519, id_ecdsa (glob was fundamentally broken)
  • Public keys now committable: SSH .pub files, pubring.gpg, public .asc signatures

Added Patterns (70+ new entries)

  • SSH/GPG: Hardware security keys (id_*_sk), GPG private keyrings, secret-only ASC files
  • Cloud: AWS/GCP/Azure credential directories with recursive matching (**/.aws/, **/.gcp/, **/.azure/, **/gcloud/)
  • PKI: PKCS8/PKCS12/SPKI formats, CA bundles, serial files, Apple provisioning profiles
  • Tokens: JWT, bearer, OAuth, access/refresh/API tokens with specific patterns to avoid false positives (e.g., access-token.* not *-token.*)
  • Blockchain: Mnemonics, seed phrases (specific: seed.key, seed.txt, not seed.* which catches seed.sql), wallet files, keystore directories, deployer/signer keys
  • Keystores: Java (.jks), Android (debug.keystore, release.keystore)

Pattern Refinements

  • Specific over broad: **/accounts/*-private*.json not **/accounts/*.json
  • Extension required: privkey.* not privkey* (avoids directory matches)
  • Consolidated: keystore*/ covers both keystore/ and keystores/
  • Removed redundancies: .aws/ already covers .aws/credentials and .aws/config

Example of pattern specificity:

# Ignores sensitive files
seed.key, seed.txt, seed.phrase
eth-private*.key, private-key*.json
access-token.*, bearer-token*

# Allows legitimate files
seed.sql, seed.ts, seed.json
eth-config.json
user-token.json, session-token.txt

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 9 commits February 10, 2026 20:59
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Co-authored-by: Kushmanmb <193178375+Kushmanmb@users.noreply.github.com>
Copilot AI changed the title [WIP] Add comprehensive .gitignore for private keys Add comprehensive .gitignore patterns for private keys and credentials Feb 10, 2026
@Kushmanmb Yaketh (Kushmanmb) marked this pull request as ready for review February 10, 2026 21:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants