Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
395 changes: 388 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,392 @@
# Claude Code worktrees — these are ephemeral scratch directories created by
# Claude Code during agentic runs and must not be committed to the repository.
# The actions/checkout post-job sweep trips on unregistered git directories
# here and emits exit-128 warnings on every run.
.claude/worktrees/
.claude/scheduled_tasks.lock
# ============================================================================
# petry-projects baseline .gitignore — SECRETS ONLY
# ----------------------------------------------------------------------------
# First layer of defense in the Push Protection Standard
# (standards/push-protection.md). Complements GitHub secret scanning + push
# protection, gitleaks pre-commit hooks, and the CI gitleaks job.
#
# Scope: SECRETS ONLY. This file is intentionally language-agnostic. Put
# build artifacts, OS cruft, and editor swap files in per-repo .gitignores or
# the matching language template from https://github.com/github/gitignore.
#
# Ordering note: keep `!` negations IMMEDIATELY AFTER the broad pattern they
# carve out of. Git evaluates rules top-to-bottom; a later ignore can re-hide
# a previously-negated file. A negation inside an already-ignored directory
# does NOT re-include it — always negate by file, never by directory.
# ============================================================================

# Secret-protection baseline (required by standards/push-protection.md)

# ---------------------------------------------------------------------------
# 1. Dotenv family
# ---------------------------------------------------------------------------
# .env files are the single most common source of leaked credentials on GitHub.
.env
.env.*
.envrc
.env.local
.env.*.local
# Keep committed templates so contributors know which vars to set.
!.env.example
!.env.sample
!.env.template
!.env.*.example
!.env.*.sample
!.env.*.template
# direnv and dotenv-vault artifacts that can contain plaintext values
.direnv/
.envrc.local
.env.vault.keys


# ---------------------------------------------------------------------------
# 2. Cloud provider credential files
# ---------------------------------------------------------------------------
# AWS shared credentials & SSO/CLI token caches (live AccessKey / SessionToken)
.aws/
aws.credentials
aws_credentials
credentials.csv
# GCP service-account JSON keys and Application Default Credentials
gcp-key.json
gcp-service-account*.json
service-account*.json
service_account*.json
application_default_credentials.json
gha-creds-*.json
# Azure CLI profile / MSAL token cache
.azure/
azureProfile.json
azureAuth.json
msal_token_cache.*
# DigitalOcean, Linode, Hetzner, Fly, Vercel, Netlify, Cloudflare
.doctl/
.linode-cli
.hcloud/
.fly/
fly.toml.local
.vercel/
.netlify/
.wrangler/
.cloudflared/


# ---------------------------------------------------------------------------
# 3. Kubernetes / container / Helm secrets
# ---------------------------------------------------------------------------
# kubeconfigs embed bearer tokens and client certs
kubeconfig
kubeconfig.*
*.kubeconfig
.kube/
# Docker registry auth (base64 basic auth for registries)
.docker/config.json
docker-config.json
.dockercfg
# Helm values files that conventionally hold secrets
secrets.yaml
secrets.yml
values.secret.yaml
values.secret.yml
values-secrets.yaml
values-secrets.yml
*.secrets.yaml
*.secrets.yml
# helm-secrets / sops-encrypted values are SAFE to commit — re-allow:
!*.enc.yaml
!*.enc.yml
!secrets.enc.yaml
!secrets.enc.yml
# Skaffold / Tilt local overrides
skaffold.local.yaml
tilt_config.json


# ---------------------------------------------------------------------------
# 4. SSH / TLS / GPG key material
# ---------------------------------------------------------------------------
# Private keys — any common format
*.pem
*.key
*.cer

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The *.cer extension is typically used for public X.509 certificates, not private keys. Since *.crt and *.cert are explicitly allowed (lines 141 and 143), *.cer should be removed from this 'Private keys' section to avoid false positives in projects that include public certificates, remaining consistent with the 'SECRETS ONLY' scope.

*.der
*.p12
*.pfx
*.jks
*.keystore
*.truststore

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

A *.truststore file contains public certificates of trusted Certificate Authorities (CAs) and does not typically contain private keys (which are stored in a keystore). Including it in a 'secrets only' baseline is likely a false-positive that could interfere with Java-based projects that need to distribute custom CA bundles.

id_rsa
id_rsa.*
id_dsa
id_dsa.*
id_ecdsa
id_ecdsa.*
id_ed25519
id_ed25519.*
*_rsa
*_dsa
*_ecdsa
*_ed25519
known_hosts
authorized_keys
Comment on lines +129 to +130

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid ignoring SSH host-policy files

