Xpersona
A

Alibabacloud Ram Permission Diagnose

CLAWHUB · Unverified

Alibaba Cloud RAM permission diagnosis and repair assistant. When an agent encounters any permission-related error while operating Alibaba Cloud resources (4...

62
Rank
84
Safety
1.0k
Downloads

About

What it does, and when to use it.

Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.

Avoid when

  • Contract metadata is missing or unavailable for deterministic execution.

Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing

Install and run

Setup complexity: low.

clawhub skill install s173swjet2yrebzqrp6hjkvmy583mxef:alibabacloud-ram-permission-diagnose
  1. Install using `clawhub skill install s173swjet2yrebzqrp6hjkvmy583mxef:alibabacloud-ram-permission-diagnose` in an isolated environment before connecting it to live workloads.
  2. No published capability contract is available yet, so validate auth and request/response behavior manually.
  3. Review the upstream CLAWHUB listing at https://clawhub.ai/sdk-team/alibabacloud-ram-permission-diagnose before using production credentials.

Contract: missing

curl -s "https://www.xpersona.co/api/v1/agents/clawhub-sdk-team-alibabacloud-ram-permission-diagnose/snapshot"

Run-check

$0.02 USD

1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.

Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.

Documentation

CLAWHUB

74,499 characters of source documentation, loaded on request.

Extracted files

5 files captured from the source.

SKILL.md

---
name: alibabacloud-ram-permission-diagnose
description: >
  Alibaba Cloud RAM permission diagnosis and repair assistant. When an agent encounters
  any permission-related error while operating Alibaba Cloud resources (403, NoPermission,
  Forbidden, AccessDenied, InvalidSecurityToken, etc.), or when the user describes an
  Alibaba Cloud RAM permission issue, use this skill immediately. Do not wait for the user
  to explicitly request it — proactively start the diagnostic process whenever a permission
  error appears. Also applies when: a developer encounters permission issues while writing
  Alibaba Cloud SDK code, the user asks how to configure minimum permissions for an operation,
  or the user wants to know which permissions the current identity is missing.
compatibility:
  tools:
    - Bash  # for executing aliyun CLI commands (aliyun RAM series commands)
---

# RAM Permission Diagnosis and Repair

## Installation

**Pre-check: Aliyun CLI >= 3.3.3 required**
> Run `aliyun version` to verify >= 3.3.3. If not installed or version too low,
> run `curl -fsSL https://aliyuncli.alicdn.com/setup.sh | bash` to update,
> or see `references/cli-installation-guide.md` for installation instructions.

**Pre-check: Aliyun CLI plugin update required**
> [MUST] run `aliyun configure set --auto-plugin-install true` to enable automatic plugin installation.
> [MUST] run `aliyun plugin update` to ensure that any existing plugins are always up-to-date.

At the **start** of the Core Workflow (before any CLI invocation):
**[MUST] Enable AI-Mode** — AI-mode is required for Agent Skill execution.
Run the following commands before any CLI invocation:
```bash
aliyun configure ai-mode enable
aliyun configure ai-mode set-user-agent --user-agent "AlibabaCloud-Agent-Skills/alibabacloud-ram-permission-diagnose"
```
**[MUST] Disable AI-Mode at EVERY exit point** — Before delivering the final response for ANY reason, always disable AI-mode first. This applies to ALL exit paths: workflow success, workflow failure, error/exception, user cancellation, session end, or any other scenario where no further CLI commands will be executed.
AI-mode is only used for Agent Skill invocation scenarios and MUST NOT remain enabled after the skill stops running.
```bash
aliyun configure ai-mode disable
```

**[MUST] CLI User-Agent** — Every `aliyun` CLI command invocation must include:
`--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ram-permission-diagnose`

> **Execution constraint**: When executing `aliyun` CLI commands directly (not generating commands for the user to copy), always append `--user-agent AlibabaCloud-Agent-Skills/alibabacloud-ram-permission-diagnose`. Do not add this flag to commands shown to users in Path B output or Path C console guidance.

## Overview

When a RAM permission error is detected, run through these steps:

1. **Quick Analysis** — parse raw error fields (no tool calls), output a brief summary, ask the user to choose analysis depth
2. **Deep Analysis** 

_meta.json

{
  "ownerId": "kn74p5w8ywv6prh40g0s82gmqh83nw54",
  "slug": "alibabacloud-ram-permission-diagnose",
  "version": "0.0.2",
  "publishedAt": 1777254061399
}

references/diagnose-flow.md

# Diagnose Flow Reference

Detailed decision logic for RAM permission diagnosis. Consult this file when encountering complex or ambiguous scenarios.

---

## Identity Resolution

`AuthPrincipalType` and `AuthPrincipalDisplayName` are available in the raw error's `AccessDeniedDetail` — no decode needed. Resolve UserName before gap analysis when identity type is `SubUser`:

| `AuthPrincipalType` | `AuthPrincipalDisplayName` format | Resolution |
|---------------------|----------------------------------|------------|
| `SubUser` | Numeric UserId (e.g., `206007273725819551`) | Call `aliyun ims get-user --user-id <DisplayName>`, use returned `User.UserName` |
| `AssumedRoleUser` | `roleName:sessionName` (e.g., `my-role:session-1`) | Take the part before the colon as RoleName — no API needed |
| `RootUser` | Primary account identifier | Use directly — no resolution needed |

If `GetUser` fails (insufficient permission): mark as L0, fall back to raw error text.

---

## Permission Level (L0–L3)

Levels are implicit routing state — never declare or describe them to the user.

| Level | Confirmed When | Effect |
|-------|---------------|--------|
| L0 | `DecodeDiagnosticMessage` returns NoPermission | Root cause from raw text only; repair: Path B (incremental) + Path C |
| L1 | Decode succeeds, but policy query returns NoPermission | Skip gap analysis; repair: Path B (incremental) + Path C |
| L2 | Policy query returns results | Full gap analysis; repair: Path A (tentative) + Path B (with merge) + Path C |
| L3 | Write operation succeeds | Repair done; report result and undo command |

**Insufficient permission criteria**: ErrorCode `NoPermission`, `Forbidden`, or `AccessDenied`.

If user reports they have updated their own permissions: re-run Step 2 policy query to refresh level state.

---

## Root Cause Classification Decision Tree

```
ExplicitDeny = true?
  ├─ Yes → Explicit Deny path
  │        NoPermissionPolicyType = ControlPolicy?
  │          ├─ Yes → Root cause: CP control policy (out of scope, guide to manual)
  │          ├─ No (AccountLevelIdentityBasedPolicy) → Root cause: own policy Deny (fixable)
  │          └─ Unknown (field absent) → Query both ListPoliciesForUser + ListControlPolicies
  │
  └─ No (or no decoded info) → Missing Action path
       ├─ PolicyType = AssumeRolePolicy → Root cause: role trust policy not allowing caller
       ├─ MissingAction = sts:AssumeRole, PolicyType absent
       │    → Medium confidence: trust policy OR identity policy missing sts:AssumeRole
       │      Describe both; guide user to verify before choosing repair direction
       ├─ PrincipalARN contains AssumedRole/STS token → Root cause: STS credential insufficient
       ├─ ErrorCode = InvalidSecurityToken → Root cause: STS token expired
       ├─ Message contains ServiceLinkedRole → Root cause: SLR missing
       ├─ Error from OSS Bucket Policy etc. → Root cause: resource-side policy
       └─ Other → Root cause: missing Action (most common)
```

*

references/error-codes.md

# Alibaba Cloud RAM Permission ErrorCode Reference

## Insufficient Permission (requires authorization repair)

| ErrorCode | Description | Typical Scenario |
|-----------|-------------|-----------------|
| `NoPermission` | The current identity does not have permission to perform this operation | Most common — RAM user/role missing the required Action |
| `Forbidden` | Operation denied | Some services use this code instead of NoPermission |
| `AccessDenied` | Access denied | Commonly used by OSS, STS, and other services |
| `Forbidden.RAM` | Denied by RAM policy | Contains information related to RAM sub-accounts |
| `Forbidden.NotSupportRAM` | This operation does not support RAM sub-accounts | Requires primary account operation or special authorization |

## STS / Token Issues (requires renewal or reconfiguration)

| ErrorCode | Description | How to Handle |
|-----------|-------------|---------------|
| `InvalidSecurityToken.Expired` | STS Token has expired | Re-run AssumeRole to obtain a new token |
| `InvalidSecurityToken.MismatchWithAccessKey` | Token does not match the AK | Verify that AK/SK/Token all come from the same AssumeRole call |
| `InvalidSecurityToken` | Token is invalid | Check token format and validity |
| `SecurityTokenExpired` | Security token expired (used by some services) | Same as above — re-obtain token |

## Service-Linked Role Issues (requires creating an SLR)

| ErrorCode | Description | How to Handle |
|-----------|-------------|---------------|
| `ServiceRoleNotFound` | Service-linked role does not exist | Create the SLR for the corresponding service |
| `ServiceLinkedRoleNotExist` | Same as above (used by some services) | Create the SLR for the corresponding service |

## Permission Level Probing Reference

The following ErrorCodes indicate **the identity has permission but the parameter or resource has an issue** — they do not indicate insufficient permission. Encountering these codes during probing means the permission exists at that level:
- `InvalidParameter`, `MissingParameter`
- `EntityNotExist`, `EntityNotExists`
- `NotFound`, `ResourceNotFound`
- `InvalidInput`

The following ErrorCodes explicitly indicate **insufficient permission** — stop probing and record the level upon encountering them:
- `NoPermission`, `Forbidden`, `AccessDenied`
- `Forbidden.RAM`, `Forbidden.NotSupportRAM`

references/hot-services-ram.md

# Popular Services RAM Action Reference

> Used for Step 3 built-in knowledge priority. The following Actions are grouped by common task scenarios and can be used directly to generate minimum-privilege policies.

## ECS (Elastic Compute Service)

### Common Action Groups

| Scenario | Required Actions | Resource Pattern |
|----------|-----------------|-----------------|
| List / describe instances | `ecs:DescribeInstances`, `ecs:DescribeInstanceStatus` | `acs:ecs:*:*:instance/*` |
| Start / stop instances | `ecs:StartInstance`, `ecs:StopInstance`, `ecs:RebootInstance` | `acs:ecs:*:*:instance/*` |
| Create instances | `ecs:RunInstances`, `ecs:DescribeImages`, `ecs:DescribeSecurityGroups` | `acs:ecs:*:*:*` |
| Change instance type | `ecs:ModifyInstanceSpec`, `ecs:DescribeResourcesModification` | `acs:ecs:*:*:instance/*` |
| Disk snapshots | `ecs:CreateSnapshot`, `ecs:DescribeSnapshots`, `ecs:DescribeDisks` | `acs:ecs:*:*:disk/*` |
| Security group management | `ecs:DescribeSecurityGroups`, `ecs:AuthorizeSecurityGroup`, `ecs:RevokeSecurityGroup` | `acs:ecs:*:*:securitygroup/*` |

### Recommended System Policies
- Read-only operations: `AliyunECSReadOnlyAccess`
- Operational access (no create/delete): `AliyunECSOperatorAccess`
- Full control: `AliyunECSFullAccess`

---

## OSS (Object Storage Service)

### Common Action Groups

| Scenario | Required Actions | Resource Pattern |
|----------|-----------------|-----------------|
| Read objects | `oss:GetObject`, `oss:HeadObject` | `acs:oss:*:*:<bucket-name>/*` |
| Upload objects | `oss:PutObject`, `oss:InitiateMultipartUpload`, `oss:UploadPart` | `acs:oss:*:*:<bucket-name>/*` |
| Delete objects | `oss:DeleteObject` | `acs:oss:*:*:<bucket-name>/*` |
| List objects | `oss:ListObjects`, `oss:ListBuckets` | `acs:oss:*:*:<bucket-name>` |
| Bucket management | `oss:CreateBucket`, `oss:DeleteBucket`, `oss:GetBucketInfo` | `acs:oss:*:*:*` |

### Recommended System Policies
- Read-only: `AliyunOSSReadOnlyAccess`
- Full control: `AliyunOSSFullAccess`

---

## RDS (Relational Database Service)

### Common Action Groups

| Scenario | Required Actions | Resource Pattern |
|----------|-----------------|-----------------|
| Query instances / databases | `rds:DescribeDBInstances`, `rds:DescribeDBInstanceAttribute` | `acs:rds:*:*:dbinstance/*` |
| Create database accounts | `rds:CreateAccount`, `rds:DescribeAccounts` | `acs:rds:*:*:dbinstance/*` |
| Backup management | `rds:CreateBackup`, `rds:DescribeBackups` | `acs:rds:*:*:dbinstance/*` |
| Change instance type | `rds:ModifyDBInstanceSpec` | `acs:rds:*:*:dbinstance/*` |
| Whitelist management | `rds:ModifySecurityIps`, `rds:DescribeDBInstanceIPArrayList` | `acs:rds:*:*:dbinstance/*` |

### Recommended System Policies
- Read-only: `AliyunRDSReadOnlyAccess`
- Full control: `AliyunRDSFullAccess`

---

## FC (Function Compute)

### Common Action Groups

| Scenario | Required Actions | Resource Pattern |
|----------|-----------------|-----------------|
| Invoke functions |

Sponsored

Ads related to Alibabacloud Ram Permission Diagnose and adjacent AI workflows.