服务关联角色

更新时间:
复制 MD 格式

使用无影云电脑的相关功能时,如果需要访问其他阿里云服务,系统会自动创建对应的服务关联角色,并在获得授权后代为访问这些服务。本文介绍无影云电脑(原称图形工作站 GWS)各服务关联角色的应用场景、权限策略及相关操作。

背景信息

服务关联角色是与特定的云服务关联的角色。多数情况下,在您使用特定功能时,关联的云服务会自动创建或删除服务关联角色。通过服务关联角色可以更好地配置云服务正常操作所必须的权限,避免误操作带来的风险。更多关于服务关联角色的信息,请参见服务关联角色。

服务关联角色列表

服务关联角色应用场景
AliyunServiceRoleForGws创建、停止、启动无影云电脑或创建、删除镜像等操作时,访问云服务器 ECS、专有网络 VPC等云产品。
AliyunServiceRoleForGwsDiskEncryption加密云电脑磁盘时,访问密钥管理服务(KMS)的资源。
AliyunServiceRoleForGwsGa使用无影全球加速功能时,访问全球加速 GA(Global Accelerator)服务。
AliyunServiceRoleForGwsSecurity使用无影 AI 安全功能时,访问阿里云云安全服务。
AliyunServiceRoleForGwsFlowLog使用无影流日志功能时,访问流日志资源。

AliyunServiceRoleForGws

应用场景

执行创建、停止、启动无影云电脑或创建、删除镜像等操作时,需要访问云服务器 ECS或专有网络 VPC等云产品,系统通过服务关联角色 AliyunServiceRoleForGws 获取相应权限。

权限说明

  • 角色名称:AliyunServiceRoleForGws

  • 权限策略名称:AliyunServiceRolePolicyForGws

  • 权限说明:无影云电脑使用此角色访问跨云产品服务。

该权限策略包含的云服务访问权限如下:

