更新时间:2024-05-11 GMT+08:00

VPC终端节点 VPCEP

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

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

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

如何使用这些元素编辑SCP自定义策略,请参考创建SCP

操作(Action)

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

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

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

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

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

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

表1 VPCEP支持的授权项

授权项

描述

访问级别

资源类型(*为必须)

条件键

vpcep:endpoints:create

授予指定服务创建VPC终端节点的权限。

write

endpoints *

  • vpcep:VpceServiceName
  • vpcep:VpceServiceOrgPath
  • vpcep:VpceServiceOwner

vpc *

-

routeTable

-

subnet

-

-

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

vpcep:endpoints:createInterface

授予指定服务创建接口型VPC终端节点的权限。

write

endpoints *

  • vpcep:VpceServiceName
  • vpcep:VpceServiceOrgPath
  • vpcep:VpceServiceOwner

subnet

vpcep:VpcId

-

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

vpcep:endpoints:delete

授予权限删除终端节点。

write

endpoints *

  • g:ResourceTag/<tag-key>
  • vpcep:VpceServiceName

vpcep:endpoints:list

授予查询终端节点列表。

list

endpoints *

-

-

g:EnterpriseProjectId

vpcep:endpoints:get

授予权限查询终端节点详情。

read

endpoints *

g:ResourceTag/<tag-key>

vpcep:endpoints:update

授予权限更新终端节点的白名单。

write

endpoints *

  • vpcep:VpceServiceName
  • vpcep:VpceServiceOrgPath
  • vpcep:VpceServiceOwner
  • g:ResourceTag/<tag-key>

routeTable

-

subnet

-

vpcep:endpoints:updateRouteTables

授予权限修改终端节点路由表。

write

endpoints *

g:ResourceTag/<tag-key>

routeTable *

-

vpcep:endpoints:updatePolicy

授予权限修改终端节点策略。

write

endpoints *

g:ResourceTag/<tag-key>

vpcep:endpoints:deletePolicy

授予权限删除终端节点策略。

write

endpoints *

g:ResourceTag/<tag-key>

vpcep:endpointServices:create

授予权限创建终端节点服务。

write

endpointServices *

vpcep:VpceServicePrivateDnsName

vpc *

-

-

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

vpcep:endpointServices:list

授予权限查询终端节点服务列表。

list

endpointServices *

-

-

g:EnterpriseProjectId

vpcep:endpointServices:get

授予权限查询终端节点服务详情。

read

endpointServices *

g:ResourceTag/<tag-key>

vpcep:endpointServices:update

授予权限修改终端节点服务。

write

endpointServices *

g:ResourceTag/<tag-key>

vpcep:endpointServices:delete

授予权限删除终端节点服务。

write

endpointServices *

g:ResourceTag/<tag-key>

vpcep:endpointServices:updateName

授予权限修改终端节点服务的名称。

write

endpointServices *

-

vpcep:endpointServices:describe

授予权限查询终端节点服务概要。

read

-

-

vpcep:endpointServices:listPublic

授予权限查询公共终端节点服务列表。

list

endpointServices *

-

vpcep:endpointServices:listPermissions

授予权限查询终端节点服务的白名单列表。

list

endpointServices *

-

vpcep:endpointServices:updatePermissions

授予权限批量添加或移除终端节点服务的白名单。

permission_management

endpointServices *

-

-

  • vpcep:VpceEndpointOrgPath
  • vpcep:VpceEndpointOwner

vpcep:endpointServices:createPermissions

授予权限批量添加终端节点服务的白名单。

permission_management

endpointServices *

-

-

  • vpcep:VpceEndpointOrgPath
  • vpcep:VpceEndpointOwner

vpcep:endpointServices:deletePermissions

授予权限批量移除终端节点服务的白名单。

permission_management

endpointServices *

-

vpcep:endpointServices:updatePermissionsDescription

授予权限更新终端节点服务白名单描述。

write

endpointServices *

-

vpcep:endpointServices:listConnections

授予权限查询连接终端节点服务的连接列表。

list

endpointServices *

-

vpcep:endpointServices:updateConnections

授予权限接受或拒绝终端节点的连接。

write

endpointServices *

-

vpcep:endpointServices:updateConnectionDescription

授予权限更新终端节点连接描述。

write

endpointServices *

-

vpcep::listResourceTags

授予权限根据标签查询资源实例。

list

endpoints

-

endpointServices

-

vpcep::updateResourceTags

授予权限为指定Endpoint Service或Endpoint批量添加或删除标签。

tagging

endpoints

-

endpointServices

-

vpcep::getProjectTags

授予权限查询租户资源标签。

read

endpoints

-

endpointServices

-

vpcep::getResourceTags

授予权限查询租户下某个资源标签。

read

endpoints

-

endpointServices

-

vpcep::listQuotas

授予权限查询用户的资源配额,包括终端节点服务和终端节点。

read

-

-

vpcep::listVersionDetails

授予权限查询VPC终端节点接口版本列表。

list

-

-

vpcep::listSpecifiedVersion

授予权限查询指定VPC终端节点接口版本信息。

list

-

-

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

表2 API与授权项的关系

API

对应的授权项

依赖的授权项

POST /v1/{project_id}/vpc-endpoints

vpcep:endpoints:create

-

POST /v2/{project_id}/interface-vpc-endpoints

