{
  "id": 6888920,
  "title": "How to Find Exposed API Keys in Your Git Repository (Before an Attacker Does)",
  "url": "https://urgent.news/2026/09/12/how-to-find-exposed-api-keys-in-your-git-repository-before-an",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-09-12T07:42:01.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/maxxthematepng/how-to-find-exposed-api-keys-in-your-git-repository-before-an-attacker-does-3e70"
  },
  "original_language": "en",
  "account": "Git history can be a graveyard for exposed credentials, as deleted files still reside in every clone. Attackers leverage this knowledge, scanning public repositories continuously. Exposed API keys, tokens, service account credentials, database connection strings, private keys, and OAuth client secrets are some common types. A manual search using grep with specific patterns can help initially, but regex has a high false-positive rate, missing obfuscated or base64-encoded values. Tools like git-secrets, truffleHog, and gitleaks can scan the entire Git history. It's crucial to audit current working trees, full Git history, .env files, and config templates. Remediation involves revoking and rotating the secret before rewriting history, if possible. Preventive measures include pre-commit hooks, push protection, secrets managers, and least-privilege IAM. SOC 2 and HIPAA compliance require continuous secret scanning and evidence of adherence to security rules.",
  "summary": "Why Git History Is a Credential Graveyard Developers move fast. A Stripe secret key gets pasted into .env for a quick test, the file accidentally lands in a commit, someone notices and deletes it, but the damage is already done. Git history is append-only by design. That deleted file still lives in every clone of the repo, readable with a single git log or git show command. The same pattern plays…",
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}