全部產品
Search
文件中心

STAROps:STAROps 自訂權限原則最佳實務

更新時間:Jul 08, 2026

本文介紹如何基於最小許可權原則,為不同職責的 RAM 使用者配置 STAROps 自訂權限原則。

本文適用於已經瞭解基礎許可權配置流程的安全性系統管理員和營運管理員。

開始前,建議先閱讀許可權配置,理解使用者和數字員工 RAM Role 這兩個授權對象之間的關係,以及 ram:PassRole 在其中承擔的委派控製作用。

設計原則

配置 STAROps 許可權時,建議遵循以下原則:

  1. 按職責授權。管理員、普通營運人員、長期任務營運人員和審計人員應使用不同策略。

  2. 分離使用者權限和數字員工運行許可權。RAM 使用者能使用 STAROps,不代表數字員工能訪問所有資料;數字員工能訪問資料,也不代表使用者能在控制台查看資料。

  3. 收斂 ram:PassRole。建議指定到服務角色或 STAROps 專用自訂角色,不建議長期使用 Resource: "*"

  4. 按業務線隔離數字員工。不同業務線使用不同數字員工、不同 RAM Role 和不同資料存取範圍。

  5. 唯讀優先。巡檢、報告、警示分析等情境優先授予唯讀許可權。

  6. 謹慎授權寫操作。涉及雲資源變更、警示修改、配置下發或指令碼執行時,應配合人工確認、審計和復原。

模板選擇

模板

適用對象

說明

模板一:營運管理員

負責管理數字員工、會話、Skill 和產物的管理員

許可權較大,生產環境需要收斂 ram:PassRole

模板二:普通營運人員

日常與數字員工對話、查看會話和產物的使用者

需要對目標數字員工 RAM Role 具備 ram:PassRole

模板三:按數字員工粒度授權

只允許使用或管理指定數字員工的團隊成員

需要對指定數字員工 RAM Role 具備 ram:PassRole

模板四:長期任務營運人員

負責建立和維護長期任務的營運人員

需要對任務所選數字員工 RAM Role 具備 ram:PassRole

模板五:長期任務唯讀

審計或管理複盤人員

只查看任務、會話和產物

模板六:Deny 高危刪除操作

需要額外防護刪除操作的生產環境

與允許策略配合使用

說明

以下模板基於線上協助文檔產生,可直接複製到 RAM 自訂權限原則中。模板中的 ram:PassRole 預設以服務角色 AliyunServiceRoleForCloudMonitor 為例;如果數字員工綁定自訂 RAM Role,請將 Resource 替換為對應 RoleArn。

模板一:營運管理員(數字員工、會話、Skill 全部許可權)

適用於負責 STAROps 日常管理的營運管理員。該模板允許管理數字員工、Skill、會話和產物,並包含 ram:PassRole 樣本。

