Incident Response
Remediate a Leaked Repository Secret
A leaked credential is revoked, misuse is investigated, dependent services are safely updated, and recurrence is reduced.
The process
Work it in this order.
- Open an incident and identify the secret type, provider, repository, exposure path, visibility, commit history, forks, logs, and affected owner without copying the value into tickets or chat.
- Revoke or disable the exposed secret at the issuing provider immediately; do not rely on deleting the commit because prior copies may persist.
- Create a replacement with minimum permissions and appropriate expiry, update approved secret stores and dependent services, then verify operation.
- Review provider, repository, CI, cloud, and application logs for use from the earliest plausible exposure through revocation, and escalate suspicious activity.
- Remove the secret from current code and configuration; decide with repository administrators whether history rewriting is necessary and coordinate its disruptive effects.
- Add secret scanning, push protection, ignore rules with review, and safer injection patterns; search authorized related repositories for the same exposure.
- Document timeline, impact, rotations, evidence, and prevention actions, then close only after the old credential is unusable and services use the replacement.
Bring this
Inputs the cat will ask for.
- Secret-scanning alert or repository reference
- Credential provider and owner
- Authorized repository and provider access
- Dependent service list
Router + one playbook
Route first. Choose one.
Cat Paw loads one playbook per task rather than merging several. Start with this router; the remaining paths are workflow-specific candidates it can inspect.
- Router:
cybersecurity-pack skills/cybersecurity-skills/implementing-secret-scanning-with-gitleaks/SKILL.mdskills/cybersecurity-skills/implementing-secrets-scanning-in-ci-cd/SKILL.md
Guardrails
The boundaries travel with the prompt.
- Never paste, print, transmit, or store the secret value in reports or conversation.
- Treat the credential as compromised and revoke it before repository cleanup.
- Coordinate history rewrites and production rotations with owners; do not break consumers or erase forensic evidence.
Done means
A checkable finish.
The leaked credential fails validation, all known consumers use a least-privilege replacement, misuse review is documented, and preventive scanning or controls are active.
Sources
Where this process came from.
- docs.github.com/en/code-security/tutorials/remediate-leaked-secrets/remediating-a-leaked-secret
- docs.github.com/en/code-security/concepts/secret-security/secret-scanning
Sources establish the workflow pattern. Reddit and community posts, where present, are treated as practitioner anecdotes rather than universal facts.