A credential just leaked. Start here.
This guide walks you through the general incident response process for a leaked credential. For provider-specific instructions, find your provider in the playbooks directory.
Critical: Do not assume deletion equals revocation
Deleting a leaked secret from a repository does not invalidate the credential. Assume it may already have been copied and used. You must revoke the credential through the provider's official mechanism, then investigate for unauthorized access.
Stop further exposure
If the credential is in a public repository, do not simply delete the file. The git history still contains it. Use git-filter-repo or BFG Repo Cleaner to purge it from history, then force-push. If it was in a CI/CD log, clear the log.
Deleting a file from a repository does not remove it from git history. Anyone who cloned the repo before deletion may still have the credential.
Identify the credential and provider
Determine exactly which credential was exposed, which provider issued it, and what permissions it grants. The blast radius varies enormously — an AWS root key is very different from a read-only analytics token.
Determine the credential's permissions
Before revoking, understand what the credential can access. This determines the scope of your investigation. A credential with write access to production databases requires a much more thorough investigation than a read-only staging key.
Revoke or rotate using official instructions
Follow the provider-specific playbook. Generic revocation steps may miss critical details — some providers require separate session invalidation, some have grace periods, and some require additional steps to fully terminate access.
Investigate potential unauthorized usage
Review audit logs, API call history, and access patterns for the period the credential was exposed. Look for unusual IP addresses, unexpected resource access, data downloads, or configuration changes.
Review financial and operational impact
Check billing dashboards for unexpected charges. Review resource usage for unauthorized provisioning. For payment APIs, check for fraudulent transactions. Document everything for potential incident reporting.
Update dependent applications
Update all services, CI/CD pipelines, environment variables, and secrets managers with the new credential. Verify each consumer is working correctly with the replacement before proceeding.
Remove the exposed secret from accessible locations
Purge from git history, CI/CD logs, error tracking systems, screenshots, and any other location where the credential may have been captured. Check Slack, email, and documentation tools.
Implement preventive controls
Enable secret scanning, add pre-commit hooks, implement least-privilege access, use a secrets manager, and set up monitoring alerts. Document the incident and share learnings with your team.
Common Mistakes to Avoid
- Deleting the file from the repository without purging git history
- Assuming revocation is immediate when the provider has a grace period
- Forgetting to invalidate derived sessions and temporary tokens
- Not checking all regions or environments for unauthorized activity
- Rotating the key but not updating all consumers, causing service outages
- Not reviewing billing for unexpected charges from the exposure window
Find Your Provider's Playbook
This guide covers the general process. For provider-specific revocation steps, audit log locations, and session invalidation details, use the playbooks below.
Browse all playbooksDisclaimer: This is an educational incident response reference. It does not automatically detect or revoke credentials. Provider behavior may change — always verify critical steps with official provider documentation. This guide does not replace professional incident response or security advice.