Claude Cursor GitHub Copilot Skill

alibaba-live-ram-policy-change-guard

Gate RAM policy/role mutations against the Alibaba Cloud account hierarchy. RAM AdministratorAccess assignment, policy deletion with active STS tokens, and Resource Directory Control Policy changes carry account-wide or org-wide blast radius. This guard enforces blast-radius asse

LLM Mart · 0 points · 0 views 0 listing impressions 0 install-command copies
Virus-scanned Reviewed automatically before listing.

Full trust report

Download vincentchuwaichow-vanguard-frontier-agentic-skills_alibaba_alibaba-live-ram-policy-change-guard-febe32a.zip · 5 KB
Part of vincentchuwaichow/vanguard-frontier-agentic — 293 skills

Install

skills CLI npx skills add https://github.com/VincentChuWaiChow/vanguard-frontier-agentic/tree/master/skills/alibaba/alibaba-live-ram-policy-change-guard
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install vincentchuwaichow-vanguard-frontier-agentic@llmmart
Git 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 RAM Policy Change Guard

Purpose

Act as the guarded live Alibaba Cloud operator for alibaba-live-ram-policy-change-guard work. Gate every RAM policy mutation, role change, and Control Policy modification with explicit blast-radius assessment and authority approval. Treat AdministratorAccess assignment as the highest-risk category — it is account-wide and irreversible without deliberate rollback.

When to Use

Use this skill when:

  • A RAM policy must be created, modified, or deleted
  • A RAM role is being created, deleted, or having policies attached/detached
  • A RAM user is being granted or revoked access to a policy
  • AdministratorAccess or any system policy with broad permissions is being assigned
  • A Resource Directory Control Policy constraint is being created, modified, or deleted for an OU
  • An operator needs to audit the current RAM policy and role inventory before making changes
  • Detecting and remediating over-privileged RAM users, roles, or stale policy attachments

When NOT to Use

Do not use this skill when:

  • The task is a read-only RAM audit with no mutation intent
  • The task involves Kubernetes RBAC within ACK only (no RAM changes)
  • The task is creating a new RAM user with read-only access (low risk, no live-guard required)
  • The task is unrelated to Alibaba Cloud identity and access management

Pre-Flight Checklist

Before executing any RAM mutation, verify all of the following:

  1. Account identity confirmed — explicitly state the target Alibaba Cloud account ID. Confirm via aliyun ram GetAccountAlias or the console.
  2. Active RAM principal confirmed — confirm the identity executing the change and its current policy scope.
  3. Current policy/role inventory captured — list current policies attached to the target user/role before any change using aliyun ram ListPoliciesForRole or aliyun ram ListPoliciesForUser.
  4. Blast-radius assessed — for AdministratorAccess assignment, the blast radius is the entire account. For Control Policy changes, the blast radius is all member accounts in the target OU. Document this explicitly.
  5. Active STS token impact — RAM policy deletion does not invalidate existing STS tokens immediately, but operations using the deleted policy's permissions will fail when the token is next used for that action. List any services or applications known to be using STS tokens derived from the policy being changed.
  6. Change justification documented — the operator must state the business reason, the specific principal(s) affected, and the policy being added or removed.
  7. Rollback plan documented — identify the current policy version or attachment state that will be restored if the change must be reverted.

Required Confirmation

The operator must explicitly state all of the following before any mutation is executed:

  • "I confirm the target account is <ACCOUNT_ID>."
  • "I confirm the principal is <RAM_USER_NAME / ROLE_NAME> and the policy change is <ATTACH/DETACH/CREATE/DELETE> <POLICY_NAME>."
  • "I understand the blast radius of this change: <scope statement>."
  • "I have assessed the active STS token impact and it is <acceptable / none known>."
  • "I approve this RAM change."
  • For AdministratorAccess assignment: "I confirm I have the authority to grant account-wide admin access and this is explicitly required."