不建議把該模板直接授予所有營運人員。生產環境應按業務線、數字員工 ID、Workspace 和 RoleArn 繼續收斂。

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cms:CreateDigitalEmployee",
        "cms:GetDigitalEmployee",
        "cms:ListDigitalEmployees",
        "cms:UpdateDigitalEmployee",
        "cms:DeleteDigitalEmployee",
        "cms:CreateDigitalEmployeeSkill",
        "cms:GetDigitalEmployeeSkill",
        "cms:ListDigitalEmployeeSkills",
        "cms:UpdateDigitalEmployeeSkill",
        "cms:DeleteDigitalEmployeeSkill",
        "cms:ListDigitalEmployeeSkillVersions",
        "cms:CreateThread",
        "cms:GetThread",
        "cms:GetThreadData",
        "cms:ListThreads",
        "cms:UpdateThread",
        "cms:DeleteThread",
        "cms:GetArtifact",
        "cms:ListArtifacts",
        "cms:CreateChat"
      ],
      "Resource": [
        "acs:cms:*:*:digitalemployee/*",
        "acs:cms:*:*:digitalemployee/*/skill/*",
        "acs:cms:*:*:digitalemployee/*/thread/*",
        "acs:cms:*:*:digitalemployee/*/artifact/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": "ram:PassRole",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "acs:Service": [
            "operation-platform.aliyuncs.com",
            "cloudmonitor.aliyuncs.com"
          ]
        }
      }
    },
    {
      "Effect": "Allow",
      "Action": [
        "cms:ListWorkspaces",
        "cms:GetWorkspace",
        "cms:GetEntityStore",
        "cms:GetEntityStoreData"
      ],
      "Resource": [
        "acs:cms:*:*:workspace/*",
        "acs:cms:*:*:workspace/*/entitystore"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "starops:CreateDigitalEmployee",
        "starops:GetDigitalEmployee",
        "starops:ListDigitalEmployees",
        "starops:UpdateDigitalEmployee",
        "starops:DeleteDigitalEmployee",
        "starops:CreateDigitalEmployeeSkill",
        "starops:GetDigitalEmployeeSkill",
        "starops:ListDigitalEmployeeSkills",
        "starops:UpdateDigitalEmployeeSkill",
        "starops:DeleteDigitalEmployeeSkill",
        "starops:ListDigitalEmployeeSkillVersions",
        "starops:CreateThread",
        "starops:GetThread",
        "starops:GetThreadData",
        "starops:ListThreads",
        "starops:UpdateThread",
        "starops:DeleteThread",
        "starops:GetArtifact",
        "starops:ListArtifacts",
        "starops:CreateArtifactUploadToken",
        "starops:GetArtifactDownloadUrl",
        "starops:CreateChat"
      ],
      "Resource": [
        "acs:starops:*:*:digitalemployee/*",
        "acs:starops:*:*:digitalemployee/*/skill/*",
        "acs:starops:*:*:digitalemployee/*/thread/*",
        "acs:starops:*:*:digitalemployee/*/artifact/*"
      ]
    }
  ]
}
        

模板二:普通營運人員(僅對話和查看)

適用於日常使用 STAROps 的 SRE、DevOps 或應用負責人。該模板允許查看數字員工、發起對話、查看會話和產物,不允許建立、修改或刪除數字員工。由於對話時需要使用自訂數字員工綁定的 RAM Role,因此需要同時授予 ram:PassRole

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cms:GetDigitalEmployee",
        "cms:ListDigitalEmployees",
        "cms:CreateChat",
        "cms:CreateThread",
        "cms:GetThread",
        "cms:GetThreadData",
        "cms:ListThreads",
        "cms:GetArtifact",
        "cms:ListArtifacts"
      ],
      "Resource": [
        "acs:cms:*:*:digitalemployee/*",
        "acs:cms:*:*:digitalemployee/*/thread/*",
        "acs:cms:*:*:digitalemployee/*/artifact/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "cms:ListWorkspaces",
        "cms:GetWorkspace",
        "cms:GetEntityStore",
        "cms:GetEntityStoreData"
      ],
      "Resource": [
        "acs:cms:*:*:workspace/*",
        "acs:cms:*:*:workspace/*/entitystore"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "starops:GetDigitalEmployee",
        "starops:ListDigitalEmployees",
        "starops:CreateThread",
        "starops:GetThread",
        "starops:GetThreadData",
        "starops:ListThreads",
        "starops:GetArtifact",
        "starops:ListArtifacts",
        "starops:CreateArtifactUploadToken",
        "starops:GetArtifactDownloadUrl",
        "starops:CreateChat"
      ],
      "Resource": [
        "acs:starops:*:*:digitalemployee/*",
        "acs:starops:*:*:digitalemployee/*/thread/*",
        "acs:starops:*:*:digitalemployee/*/artifact/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": "ram:PassRole",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "acs:Service": [
            "operation-platform.aliyuncs.com",
            "cloudmonitor.aliyuncs.com"
          ]
        }
      }
    }
  ]
}
        

模板三:按數字員工粒度授權