{"Version":"1","Statement":[
{"Action":"ram:DeleteServiceLinkedRole","Resource":"*","Effect":"Allow","Condition":{"StringEquals":{"ram:ServiceName":"gws.aliyuncs.com"}}},
{"Action":"ram:CreateServiceLinkedRole","Resource":"*","Effect":"Allow","Condition":{"StringEquals":{"ram:ServiceName":"privatelink.aliyuncs.com"}}},
{"Action":"acm:DescribePrice","Resource":"*","Effect":"Allow"},
{"Action":["ecs:StopInstance","ecs:CreateInstance","ecs:DeleteInstance","ecs:StartInstance","ecs:RebootInstance","ecs:DescribeInstances","ecs:DescribeInstanceAttribute","ecs:CreateImage","ecs:DeleteImage","ecs:DescribeImages","ecs:ModifyImageAttribute","ecs:AllocatePublicIpAddress","ecs:DescribeZones","ecs:DescribeAvailableResource","ecs:DescribeSecurityGroups","ecs:AuthorizeSecurityGroup","ecs:RevokeSecurityGroup","ecs:CreateSecurityGroup","ecs:DeleteSecurityGroup","ecs:DescribeUserData","ecs:TagResources","ecs:ModifyInstanceAttribute","ecs:ModifyInstanceVncPasswd","ecs:RunCommand","ecs:DescribeInvocationResults","ecs:AuthorizeSecurityGroupEgress","ecs:RevokeSecurityGroupEgress","ecs:CreateNetworkInterface","ecs:DescribeNetworkInterfaces","ecs:AttachNetworkInterface","ecs:DetachNetworkInterface"],"Resource":"*","Effect":"Allow"},
{"Action":["vpc:CreateVSwitch","vpc:CreateVpc","vpc:DescribeVpcs","vpc:DescribeVSwitches","vpc:CreateNatGateway","vpc:DeleteNatGateway","vpc:DescribeNatGateways","vpc:CreateForwardEntry","vpc:DeleteForwardEntry","vpc:DescribeForwardTableEntries","vpc:ModifyForwardEntry","vpc:UnassociateEipAddress","vpc:ReleaseEipAddress","vpc:DescribeEipAddresses","vpc:AssociateEipAddress","vpc:AllocateEipAddress"],"Resource":"*","Effect":"Allow"},
{"Action":["privatelink:CreateVpcEndpoint","privatelink:ListVpcEndpoints","privatelink:UpdateVpcEndpointAttribute","privatelink:GetVpcEndpointAttribute","privatelink:AddZoneToVpcEndpoint","privatelink:RemoveZoneFromVpcEndpoint","privatelink:ListVpcEndpointSecurityGroups","privatelink:AttachSecurityGroupToVpcEndpoint","privatelink:DetachSecurityGroupFromVpcEndpoint","privatelink:ListVpcEndpointZones","privatelink:DeleteVpcEndpoint","privatelink:OpenPrivateLinkService"],"Resource":"*","Effect":"Allow"},
{"Action":["nas:OpenNASService","nas:CreateFileSystem","nas:DeleteFileSystem","nas:ModifyFileSystem","nas:DescribeFileSystems","nas:CreateMountTarget","nas:DeleteMountTarget","nas:DescribeMountTargets","nas:DescribeSmbAcl","nas:TagResources","nas:DisableSmbAcl","nas:ModifySmbAcl","nas:CreateFile","nas:ListDirectoriesAndFiles","nas:DescribeSmbAcl","nas:EnableSmbAcl","nas:DescribeZones"],"Resource":"*","Effect":"Allow"},
{"Action":["cen:AttachCenChildInstance","cen:DetachCenChildInstance","cen:DescribeCenAttachedChildInstances","cen:DescribeCens","cen:DescribeCenRegionDomainRouteEntries","cen:CreateTransitRouterVpcAttachment","cen:ListTransitRouters","cen:CreateTransitRouter","cen:ListTransitRouterVpcAttachments","cen:ListTransitRouterRouteTables","cen:DeleteTransitRouterVpcAttachment","cen:ListTransitRouterRouteTableAssociations","cen:DissociateTransitRouterAttachmentFromRouteTable","cen:ListTransitRouterRouteTablePropagations","cen:DisableTransitRouterRouteTablePropagation","cen:AssociateTransitRouterAttachmentWithRouteTable","cen:EnableTransitRouterRouteTablePropagation","cen:DescribeCenAttachedChildInstanceAttribute","cen:CheckTransitRouterService","cen:ListTransitRouterRouteEntries","cen:DeleteTransitRouterRouteEntry"],"Resource":"*","Effect":"Allow"},
{"Action":["oss:ListObjects","oss:PutObject","oss:GetObject","oss:DeleteObject","oss:PutBucketLifecycle","oss:GetBucketLifecycle"],"Resource":["acs:oss:*:*:eds-recording-bucket-*","acs:oss:*:*:eds-recording-bucket-*/*"],"Effect":"Allow"},
{"Action":["oss:ListBuckets","oss:PutBucket"],"Resource":"*","Effect":"Allow"},
{"Action":"quotas:GetProductQuota","Resource":"*","Effect":"Allow"},
{"Action":["pds:CreateUser","pds:DeleteUser","pds:UpdateUser","pds:GetUser","pds:ListUser","pds:ShareFile","pds:VisibleFile","pds:GetUserExtraInfo","pds:CreateGroup","pds:DeleteGroup","pds:UpdateGroup","pds:ListGroup","pds:GetGroup","pds:CreateMembership","pds:DeleteMembership","pds:GetMembership","pds:ListMembership","pds:CreateDrive","pds:DeleteDrive","pds:UpdateDrive","pds:GetDrive","pds:ListDrive","pds:CreateFile","pds:EditFile","pds:UpdateFile","pds:GetFile","pds:ListFiles","pds:MoveFile","pds:CopyFile","pds:DeleteFile","pds:GetAsyncTask","pds:CreateOrder","pds:AssignRole","pds:CreateDomain","pds:UpdateDomain","pds:DeleteDomain","pds:GetDomain","pds:ListDomains","pds:CreateShare","pds:GetShare","pds:UpdateShare","pds:ListShares","pds:DownloadFile","pds:Batch"],"Resource":"*","Effect":"Allow"}
]}

删除服务关联角色

删除无影云电脑服务关联角色 AliyunServiceRoleForGws 前,需要先通过控制台或 OpenAPI 删除依赖该角色的无影云电脑资源,再按照删除RAM角色删除该角色。

AliyunServiceRoleForGwsDiskEncryption

首次使用无影云电脑的磁盘加密功能时,系统自动创建无影云电脑服务关联角色 AliyunServiceRoleForGwsDiskEncryption,并为其授予相应权限策略。

应用场景

加密云电脑磁盘的过程中,无影云电脑需要访问密钥管理服务(KMS)的资源时,通过服务关联角色 AliyunServiceRoleForGwsDiskEncryption 获取访问权限。