Execution Steps

  1. Capture pre-change RAM policy and role inventory snapshot.
  2. Confirm active RAM principal has AliyunRAMFullAccess (assumed via STS for specific change only).
  3. Present the planned change, blast-radius assessment, and STS token impact to the operator for explicit approval.
  4. Execute the mutation via the RAM console or Alibaba Cloud CLI:
    • Attach policy to role: aliyun ram AttachPolicyToRole --PolicyType <System/Custom> --PolicyName <NAME> --RoleName <ROLE>
    • Detach policy from role: aliyun ram DetachPolicyFromRole --PolicyType <System/Custom> --PolicyName <NAME> --RoleName <ROLE>
    • Attach policy to user: aliyun ram AttachPolicyToUser --PolicyType <System/Custom> --PolicyName <NAME> --UserName <USER>
    • Delete custom policy: aliyun ram DeletePolicy --PolicyName <NAME>
    • Create custom policy: aliyun ram CreatePolicy --PolicyName <NAME> --PolicyDocument <DOCUMENT>
  5. Capture post-change inventory snapshot and diff against pre-change snapshot.

Rollback Procedure

  • Policy attachment (reversible): Detach the policy with DetachPolicyFromRole or DetachPolicyFromUser. Effect is immediate.
  • Policy detachment (reversible but risky): Re-attach the policy. If the detachment caused a service lockout, restore it immediately.
  • Policy deletion (NOT reversible): A deleted custom policy cannot be recovered. Re-create the policy from the documented pre-change version. System policies (AliyunXxxAccess) are not deletable.
  • AdministratorAccess assignment (reversible — detach the policy): Detach AdministratorAccess from the principal immediately if granted in error.

Post-Change Verification

  1. Run aliyun ram ListPoliciesForRole --RoleName <ROLE> or aliyun ram ListPoliciesForUser --UserName <USER> — confirm the policy list reflects the intended change.
  2. Test access for the affected principal to verify the change has the expected effect.
  3. Check ActionTrail for the change event: query for EventName containing the mutation operation.
  4. For Control Policy changes, confirm constraint enforcement in Resource Directory console.

Response Shape

  1. Account and RAM principal confirmed
  2. Current policy/role inventory
  3. Proposed change and blast-radius assessment
  4. Active STS token impact
  5. Approval status
  6. Applied change
  7. Post-change access verification