適用於按業務線、應用或團隊隔離數字員工的情境。樣本中使用者只能訪問指定數字員工及其 Skill、會話和產物,並只能傳遞該數字員工綁定的 RAM Role。

複製後請將樣本中的數字員工 ID、Workspace 和資源範圍替換為實際範圍。

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "cms:ListDigitalEmployees",
        "cms:GetDigitalEmployee",
        "cms:UpdateDigitalEmployee",
        "cms:CreateChat",
        "cms:CreateThread",
        "cms:GetThread",
        "cms:GetThreadData",
        "cms:ListThreads",
        "cms:UpdateThread",
        "cms:DeleteThread",
        "cms:GetDigitalEmployeeSkill",
        "cms:ListDigitalEmployeeSkills",
        "cms:ListDigitalEmployeeSkillVersions",
        "cms:GetArtifact",
        "cms:ListArtifacts"
      ],
      "Resource": [
        "acs:cms:*:*:digitalemployee/ops-agent-a",
        "acs:cms:*:*:digitalemployee/ops-agent-a/skill/*",
        "acs:cms:*:*:digitalemployee/ops-agent-a/thread/*",
        "acs:cms:*:*:digitalemployee/ops-agent-a/artifact/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "cms:ListWorkspaces",
        "cms:GetWorkspace",
        "cms:GetEntityStore",
        "cms:GetEntityStoreData"
      ],
      "Resource": [
        "acs:cms:*:*:workspace/*",
        "acs:cms:*:*:workspace/*/entitystore"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "starops:GetDigitalEmployeeSkill",
        "starops:ListDigitalEmployeeSkills",
        "starops:ListDigitalEmployeeSkillVersions",
        "starops:CreateThread",
        "starops:GetThread",
        "starops:GetThreadData",
        "starops:ListThreads",
        "starops:UpdateThread",
        "starops:DeleteThread",
        "starops:GetArtifact",
        "starops:ListArtifacts",
        "starops:CreateArtifactUploadToken",
        "starops:GetArtifactDownloadUrl",
        "starops:CreateChat"
      ],
      "Resource": [
        "acs:starops:*:*:digitalemployee/ops-agent-a",
        "acs:starops:*:*:digitalemployee/ops-agent-a/skill/*",
        "acs:starops:*:*:digitalemployee/ops-agent-a/thread/*",
        "acs:starops:*:*:digitalemployee/ops-agent-a/artifact/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": "ram:PassRole",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "acs:Service": [
            "operation-platform.aliyuncs.com",
            "cloudmonitor.aliyuncs.com"
          ]
        }
      }
    }
  ]
}
        

模板四:長期任務營運人員(Mission 管理)

適用於負責建立、更新和觀察長期任務的營運人員。長期任務必須選擇綁定 RAM Role 的自訂數字員工;任務能訪問的資料和資源,仍由該數字員工 RAM Role 決定。因此,長期任務營運人員也需要對任務所選數字員工 RAM Role 具備 ram:PassRole

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "starops:CreateMission",
        "starops:GetMission",
        "starops:ListMissions",
        "starops:UpdateMission",
        "starops:DeleteMission",
        "starops:ListTasks",
        "starops:ListDigitalEmployees",
        "starops:ListThreads"
      ],
      "Resource": [
        "acs:starops:*:*:mission/*",
        "acs:starops:*:*:digitalemployee/*",
        "acs:starops:*:*:digitalemployee/*/thread/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "starops:GetArtifact",
        "starops:ListArtifacts"
      ],
      "Resource": "acs:starops:*:*:digitalemployee/*/artifact/*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "cms:CreateMission",
        "cms:GetMission",
        "cms:ListMissions",
        "cms:UpdateMission",
        "cms:DeleteMission",
        "cms:ListTasks",
        "cms:ListDigitalEmployees",
        "cms:ListThreads"
      ],
      "Resource": [
        "acs:cms:*:*:mission/*",
        "acs:cms:*:*:digitalemployee/*",
        "acs:cms:*:*:digitalemployee/*/thread/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "cms:GetArtifact",
        "cms:ListArtifacts"
      ],
      "Resource": "acs:cms:*:*:digitalemployee/*/artifact/*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "cms:ListWorkspaces",
        "cms:GetWorkspace"
      ],
      "Resource": "acs:cms:*:*:workspace/*"
    },
    {
      "Effect": "Allow",
      "Action": "ram:PassRole",
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "acs:Service": [
            "operation-platform.aliyuncs.com",
            "cloudmonitor.aliyuncs.com"
          ]
        }
      }
    }
  ]
}
        

