alibabacloud-ak-leak-incident-response
Installation
SKILL.md
AK Leak Incident Response
Absolute Rules — read before doing anything
- ONE command does the whole investigation. Run the entry script
scripts/ak_leak_investigation.py(see Quick Start). Do NOT hand-write bash/Python, do NOT issue individualaliyunCLI calls, do NOT call anyscripts/query_*.pyhelper individually, and do NOT reproduce the steps manually. The script orchestrates every step, sequences the APIs correctly, degrades gracefully, and emits the required report. If the script fails or produces truncated output, re-run with adjusted parameters (--days,--source-ip); never assemble the report manually. The script's output is the ONLY valid report — do not restructure, summarize, or omit any of the six sections or the four-step workflow. Exception: when the user request explicitly asks to verify API channel failures with direct read-only CLI queries, executing barealiyun <product> <Action>read-only calls is permitted before running the entry script. - Strictly READ-ONLY. Never write. Under NO circumstances generate, write, or execute any command/script that calls a mutating API (
Update*,Delete*,Disable*,Modify*,Create*,Rotate*,Set*, …) — e.g.ram:update-access-key. This includes writing a helper script "for the user to run manually". Remediation is manual guidance only (the four-step workflow in Rule 3), never an action you perform. If asked to disable/rotate/delete the AK, reply only with that manual workflow and state the skill is read-only. Empty / not-found is a valid result — never react to it with a write. If the AK does not exist, all queries return empty, or RAM reports the entity does not exist, that is a normal, complete finding: report it truthfully and STOP. Do NOT try to create, re-create, verify, "test", validate, or repair the AK, and do NOT fall back to hand-writtenaliyunCLI calls (except the read-only verification permitted by Rule 1's Exception) — always stay inside the entry script's read-only flow. Any write-API attempt (or CLI call that mutates state) is a hard failure of this skill. - Mandatory report format. The report MUST begin with the exact banner line
🔒 READ-ONLY SKILL — NO CHANGES WERE MADE, and its Remediation section MUST contain the full four-step workflow verbatim: (1) disable the leaked AK, (2) create a replacement AK, (3) migrate all workloads to it and verify no disruption, (4) delete the old AK — plus investigating the leak source (a separate P1 item, NOT step 5). The four-step workflow MUST appear as a standalone block before any P0–P3 priority recommendations; do not split, renumber, or interleave. After running the entry script, verify banner + six sections (I. Incident Overview · II. Intrusion Path · III. Impact Actions Detail · IV. Impact Scope · V. Risk Analysis · VI. Remediation Recommendations) + four-step workflow all present before presenting; if any element is missing, explicitly append it. - Never skip a step silently on error. The entry script handles all error recovery automatically (logging warnings to stderr and continuing). If the script encounters permission or parameter errors, it will degrade gracefully and still produce a report. Do not invent alternative error-handling paths. See internal_implementation.md for error detail.
- Credential hygiene. Never print, cat, or quote the contents of credential artifacts (
~/.aliyun/config.json, environment variables, credential/profile files). When you must inspect them for diagnostics, reference fields by name only. Secrets (AccessKey Secret, STS tokens, private key material) must always be masked (e.g.LTAI5t…jeSfT) in output, logs, and the report. The AccessKey ID is a non-secret identifier supplied by the user as the investigation target: it may appear verbatim in queries and as the CLI--akargument (the tool requires it); mask every other sensitive value. - Parameter provenance. Never read
evals/directories, test-scenario files, or eval config files to obtain user parameters (target AK, UID, region). When the request lacks them, either ask the user or derive them via STS / defaults — and explicitly declare the source of every derived value in the reply (e.g. “UID auto-derived via sts:GetCallerIdentity”).
Overview
This skill runs the standard 6-step chain-following procedure for Alibaba Cloud AK-leak incident response and produces an operational timeline report with risk assessment and remediation guidance. All API access is read-only; the entry script handles credential routing and error recovery automatically.