Alibaba live kms key mutation guard

From VincentChuWaiChow/vanguard-frontier-agentic · View interactive version

Alibaba live kms key mutation guard is an AI agent skill from the GitHub repository VincentChuWaiChow/vanguard-frontier-agentic. 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

How to use this skill

Skill file

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:

When NOT to Use

Do not use this skill when:

Key State Model

Alibaba Cloud KMS keys have the following states:

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:

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:

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:
  1. Confirm new key state: aliyun kms DescribeKey --KeyId <KEY_ID>.

Rollback Procedure

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
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.