更新时间:2024-07-05 GMT+08:00
分享

云堡垒机 CBH

Organizations服务中的服务控制策略(Service Control Policies,以下简称SCP)可以使用这些授权项元素设置访问控制策略。

SCP不直接进行授权,只划定权限边界。将SCP绑定到组织单元或者成员账号时,并没有直接对组织单元或成员账号授予操作权限,而是规定了成员账号或组织单元包含的成员账号的授权范围。

本章节介绍组织服务中SCP使用的元素,这些元素包含了操作(Action)、资源(Resource)和条件(Condition)。

如何使用这些元素编辑SCP自定义策略,请参考创建SCP《组织服务用户指南》的“创建SCP”章节。

操作(Action)

操作(Action)即为SCP策略中支持的授权项。

  • “访问级别”列描述如何对操作进行分类(list、read和write等)。此分类可帮助您了解在SCP策略中相应操作对应的访问级别。
  • “资源类型”列指每个操作是否支持资源级权限。
    • 资源类型支持通配符号*表示所有。如果此列没有值(-),则必须在SCP策略语句的Resource元素中指定所有资源类型(“*”)。
    • 如果该列包含资源类型,则必须在具有该操作的语句中指定该资源的URN。
    • 资源类型列中必需资源在表中用星号(*)标识,表示使用此操作必须指定该资源类型。

    关于CBH定义的资源类型的详细信息请参见资源类型(Resource)

  • “条件键”列包括了可以在SCP策略语句的Condition元素中支持指定的键值。
    • 如果该授权项资源类型列存在值,则表示条件键仅对列举的资源类型生效。
    • 如果该授权项资源类型列没有值(-),则表示条件键对整个授权项生效。
    • 如果此列条件键没有值(-),表示此操作不支持指定条件键。

    关于CBH定义的条件键的详细信息请参见条件(Condition)

您可以在SCP策略语句的Action元素中指定以下CBH的相关操作。

表1 cbh支持的操作项

操作项

描述

访问级别

资源类型(*为必须)

条件键

cbh::listAvailableZones

授予查询服务可用区的权限。

list

-

-

cbh::getEcsQuota

授予查询ECS资源配额的权限。

read

-

-

cbh::getQuota

授予查询堡垒机实例配额的权限。

read

-

-

cbh::listSpecifications

授予查询堡垒机规格的权限。

list

-

-

cbh:instance:listInstances

授予查询堡垒机列表的权限。

list

cbh:<region>:<account-id>:instance:<instance-id> *

-

cbh:instance:getInstanceStatus

授予查询堡垒机状态的权限。

read

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:startInstance

授予启动堡垒机的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:stopInstance

授予关闭堡垒机的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:rebootInstance

授予重启堡垒机的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:upgradeInstance

授予升级堡垒机的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:loginInstance

授予以IAM用户登录堡垒机的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:resetInstancePassword

授予重置堡垒机密码的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:resetInstanceLoginMethod

授予重置堡垒机登录方式的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:deleteInstance

授予删除故障堡垒机的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:alterInstance

授予变更堡垒机的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:createInstance

授予创建堡垒机的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

-

-

  • g:EnterpriseProjectId
  • g:RequestTag/tag-key
  • g:TagKeys

cbh:instance:bindInstanceEip

授予为堡垒机绑定EIP的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:unbindInstanceEip

授予为堡垒机解绑EIP的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:updateInstanceSecurityGroup

授予更新堡垒机安全组的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh::operateAuthorization

授予创建或取消堡垒机服务委托授权的权限。

write

-

-

cbh::getAuthorization

授予获取租户给堡垒机服务委托授权信息的权限。

read

-

-

cbh::listTags

授予查询全部标签的权限。

list

-

-

cbh:instance:getInstanceTags

授予查询堡垒机实例资源的标签信息的权限。

read

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

cbh:instance:countInstancesByTag

授予统计符合标签条件的实例数量的权限。

list

cbh:<region>:<account-id>:instance:<instance-id> *

-

cbh:instance:listInstancesByTag

授予使用标签过滤实例的权限。

list

-

-

cbh:instance:operateInstanceTags

授予操作堡垒机实例资源标签的权限。

tagging

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/tag-key

-

  • g:RequestTag/tag-key
  • g:TagKeys

cbh:instance:getOmUrl

授予获取堡垒机内资产运维链接的权限。

read

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/<tag-key>

cbh:instance:rollbackInstance

授予回滚堡垒机的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/<tag-key>

cbh:instance:migrateInstanceTraffic

授予迁移堡垒机流量的权限。

write

cbh:<region>:<account-id>:instance:<instance-id> *

  • g:EnterpriseProjectId
  • g:ResourceTag/<tag-key>