known_hosts and authorized_keys are public policy artifacts (host key pinning and allowed public keys), not secrets; ignoring them makes new/updated copies silently untrackable with normal git add . flows. In infrastructure repos that commit these files for SSH hardening, this can prevent required trust-policy updates from landing and leads to configuration drift across environments.

Useful? React with 👍 / 👎.

# GPG / PGP
*.gpg
*.pgp
*.asc

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Don’t blanket-ignore armored signature files

Ignoring *.asc blocks committing detached OpenPGP signatures and ASCII-armored public key files, which are commonly published with release artifacts to support integrity verification. In repos that distribute signed bundles, this pattern makes those verification assets disappear from normal staging and weakens reproducible release workflows.

Useful? React with 👍 / 👎.

secring.*
# Re-allow common PUBLIC artifacts that legitimately live in repos
!*.pub
!*.pub.pem
!public.pem
!public_key.pem
!*.crt
!ca.crt
!*.cert
Comment on lines +137 to +143

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This block of negations is separated from the patterns they modify (e.g., *.pem on line 108 and *.key on line 109). The 'Ordering note' on lines 12-15 explicitly recommends keeping negations immediately after the broad patterns they carve out of. Following this rule would also help avoid the duplication seen later in the file (e.g., *.enc.yaml is negated both at line 95 and line 343).

# NOTE: *.pem / *.key have HIGH false-positive rates (TLS test fixtures, JWT
# libraries, webpack dev certs). Per-repo .gitignores should `!` specific
# fixture FILES — never negate a whole directory.


# ---------------------------------------------------------------------------
# 5. Terraform / IaC state and variables
# ---------------------------------------------------------------------------
# State files contain plaintext secrets resolved at apply-time
*.tfstate
*.tfstate.*
*.tfstate.backup
crash.log
crash.*.log
# .tfvars routinely hold secrets — block all, allow only examples
*.tfvars
*.tfvars.json
!*.tfvars.example
!*.tfvars.sample
!example.tfvars
# Local .terraform cache
.terraform/
.terraform.lock.hcl.bak
# Pulumi stack configs (often hold encrypted + plaintext values)
Pulumi.*.yaml
!Pulumi.yaml
# Ansible vault password files
vault-password
vault_password
.vault_pass
.vault-password-file


# ---------------------------------------------------------------------------
# 6. Secret manager local caches & key material
# ---------------------------------------------------------------------------
# SOPS / age — private keys are plaintext files
.sops/
sops.agekey
age.key
age-key.txt
keys.txt
# HashiCorp Vault token files
.vault-token
.vault_token
vault-token
# Doppler CLI config (contains service tokens)
.doppler.yaml
.doppler/
doppler.yaml
# 1Password CLI session tokens / service-account tokens
.op/
op-session-*
.1password/
# Infisical, Bitwarden CLI, chamber, envchain, teller
.infisical.json
.bw-session
.chamber
.teller.yml


# ---------------------------------------------------------------------------
# 7. Database dumps and DB client dotfiles
# ---------------------------------------------------------------------------
# Raw dumps frequently contain PII + embedded credentials in CREATE USER stmts
*.sql.gz
*.sql.bz2
*.sql.xz
*.sql.zst
*.dump
*.bak
dump.rdb
mongodump/
# Client config dotfiles that store passwords in plaintext
.pgpass
.my.cnf
.mylogin.cnf
.mongorc.js
.mongoshrc.js
.psqlrc.local
.pg_service.conf


# ---------------------------------------------------------------------------
# 8. Package registry / tooling credential dotfiles
# ---------------------------------------------------------------------------
# Recent supply-chain attacks specifically targeted these files.
.npmrc
.yarnrc
.yarnrc.yml
.pypirc
.gem/credentials
.gem/
.cargo/credentials
.cargo/credentials.toml
.nuget/
nuget.config
NuGet.Config
.m2/settings.xml
.gradle/gradle.properties
gradle-local.properties
.netrc
_netrc
.curlrc
.wgetrc
# GH CLI / Git Credential Manager
.gh-token
gh_token
.git-credentials
.config/gh/hosts.yml
# NOTE: .npmrc / .yarnrc.yml / nuget.config / gradle.properties also hold
# legitimate non-secret config. The safer pattern is to commit a `.npmrc.example`
# and keep the real file ignored. A per-repo override may re-allow a scrubbed
# root file via `!/.npmrc` if absolutely needed.


