alibaba-live-kms-key-mutation-guard
Gate KMS key deletion and disable operations. All data encrypted with a deleted CMK (OSS SSE-KMS, ECS encrypted disks, RDS/PolarDB TDE) becomes permanently and irrecoverably inaccessible. This guard enforces complete CMK dependency audits, deletion window confirmation, and explic
Install
npx skills add https://github.com/VincentChuWaiChow/vanguard-frontier-agentic/tree/master/skills/alibaba/alibaba-live-kms-key-mutation-guard
claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install vincentchuwaichow-vanguard-frontier-agentic@llmmart
git clone https://github.com/VincentChuWaiChow/vanguard-frontier-agentic.git
The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole vincentchuwaichow/vanguard-frontier-agentic collection as a plugin from our marketplace. Git is the plain clone.
Skill manifest
Alibaba Cloud Live KMS Key Mutation Guard
Purpose
Act as the guarded live Alibaba Cloud operator for alibaba-live-kms-key-mutation-guard work. Gate every KMS key deletion and disable operation with a complete CMK dependency audit and explicit operator approval. Treat key deletion as an irreversible, permanent data-access loss event.
When to Use
Use this skill when:
- A KMS CMK (Customer Master Key) deletion is requested or scheduled
- A KMS CMK is being disabled
- A pending key deletion needs to be cancelled
- A key rotation is being configured or triggered
- An operator needs to audit CMK-dependent resources before a key operation
- A key is being re-enabled after a disable operation
When NOT to Use
Do not use this skill when:
- The task is a read-only KMS audit with no mutation intent
- The task involves only alias operations (alias creation/deletion does not affect key availability)
- The task is creating a new CMK (no existing data at risk)
- The task involves envelope encryption key management at the application layer with no KMS API calls
Key State Model
Alibaba Cloud KMS keys have the following states:
- Enabled: Key is active and can be used for encryption/decryption.
- Disabled: Key cannot be used for new encryption or decryption operations. This is reversible — re-enable restores full functionality. Existing encrypted data remains accessible once re-enabled.
- PendingDeletion: Key is scheduled for deletion. The deletion window is 7–30 days (default: 30 days). This can be cancelled during the pending window.
- Deleted: Key has been permanently destroyed. All encrypted data is irrecoverable.
Always recommend disable over deletion when the operator is uncertain about CMK dependencies.
CMK Dependency Categories
Before any key deletion or disable, audit ALL of the following:
- OSS SSE-KMS: Buckets using this CMK for server-side encryption. Objects become inaccessible if the key is deleted.
- ECS Encrypted Disks: System and data disks encrypted with this CMK. Instances cannot decrypt disk data.
- ECS Snapshot Encryption: Snapshots created from encrypted disks using this CMK.
- RDS Transparent Data Encryption (TDE): RDS instances with TDE enabled using this CMK.
- PolarDB TDE: PolarDB clusters with TDE using this CMK.
- SLB/ALB HTTPS Certificates: Certificates stored in KMS used by load balancers.
- Secrets Manager (SSM): Secrets encrypted with this CMK.
Pre-Flight Checklist
Before executing any KMS key mutation, verify all of the following:
- Key identity confirmed — confirm the exact key ID (not alias). Run
aliyun kms DescribeKey --KeyId <KEY_ID>to confirm key metadata, current state, and region. - Active RAM principal confirmed — confirm the identity has
AliyunKMSFullAccessassumed via STS for this specific operation. - CMK dependency audit complete — enumerate all OSS buckets, ECS disks, RDS instances, PolarDB clusters, and SSM secrets using this key. This audit must be complete before any mutation.
- Key state assessed — confirm whether the key is Enabled, Disabled, or already in PendingDeletion state.
- Disable vs. delete decision — if the operator is uncertain about dependencies, recommend disable first. Only proceed to deletion after all dependencies are migrated or confirmed non-critical.
- Deletion window confirmed — if proceeding with deletion, confirm the scheduled deletion window (7–30 days). Default is 30 days.
- Rollback plan — for disable: re-enable is the rollback. For deletion: no rollback after the window expires.
Required Confirmation
The operator must explicitly state all of the following before any mutation is executed:
- "I confirm the key is
<KEY_ID>in region<REGION>in account<ACCOUNT_ID>." - "I have completed the CMK dependency audit and the following dependencies are confirmed:
<list or NONE>." - "I understand that key deletion is permanent after the
<N>-day deletion window and all dependent encrypted data will be irrecoverable." - "I approve this key
<disable / deletion>action." - For deletion: "I confirm all CMK-dependent data has been migrated or is non-critical."
Execution Steps
- Capture pre-change key state:
aliyun kms DescribeKey --KeyId <KEY_ID>. - Enumerate CMK dependencies (see CMK Dependency Categories above).
- Present the planned change, dependency audit results, and deletion window to the operator for explicit approval.
- Execute the mutation:
- Disable key:
aliyun kms DisableKey --KeyId <KEY_ID> - Schedule deletion:
aliyun kms ScheduleKeyDeletion --KeyId <KEY_ID> --PendingWindowInDays <7-30> - Cancel deletion:
aliyun kms CancelKeyDeletion --KeyId <KEY_ID> - Re-enable key:
aliyun kms EnableKey --KeyId <KEY_ID>
- Disable key:
- Confirm new key state:
aliyun kms DescribeKey --KeyId <KEY_ID>.
Rollback Procedure
- Key disable (reversible):
aliyun kms EnableKey --KeyId <KEY_ID>— restores full encryption/decryption capability immediately. - Key scheduled for deletion (reversible during pending window):
aliyun kms CancelKeyDeletion --KeyId <KEY_ID>— cancels the scheduled deletion. Act before the deletion window expires. - Key deleted (NOT reversible): A deleted key cannot be recovered. All data encrypted with this key is permanently inaccessible. Contact Alibaba Cloud Support immediately — there is no recovery path.
Post-Change Verification
- Confirm key state matches expected state:
aliyun kms DescribeKey --KeyId <KEY_ID>. - For disable: verify that applications dependent on this key are gracefully handling the disable state.
- For scheduled deletion: confirm deletion date and set a reminder to cancel if needed.
- Check ActionTrail for the key mutation event.
- Monitor CloudMonitor for any application-level errors indicating unexpected CMK access failures.
Response Shape
- Key ID and region confirmed
- Key status (enabled/disabled/pending-deletion)
- CMK dependency audit (OSS, ECS, RDS, PolarDB using this key)
- Disable vs. delete assessment
- Scheduled deletion window
- Approval status
- Post-action dependency verification
Files (vanguard-frontier-agentic)
-
references
-
official-sources.md 1.8 KB
# Official Sources — Alibaba Cloud Live KMS Key Mutation Guard Authoritative Alibaba Cloud documentation for KMS key lifecycle and CMK dependency operations. ## Core References - **KMS Overview** — https://www.alibabacloud.com/help/en/kms KMS architecture, CMK types (software vs. hardware), key states, and key lifecycle. - **Schedule Key Deletion** — https://www.alibabacloud.com/help/en/kms/user-guide/schedule-key-deletion How to schedule CMK deletion, configure the pending deletion window (7–30 days), and cancel a scheduled deletion. - **Disable and Enable a CMK** — https://www.alibabacloud.com/help/en/kms/user-guide/disable-or-enable-a-cmk Disabling a key without deleting it — reversible operation that prevents new encryption/decryption. - **Key Rotation** — https://www.alibabacloud.com/help/en/kms/user-guide/automatic-key-rotation Automatic and manual key rotation, key version management, and how rotation affects existing encrypted data. - **OSS Server-Side Encryption** — https://www.alibabacloud.com/help/en/oss/user-guide/server-side-encryption How OSS uses KMS CMKs for SSE-KMS, and the dependency between OSS objects and KMS key availability. - **ECS Disk Encryption** — https://www.alibabacloud.com/help/en/ecs/user-guide/encryption-overview ECS disk encryption using KMS CMKs, and the impact of key deletion on encrypted disk access. - **RDS TDE** — https://www.alibabacloud.com/help/en/rds/user-guide/configure-tde-for-an-arn-instance Transparent Data Encryption for RDS using KMS CMKs. - **PolarDB TDE** — https://www.alibabacloud.com/help/en/polardb/user-guide/tde Transparent Data Encryption for PolarDB clusters using KMS CMKs. - **KMS ActionTrail Events** — https://www.alibabacloud.com/help/en/actiontrail Audit logging for KMS key mutations; querying ScheduleKeyDeletion, DisableKey, and EnableKey events. -
workflow-and-output.md 3.7 KB
# Workflow and Output — Alibaba Cloud Live KMS Key Mutation Guard ## Step-by-Step Workflow ### Phase 1: Key Identity and State Confirmation 1. Describe the target key to confirm identity and current state: ``` aliyun kms DescribeKey --KeyId <KEY_ID> ``` 2. Confirm region and account ID match the intended target. 3. Note the key state: `Enabled`, `Disabled`, or `PendingDeletion`. ### Phase 2: CMK Dependency Audit 4. Identify OSS buckets using SSE-KMS with this key ID (check bucket encryption config in OSS console or via API). 5. Identify ECS disks encrypted with this key: - Query ECS disk list filtered by KMS key ID in the console or via: ``` aliyun ecs DescribeDisks --Encrypted true --KMSKeyId <KEY_ID> ``` 6. Identify RDS instances with TDE using this key (check RDS console TDE settings). 7. Identify PolarDB clusters with TDE using this key (check PolarDB console TDE settings). 8. Identify SSM secrets encrypted with this key: ``` aliyun kms ListSecrets ``` Filter results for secrets using the target key ID. ### Phase 3: Disable vs. Delete Assessment 9. If any CMK dependencies are found: recommend **disable** first, not deletion. 10. If the operator proceeds to deletion: confirm all dependent data has been migrated or is confirmed non-critical. 11. Confirm the deletion window (7–30 days, default 30 days). ### Phase 4: Approval Gate 12. Present all evidence to the operator: key ID, current state, dependency audit results, disable vs. delete recommendation, deletion window. 13. Require explicit written approval including acknowledgment that deletion is permanent. 14. Do not proceed until approval is received. ### Phase 5: Execution 15. Execute the approved operation: - Disable key: ``` aliyun kms DisableKey --KeyId <KEY_ID> ``` - Schedule deletion: ``` aliyun kms ScheduleKeyDeletion --KeyId <KEY_ID> --PendingWindowInDays 30 ``` - Cancel deletion (if reversing): ``` aliyun kms CancelKeyDeletion --KeyId <KEY_ID> ``` - Re-enable key: ``` aliyun kms EnableKey --KeyId <KEY_ID> ``` ### Phase 6: Post-Action Verification 16. Confirm new key state: ``` aliyun kms DescribeKey --KeyId <KEY_ID> ``` 17. Check ActionTrail for the mutation event. 18. Monitor CloudMonitor for application-level errors indicating CMK access failures. ## Expected Output Format The agent response for a KMS key mutation operation must include: ``` KEY IDENTITY Key ID: <key-id> Key Alias: <alias or NONE> Region: <region> Account ID: <account-id> Current State: <Enabled / Disabled / PendingDeletion> CMK DEPENDENCY AUDIT OSS SSE-KMS Buckets: [NONE | <bucket names>] ECS Encrypted Disks: [NONE | <disk IDs>] RDS TDE Instances: [NONE | <instance IDs>] PolarDB TDE Clusters: [NONE | <cluster IDs>] SSM Secrets: [NONE | <secret names>] DISABLE vs. DELETE Recommendation: [DISABLE FIRST | PROCEED TO DELETION] Reason: <dependency status or operator decision> DELETION WINDOW Window: <N days (if deletion selected)> Deletion Date: <date or N/A> APPROVAL STATUS Operator: <identity> Approved: [YES / NO / PENDING] Permanent loss acknowledged: [YES / NO] ACTION [BLOCKED — reason] OR [EXECUTING] OR [COMPLETE] ROLLBACK POSTURE [REVERSIBLE — re-enable key or cancel deletion before <date>] OR [NOT REVERSIBLE — deletion window expired; data permanently inaccessible] VERIFICATION Key State Post-Action: <Enabled / Disabled / PendingDeletion> ActionTrail Event: [logged / not yet confirmed] Application Errors: <none detected / <description>> ```
-
-
metadata.json 982 B
{ "id": "alibaba-live-kms-key-mutation-guard", "name": "Alibaba Cloud Live KMS Key Mutation Guard", "version": "0.1.0", "type": "skill", "provider": "alibaba", "harnesses": [ "codex", "copilot", "claude-code", "cursor", "gemini", "kiro" ], "summary": "Gate KMS key deletion and disable operations \u2014 all data encrypted with a deleted CMK becomes permanently and irrecoverably inaccessible.", "source_type": "original", "official_docs": [ "https://www.alibabacloud.com/help/en/kms", "https://www.alibabacloud.com/help/en/kms/user-guide/schedule-key-deletion" ], "last_verified": "2026-05-08", "path": "skills/alibaba/alibaba-live-kms-key-mutation-guard", "author": "github: VincentChuWaiChow", "security_notes": "KMS key deletion is irreversible after pending-deletion window. Key disable immediately prevents all decryption operations. CMK-encrypted data becomes permanently inaccessible when the key is deleted." } -
SKILL.md 6.6 KB
--- name: alibaba-live-kms-key-mutation-guard description: Gate KMS key deletion and disable operations. All data encrypted with a deleted CMK (OSS SSE-KMS, ECS encrypted disks, RDS/PolarDB TDE) becomes permanently and irrecoverably inaccessible. This guard enforces complete CMK dependency audits, deletion window confirmation, and explicit operator approval before any key state mutation. allowed-tools: Read Grep Glob metadata: author: "github: VincentChuWaiChow" version: "0.1.0" updated: "2026-05-08" category: security --- # Alibaba Cloud Live KMS Key Mutation Guard ## Purpose Act as the guarded live Alibaba Cloud operator for alibaba-live-kms-key-mutation-guard work. Gate every KMS key deletion and disable operation with a complete CMK dependency audit and explicit operator approval. Treat key deletion as an irreversible, permanent data-access loss event. ## When to Use Use this skill when: - A KMS CMK (Customer Master Key) deletion is requested or scheduled - A KMS CMK is being disabled - A pending key deletion needs to be cancelled - A key rotation is being configured or triggered - An operator needs to audit CMK-dependent resources before a key operation - A key is being re-enabled after a disable operation ## When NOT to Use Do not use this skill when: - The task is a read-only KMS audit with no mutation intent - The task involves only alias operations (alias creation/deletion does not affect key availability) - The task is creating a new CMK (no existing data at risk) - The task involves envelope encryption key management at the application layer with no KMS API calls ## Key State Model Alibaba Cloud KMS keys have the following states: - **Enabled**: Key is active and can be used for encryption/decryption. - **Disabled**: Key cannot be used for new encryption or decryption operations. **This is reversible** — re-enable restores full functionality. Existing encrypted data remains accessible once re-enabled. - **PendingDeletion**: Key is scheduled for deletion. The deletion window is 7–30 days (default: 30 days). **This can be cancelled** during the pending window. - **Deleted**: Key has been permanently destroyed. **All encrypted data is irrecoverable.** Always recommend disable over deletion when the operator is uncertain about CMK dependencies. ## CMK Dependency Categories Before any key deletion or disable, audit ALL of the following: - **OSS SSE-KMS**: Buckets using this CMK for server-side encryption. Objects become inaccessible if the key is deleted. - **ECS Encrypted Disks**: System and data disks encrypted with this CMK. Instances cannot decrypt disk data. - **ECS Snapshot Encryption**: Snapshots created from encrypted disks using this CMK. - **RDS Transparent Data Encryption (TDE)**: RDS instances with TDE enabled using this CMK. - **PolarDB TDE**: PolarDB clusters with TDE using this CMK. - **SLB/ALB HTTPS Certificates**: Certificates stored in KMS used by load balancers. - **Secrets Manager (SSM)**: Secrets encrypted with this CMK. ## Pre-Flight Checklist Before executing any KMS key mutation, verify all of the following: 1. **Key identity confirmed** — confirm the exact key ID (not alias). Run `aliyun kms DescribeKey --KeyId <KEY_ID>` to confirm key metadata, current state, and region. 2. **Active RAM principal confirmed** — confirm the identity has `AliyunKMSFullAccess` assumed via STS for this specific operation. 3. **CMK dependency audit complete** — enumerate all OSS buckets, ECS disks, RDS instances, PolarDB clusters, and SSM secrets using this key. This audit must be complete before any mutation. 4. **Key state assessed** — confirm whether the key is Enabled, Disabled, or already in PendingDeletion state. 5. **Disable vs. delete decision** — if the operator is uncertain about dependencies, recommend disable first. Only proceed to deletion after all dependencies are migrated or confirmed non-critical. 6. **Deletion window confirmed** — if proceeding with deletion, confirm the scheduled deletion window (7–30 days). Default is 30 days. 7. **Rollback plan** — for disable: re-enable is the rollback. For deletion: no rollback after the window expires. ## Required Confirmation The operator must explicitly state all of the following before any mutation is executed: - "I confirm the key is `<KEY_ID>` in region `<REGION>` in account `<ACCOUNT_ID>`." - "I have completed the CMK dependency audit and the following dependencies are confirmed: `<list or NONE>`." - "I understand that key deletion is permanent after the `<N>`-day deletion window and all dependent encrypted data will be irrecoverable." - "I approve this key `<disable / deletion>` action." - For deletion: "I confirm all CMK-dependent data has been migrated or is non-critical." ## Execution Steps 1. Capture pre-change key state: `aliyun kms DescribeKey --KeyId <KEY_ID>`. 2. Enumerate CMK dependencies (see CMK Dependency Categories above). 3. Present the planned change, dependency audit results, and deletion window to the operator for explicit approval. 4. Execute the mutation: - Disable key: `aliyun kms DisableKey --KeyId <KEY_ID>` - Schedule deletion: `aliyun kms ScheduleKeyDeletion --KeyId <KEY_ID> --PendingWindowInDays <7-30>` - Cancel deletion: `aliyun kms CancelKeyDeletion --KeyId <KEY_ID>` - Re-enable key: `aliyun kms EnableKey --KeyId <KEY_ID>` 5. Confirm new key state: `aliyun kms DescribeKey --KeyId <KEY_ID>`. ## Rollback Procedure - **Key disable** (reversible): `aliyun kms EnableKey --KeyId <KEY_ID>` — restores full encryption/decryption capability immediately. - **Key scheduled for deletion** (reversible during pending window): `aliyun kms CancelKeyDeletion --KeyId <KEY_ID>` — cancels the scheduled deletion. Act before the deletion window expires. - **Key deleted** (NOT reversible): A deleted key cannot be recovered. All data encrypted with this key is permanently inaccessible. Contact Alibaba Cloud Support immediately — there is no recovery path. ## Post-Change Verification 1. Confirm key state matches expected state: `aliyun kms DescribeKey --KeyId <KEY_ID>`. 2. For disable: verify that applications dependent on this key are gracefully handling the disable state. 3. For scheduled deletion: confirm deletion date and set a reminder to cancel if needed. 4. Check ActionTrail for the key mutation event. 5. Monitor CloudMonitor for any application-level errors indicating unexpected CMK access failures. ## Response Shape 1. Key ID and region confirmed 2. Key status (enabled/disabled/pending-deletion) 3. CMK dependency audit (OSS, ECS, RDS, PolarDB using this key) 4. Disable vs. delete assessment 5. Scheduled deletion window 6. Approval status 7. Post-action dependency verification
Comments (0)
Sign in to join the conversation.
Reviews (0)
No reviews yet.
No comments yet.