Secrets committed to a git repository
A secret committed to git — an API key, a database URL, a token — lives in the repository history forever, and is scraped by bots the moment a repo is public.
Why it matters
Deleting the line in a later commit does nothing: the secret is still in history and has likely already been copied. It must be rotated, not just removed.
Leaked cloud keys are used within minutes, often to mine cryptocurrency on your bill or pivot into your account.
How to check for it
- Scan the working tree and full history with a secret scanner (gitleaks, TruffleHog).
- Check CI logs and config files, which are a common place for keys to slip in.
How to fix it
- Rotate every exposed secret immediately — assume it's compromised.
- Remove it from history (git filter-repo or BFG) and add a pre-commit secret scan so it can't happen again.
- Move secrets to a manager (Secrets Manager, Vault) and reference them, never commit them.
SkyShield checks this automatically
Connect your AWS, Cloudflare, GitHub, GitLab, Hetzner or DigitalOcean account read-only and SkyShield flags this across every account and region, with the fix in plain words — alongside the agent that watches your servers. Start free.