模板五:長期任務唯讀

適用於安全審計、管理複盤和任務結果檢查。該模板只允許查看長期任務、任務狀態、數字員工、會話和產物,不允許建立、更新或刪除長期任務。

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "starops:GetMission",
        "starops:ListMissions",
        "starops:ListTasks",
        "starops:ListDigitalEmployees",
        "starops:GetDigitalEmployee",
        "starops:ListThreads"
      ],
      "Resource": [
        "acs:starops:*:*:mission/*",
        "acs:starops:*:*:digitalemployee/*",
        "acs:starops:*:*:digitalemployee/*/thread/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "starops:GetArtifact",
        "starops:ListArtifacts"
      ],
      "Resource": [
        "acs:starops:*:*:digitalemployee/*/artifact/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "cms:GetMission",
        "cms:ListMissions",
        "cms:ListTasks",
        "cms:ListDigitalEmployees",
        "cms:GetDigitalEmployee",
        "cms:ListThreads"
      ],
      "Resource": [
        "acs:cms:*:*:mission/*",
        "acs:cms:*:*:digitalemployee/*",
        "acs:cms:*:*:digitalemployee/*/thread/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "cms:GetArtifact",
        "cms:ListArtifacts"
      ],
      "Resource": [
        "acs:cms:*:*:digitalemployee/*/artifact/*"
      ]
    },
    {
      "Effect": "Allow",
      "Action": [
        "cms:ListWorkspaces",
        "cms:GetWorkspace"
      ],
      "Resource": [
        "acs:cms:*:*:workspace/*"
      ]
    }
  ]
}
        

PassRole 授權路徑

ram:PassRole 控制 RAM 使用者能否把某個 RAM Role 傳遞給 STAROps 使用,不授予資料存取權限。授予時請按以下路徑處理:

  1. 先確認數字員工綁定的 RoleArn。

  2. 如果數字員工選擇服務角色 ServiceRoleForCloudMonitor,Resource 使用 acs:ram::*:role/aliyunserviceroleforcloudmonitor

  3. 如果數字員工選擇自訂 RAM Role,Resource 使用該角色的 RoleArn,例如 acs:ram::*:role/starops-production-sre

  4. 在 RAM 控制台建立自訂權限原則,並將策略授權給需要使用該數字員工的 RAM 使用者或使用者組。

模板二、模板三、模板四都需要包含這類 PassRole 授權;模板五隻做唯讀審計,通常不授予。

服務角色 ServiceRoleForCloudMonitor 的 PassRole 樣本:

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "ram:PassRole",
      "Resource": "acs:ram::*:role/aliyunserviceroleforcloudmonitor",
      "Condition": {
        "StringEquals": {
          "acs:Service": [
            "operation-platform.aliyuncs.com",
            "cloudmonitor.aliyuncs.com"
          ]
        }
      }
    }
  ]
}
        

數字員工最佳實務

自訂權限原則只解決"RAM 使用者能做什麼"。數字員工本身也需要按最小許可權設計,否則容易出現一個高許可權 Agent 被多個團隊複用的問題。

按情境拆分數字員工

建議將數字員工按職責拆分,而不是建立一個全能數字員工:

  • 唯讀巡檢數字員工:用於日誌查詢、指標分析、警示診斷和報告產生。

  • 變更執行數字員工:用於受控執行雲產品配置更新、資源變更或指令碼操作。

  • 長期任務數字員工:用於周期性巡檢、報告和持續分析。

  • 業務線數字員工:按支付、搜尋、物流等業務線隔離資料和操作範圍。

