원클릭으로
secret-breach-response
Incident playbook for leaked secrets — detect, revoke, rotate, audit access, notify, post-mortem
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Incident playbook for leaked secrets — detect, revoke, rotate, audit access, notify, post-mortem
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
Scaffold and run batch scoring jobs (CronJob + Parquet output) that reuse the service's model + feature-engineering code without opening the live API
Root-cause a performance alert using sliced metrics + ground-truth
Review cloud costs against budget and identify optimization opportunities
Debug ML inference issues — latency spikes, wrong predictions, event loop blocking
Deploy ML service to EKS with Kustomize overlays and IRSA
Deploy ML service to GKE with Kustomize overlays and Workload Identity
| name | secret-breach-response |
| description | Incident playbook for leaked secrets — detect, revoke, rotate, audit access, notify, post-mortem |
| allowed-tools | ["Read","Grep","Glob","Bash(gitleaks:*)","Bash(git:*)","Bash(aws:*)","Bash(gcloud:*)","Bash(kubectl:*)","Bash(gh:*)"] |
| when_to_use | Use IMMEDIATELY when a credential is found in the repo, logs, or an artifact. Triggered automatically by Agent-SecurityAuditor on any secret scan finding. Manual invocation: 'I leaked an API key', 'secret in git history', 'rotate credentials'. |
| argument-hint | <secret-type> <exposure-scope> |
| arguments | ["secret-type","exposure-scope"] |
| authorization_mode | {"detect":"AUTO","revoke_credential":"STOP","clean_git_history":"STOP","rotate_secret":"STOP"} |
If you are the agent:
[AGENT MODE: STOP]
Operation: Secret breach response
Finding: <secret-type> exposed in <location>
Waiting for: Human confirmation to proceed with rotation
Classify the exposed credential:
| Type | Example pattern | Rotation urgency |
|---|---|---|
| AWS access key | AKIA[0-9A-Z]{16} | P1 — minutes |
| GCP service account JSON | "private_key": "-----BEGIN PRIVATE KEY----- | P1 — minutes |
| GitHub PAT | ghp_[A-Za-z0-9]{36} | P1 — minutes |
| Database password | (variable) | P2 — 1h |
| Internal API key | (variable) | P2 — 1h |
| Signing key | (variable) | P1 — minutes |
| Slack/webhook URL | hooks.slack.com/services/... | P3 — 24h |
Determine exposure scope:
git log origin/main)Output classification to incidents/secret-breach-<YYYY-MM-DD-HHMM>.md.
This phase requires human confirmation. Agent proposes, human executes.
# Delete the access key at the root of the tree
aws iam delete-access-key --access-key-id <AKIA...> --user-name <username>
# OR disable it first if investigation needed:
aws iam update-access-key --access-key-id <AKIA...> --status Inactive --user-name <username>
# Delete the service account key
gcloud iam service-accounts keys delete <KEY_ID> \
--iam-account=<service-account-email>
Determine what the leaked credential could have accessed during its exposure:
# CloudTrail lookup for this access key
aws cloudtrail lookup-events \
--lookup-attributes AttributeKey=AccessKeyId,AttributeValue=<AKIA...> \
--start-time <exposure-start> --end-time <exposure-end>
# Cloud Audit Logs
gcloud logging read 'protoPayload.authenticationInfo.serviceAccountKeyName="<key-id>"' \
--freshness=<exposure-duration>
Save to incidents/secret-breach-<timestamp>/access-audit.md.
Generate replacement via the appropriate secret manager (D-18):
# Update the secret in Secrets Manager (not create a new one — preserves ARN)
aws secretsmanager update-secret \
--secret-id <service-namespace>/<key> \
--secret-string <new-value>
# Add a new version to the existing secret (old version disabled)
echo -n "<new-value>" | gcloud secrets versions add <secret-name> --data-file=-
gcloud secrets versions disable <old-version> --secret=<secret-name>
Restart services that consume the secret (they pick up new version on next pod start):
kubectl rollout restart deployment/<service> -n <namespace>
If the secret was committed to git:
# Option A: git filter-repo (preferred, requires install)
git filter-repo --invert-paths --path <file-with-secret>
# Option B: BFG (alternative)
bfg --delete-files <file-with-secret>
Consequences: rewrites history. All collaborators must re-clone. All open PRs must be rebased. Get team approval first.
Do NOT proceed if the secret was ever in a public repo — assume it was scraped by bots within seconds. Rotation (phase 4) is the only mitigation.
incidents/secret-breach-<timestamp>.md with notification logWithin 48h, open a post-mortem issue with:
Link the post-mortem to any new ADRs and to SECURITY.md updates.
.windsurf/rules/12-security-secrets.md (D-17, D-18, D-19)security-audit (detection)/secret-breach (entry point)ADR-005 (agent behavior + security)