cbh的API通常对应着一个或多个操作项。表2展示了API与操作项的关系,以及该API需要依赖的操作项。

表2 API与操作项的关系

API

对应的操作项

依赖的操作项

GET /v2/{project_id}/cbs/available-zone

cbh::listAvailableZones

-

cbh::getEcsQuota

ecs:cloudServerFlavors:get

cbh::getQuota

-

GET /v2/{project_id}/cbs/instance/specification

cbh::listSpecifications

-

GET /v2/{project_id}/cbs/instance/list

cbh:instance:listInstances

eps:enterpriseProjects:list

cbh:instance:getInstanceStatus

-

POST /v2/{project_id}/cbs/instance/start

cbh:instance:startInstance

-

POST /v2/{project_id}/cbs/instance/stop

cbh:instance:stopInstance

-

POST /v1/{project_id}/cbs/instance/reboot

cbh:instance:rebootInstance

-

POST /v2/{project_id}/cbs/instance/upgrade

cbh:instance:upgradeInstance

-

POST /v2/{project_id}/cbs/instance/login

cbh:instance:loginInstance

-

PUT /v2/{project_id}/cbs/instance/password

cbh:instance:resetInstancePassword

-

PUT /v2/{project_id}/cbs/instance/login-method

cbh:instance:resetInstanceLoginMethod

-

DELETE /v2/{project_id}/cbs/instance

cbh:instance:deleteInstance

-

cbh:instance:alterInstance

evs:quotas:get

POST /v2/{project_id}/cbs/instance

cbh:instance:createInstance

  • vpc:quotas:list
  • vpc:subnets:list
  • vpc:subnets:get
  • vpc:securityGroups:list
  • ecs:cloudServerFlavors:get

cbh:instance:bindInstanceEip

-

cbh:instance:unbindInstanceEip

-

PUT /v2/{project_id}/cbs/instance/{server_id}/security-groups

cbh:instance:updateInstanceSecurityGroup

vpc:ports:update

cbh::operateAuthorization

-

GET /v2/{project_id}/cbs/agency/authorization

cbh::getAuthorization

-

GET /v2/{project_id}/cbs/instance/tags

cbh::listTags

-

GET /v2/{project_id}/cbs/instance/{resource_id}/tags

cbh:instance:getInstanceTags

-

POST /v2/{project_id}/cbs/instance/count

cbh:instance:countInstancesByTag

-

POST /v2/{project_id}/cbs/instance/filter

cbh:instance:listInstancesByTag

-

cbh:instance:operateInstanceTags

-

POST /v2/{project_id}/cbs/instance/{server_id}/eip/bind

cbh:instance:bindInstanceEip

  • eip:publicIps:list
  • eip:publicIps:update

POST /v2/{project_id}/cbs/instance/{server_id}/eip/unbind

cbh:instance:unbindInstanceEip

  • eip:publicIps:update
  • eip:publicIps:list

GET /v2/{project_id}/cbs/instance/ecs-quota

cbh::getEcsQuota

ecs:cloudServerFlavors:get

GET /v2/{project_id}/cbs/instance/quota

cbh::getQuota

-

GET /v2/{project_id}/cbs/instance/{server_id}/status

cbh:instance:getInstanceStatus

-

POST /v2/{project_id}/cbs/instance/reboot

cbh:instance:rebootInstance

-

PUT /v2/{project_id}/cbs/instance

cbh:instance:alterInstance

-

POST /v2/{project_id}/cbs/agency/authorization

cbh::operateAuthorization

-

POST /v2/{project_id}/cbs/instance/{resource_id}/tags/action

cbh:instance:operateInstanceTags

-

GET /v2/{project_id}/cbs/instance/get-om-url

cbh:instance:getOmUrl

-

cbh:instance:migrateInstanceTraffic

-

POST /v2/{project_id}/cbs/instance/rollback

cbh:instance:rollbackInstance

-

资源类型(Resource)

资源类型(Resource)表示身份策略所作用的资源。如表3中的某些操作指定了可以在该操作指定的资源类型,则必须在具有该操作的身份策略语句中指定该资源的URN,身份策略仅作用于此资源;如未指定,Resource默认为“*”,则身份策略将应用到所有资源。您也可以在身份策略中设置条件,从而指定资源类型。

cbh定义了以下可以在自定义身份策略的Resource元素中使用的资源类型。

表3 cbh支持的资源类型

资源类型

URN

instance

cbh:<region>:<account-id>:instance:<instance-id>

条件(Condition)

cbh服务不支持在身份策略中的条件键中配置服务级的条件键。cbh可以使用适用于所有服务的全局条件键,请参考全局条件键

分享:

    相关文档

    相关产品