vpcep:endpoints:createInterface

-

DELETE /v1/{project_id}/vpc-endpoints/{vpc_endpoint_id}

vpcep:endpoints:delete

-

GET /v1/{project_id}/vpc-endpoints

vpcep:endpoints:list

-

GET /v1/{project_id}/vpc-endpoints/{vpc_endpoint_id}

vpcep:endpoints:get

-

PUT /v1/{project_id}/vpc-endpoints/{vpc_endpoint_id}

vpcep:endpoints:update

-

PUT /v1/{project_id}/vpc-endpoints/{vpc_endpoint_id}/routetables

vpcep:endpoints:updateRouteTables

-

PUT /v1/{project_id}/vpc-endpoints/{vpc_endpoint_id}/policy

vpcep:endpoints:updatePolicy

-

DELETE /v1/{project_id}/vpc-endpoints/{vpc_endpoint_id}/policy

vpcep:endpoints:deletePolicy

-

POST /v1/{project_id}/vpc-endpoint-services

vpcep:endpointServices:create

-

GET /v1/{project_id}/vpc-endpoint-services

vpcep:endpointServices:list

-

GET /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}

vpcep:endpointServices:get

-

PUT /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}

vpcep:endpointServices:update

-

DELETE /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}

vpcep:endpointServices:delete

-

PUT /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/name

vpcep:endpointServices:updateName

-

GET /v1/{project_id}/vpc-endpoint-services/describe

vpcep:endpointServices:describe

-

GET /v1/{project_id}/vpc-endpoint-services/public

vpcep:endpointServices:listPublic

-

GET /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/permissions

vpcep:endpointServices:listPermissions

-

POST /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/permissions/action

vpcep:endpointServices:updatePermissions

-

POST /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/permissions/batch-create

vpcep:endpointServices:createPermissions

-

POST /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/permissions/batch-delete

vpcep:endpointServices:deletePermissions

-

PUT /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/permissions/{permission_id}

vpcep:endpointServices:updatePermissionsDescription

-

GET /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/connections

vpcep:endpointServices:listConnections

-

POST /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/connections/action

vpcep:endpointServices:updateConnections

-

PUT /v1/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/connections/description

vpcep:endpointServices:updateConnectionDescription

-

POST /v1/{project_id}/{resource_type}/resource_instances/action

vpcep::listResourceTags

-

POST /v1/{project_id}/{resource_type}/{resource_id}/tags/action

vpcep::updateResourceTags

-

GET /v1/{project_id}/{resource_type}/tags

vpcep::getProjectTags

-

GET /v1/{project_id}/{resource_type}/{resource_id}/tags

vpcep::getResourceTags

-

GET /v1/{project_id}/quotas

vpcep::listQuotas

-

GET /

vpcep::listVersionDetails

-

GET /{version}

vpcep::listSpecifiedVersion

-

资源类型(Resource)

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

VPCEP定义了以下可以在SCP的Resource元素中使用的资源类型。

表3 VPCEP支持的资源类型

资源类型

URN

endpoints

vpcep:<region>:<account-id>:endpoints:<endpoint-id>

endpointServices

vpcep:<region>:<account-id>:endpointServices:<endpoint-service-id>

条件(Condition)

条件(Condition)是SCP生效的特定条件,包括条件键运算符

  • 条件键表示SCP语句的Condition元素中的键值。根据适用范围,分为全局级条件键和服务级条件键。
    • 全局级条件键(前缀为g:)适用于所有操作,在鉴权过程中,云服务不需要提供用户身份信息,系统将自动获取并鉴权。详情请参见:全局条件键
    • 服务级条件键(前缀为服务缩写,如vpcep:)仅适用于对应服务的操作,详情请参见表4
    • 单值/多值表示API调用时请求中与条件关联的值数。单值条件键在API调用时的请求中最多包含一个值,多值条件键在API调用时请求可以包含多个值。例如:g:SourceVpce是单值条件键,表示仅允许通过某个VPC终端节点发起请求访问某资源,一个请求最多包含一个VPC终端节点ID值。g:TagKeys是多值条件键,表示请求中携带的所有标签的key组成的列表,当用户在调用API请求时传入标签可以传入多个值。
    • 运算符与条件键、条件值一起构成完整的条件判断语句,当请求信息满足该条件时,SCP才能生效。支持的运算符请参见:运算符

VPCEP定义了以下可以在SCP的Condition元素中使用的条件键,您可以使用这些条件键进一步细化SCP语句应用的条件。

表4 VPCEP支持的服务级条件键

服务级条件键

类型

单值/多值

说明

vpcep:VpceServiceName

string

单值

按照终端节点服务名称进行筛选。

vpcep:VpceServiceOwner

string

单值

按照终端节点服务所有者进行筛选。

vpcep:VpceServicePrivateDnsName

string

单值

按您传入的终端节点服DNS名称筛选访问权限。

vpcep:VpceServiceOrgPath

string

单值

按照终端节点服务所有者的组织路径进行筛选。

vpcep:VpceEndpointOrgPath

string

单值

按照终端节点所有者的组织路径进行筛选。

vpcep:VpceEndpointOwner

string

单值

按照终端节点所有者的账号进行筛选。

vpcep:VpcId

string

多值

根据指定的虚拟私有云资源ID过滤访问。