Files (vanguard-frontier-agentic)
  • references
    • official-sources.md 1.8 KB
      # Official Sources — Alibaba Cloud Live RAM Policy Change Guard
      
      Authoritative Alibaba Cloud documentation for RAM policy, role, and access management operations.
      
      ## Core References
      
      - **RAM Overview** — https://www.alibabacloud.com/help/en/ram
        RAM architecture, principals (users, groups, roles), policy types, and trust relationships.
      
      - **Create a Custom Policy** — https://www.alibabacloud.com/help/en/ram/user-guide/create-a-custom-policy
        Policy syntax, version management, and best practices for least-privilege custom policies.
      
      - **Attach a Policy to a RAM Role** — https://www.alibabacloud.com/help/en/ram/user-guide/grant-permissions-to-a-ram-role
        How to attach and detach system and custom policies from RAM roles.
      
      - **STS Overview** — https://www.alibabacloud.com/help/en/ram/user-guide/what-is-sts
        STS token issuance, TTL configuration, and how policy changes affect active STS sessions.
      
      - **RAM Policy Language** — https://www.alibabacloud.com/help/en/ram/user-guide/policy-language
        RAM policy syntax reference, condition operators, and wildcard usage.
      
      - **Resource Directory Overview** — https://www.alibabacloud.com/help/en/resource-management
        Multi-account governance, OU structure, and Control Policy hierarchy.
      
      - **Control Policies** — https://www.alibabacloud.com/help/en/resource-management/user-guide/control-policy-overview
        Creating and managing Control Policies (service control policies) for Resource Directory OUs.
      
      - **ActionTrail Overview** — https://www.alibabacloud.com/help/en/actiontrail
        Audit logging for RAM mutations, event structure, and querying RAM change events.
      
      - **RAM Best Practices** — https://www.alibabacloud.com/help/en/ram/user-guide/ram-best-practices
        Least-privilege guidance, STS over access keys, and role-based access patterns.
      
    • workflow-and-output.md 3.7 KB
      # Workflow and Output — Alibaba Cloud Live RAM Policy Change Guard
      
      ## Step-by-Step Workflow
      
      ### Phase 1: Identity and Scope Confirmation
      
      1. Confirm the active RAM principal and account ID:
         ```
         aliyun ram GetAccountAlias
         aliyun sts GetCallerIdentity
         ```
      2. List current policies attached to the target user or role:
         ```
         aliyun ram ListPoliciesForRole --RoleName <ROLE_NAME>
         aliyun ram ListPoliciesForUser --UserName <USER_NAME>
         ```
      3. Describe the specific policy to be changed:
         ```
         aliyun ram GetPolicy --PolicyType Custom --PolicyName <POLICY_NAME>
         aliyun ram GetPolicyVersion --PolicyType Custom --PolicyName <POLICY_NAME> --VersionId <VERSION_ID>
         ```
      
      ### Phase 2: Blast-Radius Assessment
      
      4. Determine the scope of the change:
         - RAM user/role attachment: single principal affected.
         - AdministratorAccess assignment: entire account affected — highest risk.
         - Control Policy change: all member accounts in the target OU affected.
      5. List all roles and users currently attached to the policy being modified or deleted:
         ```
         aliyun ram ListEntitiesForPolicy --PolicyType Custom --PolicyName <POLICY_NAME>
         ```
      6. Assess active STS tokens: identify services or applications known to use STS tokens derived from the target role or policy.
      
      ### Phase 3: Approval Gate
      
      7. Present all evidence to the operator: account ID, principal, current policy inventory, proposed change, blast-radius assessment, STS token impact.
      8. Require explicit written approval including acknowledgment of blast-radius and STS token impact.
      9. Do not proceed until approval is received.
      
      ### Phase 4: Execution
      
      10. Execute the approved mutation:
          - Attach policy to role:
            ```
            aliyun ram AttachPolicyToRole --PolicyType System --PolicyName AdministratorAccess --RoleName <ROLE>
            ```
          - Detach policy from role:
            ```
            aliyun ram DetachPolicyFromRole --PolicyType Custom --PolicyName <NAME> --RoleName <ROLE>
            ```
          - Delete custom policy (only when no entity is attached):
            ```
            aliyun ram DeletePolicy --PolicyName <NAME>
            ```
          - Create new policy version:
            ```
            aliyun ram CreatePolicyVersion --PolicyName <NAME> --PolicyDocument <DOCUMENT> --SetAsDefault true
            ```
      11. Capture post-change inventory snapshot.
      
      ### Phase 5: Post-Change Verification
      
      12. Confirm policy list reflects intended change:
          ```
          aliyun ram ListPoliciesForRole --RoleName <ROLE_NAME>
          ```
      13. Test access for the affected principal using a read-only operation scoped to the new policy.
      14. Check ActionTrail for the change event: query `ram` service events for the mutation.
      
      ## Expected Output Format
      
      The agent response for a RAM policy change operation must include:
      
      ```
      ACCOUNT IDENTITY
        Account ID:     <account-id>
        Active Principal: <ram-user-arn / role-arn>
      
      POLICY/ROLE INVENTORY
        Target:         <RAM user / role name>
        Current Policies: [list]
      
      PROPOSED CHANGE
        Action:         <ATTACH / DETACH / CREATE / DELETE / VERSION_UPDATE>
        Policy Name:    <policy-name>
        Policy Type:    <System / Custom>
        Blast Radius:   <single principal / entire account / OU scope>
      
      STS TOKEN IMPACT
        Active Sessions: [NONE KNOWN | <description of services at risk>]
        Impact:          [NONE | SERVICES MAY FAIL ON NEXT CALL]
      
      APPROVAL STATUS
        Operator:       <identity>
        Approved:       [YES / NO / PENDING]
        Blast radius acknowledged: [YES / NO]
      
      ACTION
        [BLOCKED — reason] OR [EXECUTING] OR [COMPLETE]
      
      ROLLBACK POSTURE
        [REVERSIBLE — detach policy to restore]
        OR
        [NOT REVERSIBLE — policy deleted; re-creation from backup required]
      
      VERIFICATION
        Post-change policy list: [attached / detached as intended]
        ActionTrail event:       [logged / not yet confirmed]
      ```
      
  • metadata.json 988 B
    {
      "id": "alibaba-live-ram-policy-change-guard",
      "name": "Alibaba Cloud Live RAM Policy Change Guard",
      "version": "0.1.0",
      "type": "skill",
      "provider": "alibaba",
      "harnesses": [
        "codex",
        "copilot",
        "claude-code",
        "cursor",
        "gemini",
        "kiro"
      ],
      "summary": "Gate RAM policy/role mutations \u2014 account-wide blast radius, privilege escalation risk, service breakage from accidental denial.",
      "source_type": "original",
      "official_docs": [
        "https://www.alibabacloud.com/help/en/ram",
        "https://www.alibabacloud.com/help/en/ram/user-guide/create-a-custom-policy"
      ],
      "last_verified": "2026-05-08",
      "path": "skills/alibaba/alibaba-live-ram-policy-change-guard",
      "author": "github: VincentChuWaiChow",
      "security_notes": "RAM policy with AdministratorAccess grants full account-wide control. Removing a RAM role trust policy immediately breaks all cross-account access. STS token revocation affects all active sessions for that role."
    }
    
  • SKILL.md 6.2 KB
    ---
    name: alibaba-live-ram-policy-change-guard
    description: Gate RAM policy/role mutations against the Alibaba Cloud account hierarchy. RAM AdministratorAccess assignment, policy deletion with active STS tokens, and Resource Directory Control Policy changes carry account-wide or org-wide blast radius. This guard enforces blast-radius assessment, STS token impact analysis, and explicit authority approval before any policy mutation is executed.
    allowed-tools: Read Grep Glob
    metadata:
      author: "github: VincentChuWaiChow"
      version: "0.1.0"
      updated: "2026-05-08"
      category: security
    ---
    
    # Alibaba Cloud Live RAM Policy Change Guard
    
    ## Purpose
    
    Act as the guarded live Alibaba Cloud operator for alibaba-live-ram-policy-change-guard work. Gate every RAM policy mutation, role change, and Control Policy modification with explicit blast-radius assessment and authority approval. Treat AdministratorAccess assignment as the highest-risk category — it is account-wide and irreversible without deliberate rollback.
    
    ## When to Use
    
    Use this skill when:
    
    - A RAM policy must be created, modified, or deleted
    - A RAM role is being created, deleted, or having policies attached/detached
    - A RAM user is being granted or revoked access to a policy
    - AdministratorAccess or any system policy with broad permissions is being assigned
    - A Resource Directory Control Policy constraint is being created, modified, or deleted for an OU
    - An operator needs to audit the current RAM policy and role inventory before making changes
    - Detecting and remediating over-privileged RAM users, roles, or stale policy attachments
    
    ## When NOT to Use
    
    Do not use this skill when:
    
    - The task is a read-only RAM audit with no mutation intent
    - The task involves Kubernetes RBAC within ACK only (no RAM changes)
    - The task is creating a new RAM user with read-only access (low risk, no live-guard required)
    - The task is unrelated to Alibaba Cloud identity and access management
    
    ## Pre-Flight Checklist
    
    Before executing any RAM mutation, verify all of the following:
    
    1. **Account identity confirmed** — explicitly state the target Alibaba Cloud account ID. Confirm via `aliyun ram GetAccountAlias` or the console.
    2. **Active RAM principal confirmed** — confirm the identity executing the change and its current policy scope.
    3. **Current policy/role inventory captured** — list current policies attached to the target user/role before any change using `aliyun ram ListPoliciesForRole` or `aliyun ram ListPoliciesForUser`.
    4. **Blast-radius assessed** — for AdministratorAccess assignment, the blast radius is the entire account. For Control Policy changes, the blast radius is all member accounts in the target OU. Document this explicitly.
    5. **Active STS token impact** — RAM policy deletion does not invalidate existing STS tokens immediately, but operations using the deleted policy's permissions will fail when the token is next used for that action. List any services or applications known to be using STS tokens derived from the policy being changed.
    6. **Change justification documented** — the operator must state the business reason, the specific principal(s) affected, and the policy being added or removed.
    7. **Rollback plan documented** — identify the current policy version or attachment state that will be restored if the change must be reverted.
    
    ## Required Confirmation
    
    The operator must explicitly state all of the following before any mutation is executed:
    
    - "I confirm the target account is `<ACCOUNT_ID>`."
    - "I confirm the principal is `<RAM_USER_NAME / ROLE_NAME>` and the policy change is `<ATTACH/DETACH/CREATE/DELETE> <POLICY_NAME>`."
    - "I understand the blast radius of this change: `<scope statement>`."
    - "I have assessed the active STS token impact and it is `<acceptable / none known>`."
    - "I approve this RAM change."
    - For AdministratorAccess assignment: "I confirm I have the authority to grant account-wide admin access and this is explicitly required."
    
    ## Execution Steps
    
    1. Capture pre-change RAM policy and role inventory snapshot.
    2. Confirm active RAM principal has `AliyunRAMFullAccess` (assumed via STS for specific change only).
    3. Present the planned change, blast-radius assessment, and STS token impact to the operator for explicit approval.
    4. Execute the mutation via the RAM console or Alibaba Cloud CLI:
       - Attach policy to role: `aliyun ram AttachPolicyToRole --PolicyType <System/Custom> --PolicyName <NAME> --RoleName <ROLE>`
       - Detach policy from role: `aliyun ram DetachPolicyFromRole --PolicyType <System/Custom> --PolicyName <NAME> --RoleName <ROLE>`
       - Attach policy to user: `aliyun ram AttachPolicyToUser --PolicyType <System/Custom> --PolicyName <NAME> --UserName <USER>`
       - Delete custom policy: `aliyun ram DeletePolicy --PolicyName <NAME>`
       - Create custom policy: `aliyun ram CreatePolicy --PolicyName <NAME> --PolicyDocument <DOCUMENT>`
    5. Capture post-change inventory snapshot and diff against pre-change snapshot.
    
    ## Rollback Procedure
    
    - **Policy attachment** (reversible): Detach the policy with `DetachPolicyFromRole` or `DetachPolicyFromUser`. Effect is immediate.
    - **Policy detachment** (reversible but risky): Re-attach the policy. If the detachment caused a service lockout, restore it immediately.
    - **Policy deletion** (NOT reversible): A deleted custom policy cannot be recovered. Re-create the policy from the documented pre-change version. System policies (AliyunXxxAccess) are not deletable.
    - **AdministratorAccess assignment** (reversible — detach the policy): Detach `AdministratorAccess` from the principal immediately if granted in error.
    
    ## Post-Change Verification
    
    1. Run `aliyun ram ListPoliciesForRole --RoleName <ROLE>` or `aliyun ram ListPoliciesForUser --UserName <USER>` — confirm the policy list reflects the intended change.
    2. Test access for the affected principal to verify the change has the expected effect.
    3. Check ActionTrail for the change event: query for `EventName` containing the mutation operation.
    4. For Control Policy changes, confirm constraint enforcement in Resource Directory console.
    
    ## Response Shape
    
    1. Account and RAM principal confirmed
    2. Current policy/role inventory
    3. Proposed change and blast-radius assessment
    4. Active STS token impact
    5. Approval status
    6. Applied change
    7. Post-change access verification
    

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.

Related