不同數字員工應綁定不同 RAM Role。唯讀情境可優先選擇服務角色 ServiceRoleForCloudMonitor;涉及更新雲產品配置或資源變更時,請使用自訂 RAM Role,並只授予必要寫入權限。

按 RAM Role 收斂運行許可權

數字員工綁定的 RAM Role 決定它運行時能訪問哪些資料和資源。建議:

  • 每個生產數字員工使用獨立 RAM Role。

  • Role 命名體現業務線和職責,例如 starops-payment-readonlystarops-payment-change

  • 按 Workspace、記錄項目、資源群組、地區或雲產品資源範圍收斂授權。

  • 唯讀和寫操作使用不同 RAM Role。

  • 不把帳號管理員 Role 或生產全量營運 Role 作為數字員工運行 Role。

按使用者收斂 PassRole

  • 只給需要建立、更新或使用自訂數字員工的人授予。

  • Resource 指定到服務角色或 STAROps 專用自訂角色。

  • 通過 acs:Service 限定只能傳遞給 STAROps 相關服務。

  • 普通唯讀審計人員不授予 ram:PassRole

長期任務單獨治理

長期任務會非同步執行,必須使用綁定 RAM Role 的自訂數字員工。建議:

  • 長期任務使用專門的數字員工和 RAM Role。

  • 巡檢、報告類任務優先使用唯讀 RAM Role。

  • 需要執行變更動作的長期任務,使用獨立數字員工、獨立 RAM Role 和人工確認流程。

  • 定期審查長期任務綁定的數字員工和 RoleArn,避免任務長期持有過大的運行許可權。

配置 MCP 和 AliyunCLI 時單獨評估

系統內建員工不支援 MCP、AliyunCLI 等擴充配置。自訂數字員工啟用這些能力前,建議確認:

  • 工具能力是否必須開啟。

  • 工具能訪問的雲產品和資源範圍是否受 RAM Role 限制。

  • 高風險工具是否有人工確認、執行記錄和復原方案。

  • 是否需要為工具型數字員工單獨建立 RAM Role。

策略驗證與排查

完成配置後,建議按以下順序驗證:

驗證項

驗證方法

重點檢查

使用者能否看到目標數字員工

登入 STAROps 查看數字員工列表

Get/List 數字員工許可權

使用者能否發起會話

與目標數字員工對話

CreateChat、CreateThread、GetThread 許可權

使用者能否建立長期任務

建立一個測試長期任務

Mission Create/Update 許可權

建立或更新數字員工是否 PassRole 失敗

儲存綁定 RoleArn 的數字員工

RAM 使用者 ram:PassRole 和 RoleArn 範圍

數字員工能否讀取目標資料

查詢目標 Workspace、日誌或雲資源

數字員工 RAM Role 權限原則

使用者能否查看報告和產物

開啟任務報告或會話產物

Artifact Get/List 許可權

排查時,先判斷問題發生在使用者操作階段,還是數字員工運行階段。使用者操作失敗,檢查 RAM 使用者權限;綁定或使用 Role 失敗,檢查 ram:PassRole;數字員工運行失敗,檢查 RAM Role 信任策略和權限原則。

發布前檢查

發布到生產環境前,建議確認:

  • 已將樣本中的數字員工 ID、RoleArn、Workspace、記錄項目替換為真實範圍。

  • 已刪除不需要的 Action 和 Resource。

  • 已避免在生產環境使用 Resource: "*"ram:PassRole

  • 已區分唯讀數字員工和變更執行數字員工。

  • 已確認具備寫操作能力的數字員工有人工確認、審計和復原流程。

  • 已為長期任務選擇綁定 RAM Role 的自訂數字員工。

  • 已使用 RAM 使用者完成一次真實情境驗證。