权限说明

  • 角色名称:AliyunServiceRoleForGwsDiskEncryption

  • 权限策略名称:AliyunServiceRolePolicyForGwsDiskEncryption

  • 权限说明:无影云电脑使用此角色访问密钥管理服务(KMS)资源。

该权限策略包含的云服务访问权限如下:

{"Version":"1","Statement":[
{"Action":["kms:ListKeys","kms:ListAliases","kms:ListResourceTags","kms:DescribeKey","kms:TagResource","kms:UntagResource"],"Resource":["acs:kms:*:*:*"],"Effect":"Allow"},
{"Action":["kms:Encrypt","kms:Decrypt","kms:GenerateDataKey"],"Resource":["acs:kms:*:*:*"],"Effect":"Allow","Condition":{"StringEqualsIgnoreCase":{"kms:tag/acs:eds:instance-encryption":"true"}}},
{"Action":"ram:DeleteServiceLinkedRole","Resource":"*","Effect":"Allow","Condition":{"StringEquals":{"ram:ServiceName":"disk-encryption.gws.aliyuncs.com"}}}
]}

删除服务关联角色

删除无影云电脑服务关联角色 AliyunServiceRoleForGwsDiskEncryption 前,需要先通过控制台或 OpenAPI 删除依赖该角色的无影云电脑资源,即删除包含加密磁盘的云电脑,再按照删除RAM角色删除该角色。

常见问题

为什么使用 RAM 用户操作时,无法自动创建无影云电脑服务关联角色(AliyunServiceRoleForGwsDiskEncryption)?

RAM 用户(子账号)需要拥有指定的权限(CreateServiceLinkedRole),才能自动创建或删除服务关联角色 AliyunServiceRoleForGwsDiskEncryption。因此,当 RAM 用户无法自动创建该服务关联角色时,需要为其添加以下权限策略。

说明

将 主账号ID 替换为实际的阿里云账号(主账号)ID。

{"Statement":[{"Action":["ram:CreateServiceLinkedRole"],"Resource":"acs:ram:*:主账号ID:role/*","Effect":"Allow","Condition":{"StringEquals":{"ram:ServiceName":["arms.aliyuncs.com"]}}}],"Version":"1"}

AliyunServiceRoleForGwsGa

首次使用无影全球加速功能时,系统自动创建服务关联角色 AliyunServiceRoleForGwsGa,并为其授予相应权限策略。获得授权后,无影服务可访问全球加速 GA(Global Accelerator)服务,并使用该权限管理无影创建的全球加速实例,以实现无影全球加速功能。

应用场景

在使用无影全球加速功能的过程中,无影服务需要通过服务关联角色 AliyunServiceRoleForGwsGa 获取全球加速 GA(Global Accelerator)服务的访问权限。

策略详情

  • 类型:系统策略

  • 创建时间:2024-12-27 14:06:46

  • 更新时间:2025-01-10 09:59:31

  • 当前版本:v2

策略内容

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ga:DeployAccelerator",
        "ga:CreateAccelerator",
        "ga:DescribeAccelerator",
        "ga:UpdateAccelerator",
        "ga:DeleteAccelerator",
        "ga:CreateIpSets",
        "ga:ListIpSets",
        "ga:UpdateIpSets",
        "ga:DeleteIpSets",
        "ga:DescribeIpSet",
        "ga:UpdateAcceleratorCrossBorderMode",
        "ga:UpdateAcceleratorCrossBorderStatus"
      ],
      "Resource": "*"
    },
    {
      "Action": "ram:DeleteServiceLinkedRole",
      "Resource": "*",
      "Effect": "Allow",
      "Condition": {
        "StringEquals": {
          "ram:ServiceName": "ga.gws.aliyuncs.com"
        }
      }
    },
    {
      "Action": "ram:CreateServiceLinkedRole",
      "Resource": "*",
      "Effect": "Allow",
      "Condition": {
        "StringEquals": {
          "ram:ServiceName": [
              "cdt.ga.aliyuncs.com",
              "vpcendpoint.ga.aliyuncs.com"
          ]
        }
      }
    }
  ]
}

授权服务关联角色

在提示对话框中单击确认授权,即表示同意借助服务关联角色 AliyunServiceRoleForGwsGa 管理无影创建的全球加速实例。

删除服务关联角色

为确保无影全球加速功能正常使用,不建议删除服务关联角色 AliyunServiceRoleForGwsGa。如确需删除,先清理依赖资源,再删除角色:

  • 确保无影账号下已没有任何全球加速实例。

  • 通过阿里云访问控制控制台删除该服务关联角色,具体操作参见删除RAM角色。