# ---------------------------------------------------------------------------
# 9. Cloud CLI session / token caches
# ---------------------------------------------------------------------------
# These rarely end up in repos, but when they do they grant live access —
# usually inside a Dockerfile COPY context that swept in a home dir.
.aws/sso/cache/
.aws/cli/cache/
.config/gcloud/
.config/gcloud/application_default_credentials.json
.config/gcloud/legacy_credentials/
.config/gcloud/access_tokens.db
.boto
.s3cfg
.rclone.conf
rclone.conf
.oci/
.ibmcloud/
.snowflake/
.snowsql/config
.databricks/
.databrickscfg


# ---------------------------------------------------------------------------
# 10. IDE files known to cache credentials
# ---------------------------------------------------------------------------
# JetBrains: workspace.xml can cache DB passwords; dataSources.local.xml
# holds per-user DB state. dataSources.xml (no .local) is intended for
# sharing and should not hold passwords — but review before committing.
.idea/workspace.xml
.idea/tasks.xml
.idea/usage.statistics.xml
.idea/shelf/
.idea/dataSources.local.xml
.idea/dataSources/
.idea/sqlDataSources.xml
.idea/dynamic.xml
.idea/**/aws.xml
# VS Code: sftp.json from the popular SFTP extension embeds passwords.
# Block local-variant settings; the shared settings.json stays committable.
.vscode/sftp.json
.vscode/ftp-sync.json
.vscode/settings.local.json
.vscode-server/
# Eclipse secure storage
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.equinox.security*
# Cursor / Windsurf / Zed AI assistant caches (2025+)
.cursor/mcp.json
.cursor-server/
.windsurf/
.zed/settings.json

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This ignores the primary configuration file for the Zed editor. This is inconsistent with the treatment of VS Code (where settings.json is allowed) and prevents teams from sharing project-specific editor settings (e.g., indentation, linting). Unless Zed's settings.json is known to cache credentials (unlike VS Code's), it should be removed from the ignore list.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Stop ignoring committed Zed project settings

Ignoring .zed/settings.json blocks the repository’s project-level Zed configuration from being added, which breaks shared editor behavior (formatting, language overrides, project tasks/remote settings) for teams that intentionally version this file. This turns a normal project config path into an untracked local-only file and can cause inconsistent tooling behavior across contributors.

Useful? React with 👍 / 👎.

# NOTE: do NOT blanket-ignore .idea/ or .vscode/ here — that's a per-repo
# editor-cruft decision, not a secrets decision.


# ---------------------------------------------------------------------------
# 11. Generic "secret" / "credential" / "private" filename conventions
# ---------------------------------------------------------------------------
secrets.json
secrets.toml
secrets.env
secret.yaml
secret.yml
secret.json
credentials
credentials.yaml
credentials.yml
credentials.json
credentials.toml
private.json
private.yaml
private.yml
*.secret
*.secret.*
*.secrets
*.private
*.private.*
# Re-allow obviously-public template variants
!*.secret.example
!*.secrets.example
!secrets.example.*
!credentials.example.*
# Re-allow SOPS/age-encrypted variants (safe to commit)
!*.enc.yaml
!*.enc.yml
!*.enc.json
!*.sops.yaml
!*.sops.yml
!*.sops.json


# ---------------------------------------------------------------------------
# 12. Modern (2024-2026) credential-leak hotspots
# ---------------------------------------------------------------------------
# LLM / AI tooling config files where users paste API keys
.anthropic/
.openai/
.ollama/id_ed25519
.continue/config.json
.aider.conf.yml
.aider.model.settings.yml
# GitHub Copilot local state
.github-copilot/
# Supabase / PlanetScale / Neon / Turso CLI auth
.supabase/
.pscale/
.neon/
.turso/
# Railway / Render / Fly machine tokens
.railway/
.render/
# Stripe CLI, Twilio CLI, SendGrid
.stripe/
.twilio-cli/
# Temporal, Dagger, Earthly auth
.temporalio/
.dagger/
.earthly/config.yml

# ---------------------------------------------------------------------------
# 13. Agent / local worktrees (org coding policy)
# ---------------------------------------------------------------------------
# Temporary worktrees created by Claude Code and other agents. Not strictly
# secret material, but the petry-projects coding guidelines require these
# paths to be ignored in every repo so an agent's scratch worktree cannot
# be committed accidentally.
.claude/worktrees/
.claude/scheduled_tasks.lock
.worktrees/

# ============================================================================
# End of petry-projects secrets baseline
# ============================================================================
Loading