AliyunServiceRoleForGwsSecurity

首次使用无影 AI 安全功能时,系统自动创建服务关联角色 AliyunServiceRoleForGwsSecurity,并为其授予相应权限策略。获得授权后,无影服务可访问阿里云云安全服务,以支撑无影 AI 安全功能。

应用场景

在使用无影 AI 安全功能的过程中,无影服务需要通过服务关联角色 AliyunServiceRoleForGwsSecurity 获取阿里云云安全服务的访问权限。

策略详情

  • 类型:系统策略

  • 创建时间:2026-05-18 18:00:00

  • 更新时间:2026-05-18 18:00:00

  • 当前版本:v1

策略内容

该权限策略包含的云服务访问权限如下:

{"Version":"1","Statement":[
{"Effect":"Allow","Action":["yundun-sas:CreateServiceLinkedRole","yundun-sas:DescribeServiceLinkedRoleStatus"],"Resource":"*"},
{"Effect":"Allow","Action":"yundun-greenweb:GetServiceConf","Resource":"*"},
{"Effect":"Allow","Action":"yundun-aisc:CreateAIAgentPluginKey","Resource":"*"},
{"Action":"ram:DeleteServiceLinkedRole","Resource":"*","Effect":"Allow","Condition":{"StringEquals":{"ram:ServiceName":"security.gws.aliyuncs.com"}}},
{"Action":"ram:CreateServiceLinkedRole","Resource":"*","Effect":"Allow","Condition":{"StringEquals":{"ram:ServiceName":["cspm.sas.aliyuncs.com","agentless.sas.aliyuncs.com"]}}}
]}

授权服务关联角色

在提示对话框中单击确认授权,即表示同意借助服务关联角色 AliyunServiceRoleForGwsSecurity 管理无影 AI 安全功能。

删除服务关联角色

为确保无影 AI 安全功能正常使用,不建议删除服务关联角色 AliyunServiceRoleForGwsSecurity。如确需删除,先清理依赖资源,再删除角色:

  • 确保无影账号下已不再使用无影 AI 安全功能。

  • 通过阿里云访问控制控制台删除该服务关联角色,具体操作参见删除RAM角色。

AliyunServiceRoleForGwsFlowLog

首次使用无影流日志功能时,系统自动创建服务关联角色 AliyunServiceRoleForGwsFlowLog,并为其授予相应权限策略。获得授权后,无影流日志功能才能借助该服务关联角色对流日志资源执行操作。

应用场景

在使用无影流日志功能的过程中,无影服务需要通过服务关联角色 AliyunServiceRoleForGwsFlowLog 获取流日志资源的访问权限。

策略详情

  • 类型:系统策略

  • 创建时间:2024-07-19 17:20:17

  • 更新时间:2024-07-19 17:20:17

  • 当前版本:v1

策略内容

{
  "Version": "1",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "vpc:GetFlowLogServiceStatus",
        "vpc:OpenFlowLogService",
        "vpc:CreateFlowLog"
      ],
      "Resource": "*"
    },
    {
      "Effect": "Allow",
      "Action": [
        "vpc:DescribeFlowLogs",
        "vpc:DeleteFlowLog",
        "vpc:ModifyFlowLogAttribute",
        "vpc:ActiveFlowLog",
        "vpc:DeactiveFlowLog"
      ],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "acs:ResourceTag/acs:gws:operater": [
            "gwsecd"
          ]
        }
      }
    },
    {
      "Effect": "Allow",
      "Action": [
        "log:GetProject",
        "log:ListProject",
        "log:ListLogStores",
        "log:GetLogstore"
      ],
      "Resource": "*"
    },
    {
      "Action": "ram:DeleteServiceLinkedRole",
      "Resource": "*",
      "Effect": "Allow",
      "Condition": {
        "StringEquals": {
          "ram:ServiceName": "flowlog.gws.aliyuncs.com"
        }
      }
    }
  ]
}

授权服务关联角色

在提示对话框中单击确认授权,即表示同意无影流日志功能借助服务关联角色 AliyunServiceRoleForGwsFlowLog 对流日志资源执行操作。

删除服务关联角色

为确保无影流日志功能正常使用,不建议删除服务关联角色 AliyunServiceRoleForGwsFlowLog。如确需删除,先清理依赖资源,再删除角色:

  • 确保无影账号下已没有任何无影流日志资源。

  • 通过阿里云访问控制控制台删除该服务关联角色,具体操作参见删除RAM角色。