VPC终端节点 VPCEP
云服务在IAM预置了常用的权限,称为系统身份策略。如果IAM系统身份策略无法满足授权要求,管理员可以根据各服务支持的授权项,创建IAM自定义身份策略来进行精细的访问控制,IAM自定义身份策略是对系统身份策略的扩展和补充。
除IAM服务外,Organizations服务中的服务控制策略(Service Control Policy,以下简称SCP)也可以使用这些授权项元素设置访问控制策略。
SCP不直接进行授权,只划定权限边界。将SCP绑定到组织单元或者成员账号时,并没有直接对组织单元或成员账号授予操作权限,而是规定了成员账号或组织单元包含的成员账号的授权范围。IAM身份策略授予权限的有效性受SCP限制,只有在SCP允许范围内的权限才能生效。
IAM服务与Organizations服务在使用这些元素进行访问控制时,存在着一些区别,详情请参见:IAM服务与Organizations服务权限访问控制的区别。
本章节介绍IAM服务身份策略授权场景中自定义身份策略和组织服务中SCP使用的元素,这些元素包含了操作(Action)、资源(Resource)和条件(Condition)。
操作(Action)
操作(Action)即为身份策略中支持的授权项。
- “访问级别”列描述如何对操作进行分类(List、Read和Write等)。此分类可帮助您了解在身份策略中相应操作对应的访问级别。
- “资源类型”列指每个操作是否支持资源级权限。
- 资源类型支持通配符号*表示所有。如果此列没有值(-),则必须在身份策略语句的Resource元素中指定所有资源类型(“*”)。
- 如果该列包含资源类型,则必须在具有该操作的语句中指定该资源的URN。
- 资源类型列中必需资源在表中用星号(*)标识,表示使用此操作必须指定该资源类型。
关于VPCEP定义的资源类型的详细信息请参见资源类型(Resource)。
- “条件键”列包括了可以在身份策略语句的Condition元素中支持指定的键值。
- 如果该授权项资源类型列存在值,则表示条件键仅对列举的资源类型生效。
- 如果该授权项资源类型列没有值(-),则表示条件键对整个授权项生效。
- 如果此列条件键没有值(-),表示此操作不支持指定条件键。
关于VPCEP定义的条件键的详细信息请参见条件(Condition)。
- “别名”列包括了可以在身份策略中配置的策略授权项。通过这些授权项,可以控制支持策略授权的API访问。详细信息请参见身份策略兼容性说明。
您可以在身份策略语句的Action元素中指定以下VPCEP的相关操作。
授权项 | 描述 | 访问级别 | 资源类型(*为必须) | 条件键 | 别名 |
|---|---|---|---|---|---|
vpcep:endpoints:create | 授予指定服务创建VPC终端节点的权限。 | Write | endpoints * | - | |
vpc * | - | ||||
routeTable | - | ||||
subnet | - | ||||
- | |||||
vpcep:endpoints:delete | 授予权限删除终端节点。 | Write | endpoints * | - | |
vpcep:endpoints:list | 授予查询终端节点列表。 | List | endpoints * | - | - |
- | |||||
vpcep:endpoints:get | 授予权限查询终端节点详情。 | Read | endpoints * | - | |
vpcep:endpoints:update | 授予权限更新终端节点的白名单。 | Write | endpoints * | - | |
routeTable | - | ||||
subnet | - | ||||
vpcep:endpoints:upgrade | 升级终端节点为专业型终端节点。 | Write | endpoints * | - | |
vpcep:endpoints:updateRouteTables | 授予权限修改终端节点路由表。 | Write | endpoints * |
| |
routeTable * | - | ||||
vpcep:endpoints:updatePolicy | 授予权限修改终端节点策略。 | Write | endpoints * |
| |
vpcep:endpoints:deletePolicy | 授予权限删除终端节点策略。 | Write | endpoints * |
| |
vpcep:endpointServices:create | 授予权限创建终端节点服务。 | Write | endpointServices * |
| |
vpc * | - | ||||
- | |||||
vpcep:endpointServices:list | 授予权限查询终端节点服务列表。 | List | endpointServices * | - |
|
- | |||||
vpcep:endpointServices:get | 授予权限查询终端节点服务详情。 | Read | endpointServices * |
| |
vpcep:endpointServices:update | 授予权限修改终端节点服务。 | Write | endpointServices * |
| |
vpcep:endpointServices:delete | 授予权限删除终端节点服务。 | Write | endpointServices * |
| |
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:endpointServices:createPermissions | 授予权限批量添加终端节点服务的白名单。 | Permission_management | endpointServices * | - |
|
- | |||||
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::listQuotas | 授予权限查询用户的资源配额,包括终端节点服务和终端节点。 | Read | - | - |
|
vpcep::listVersionDetails | 授予权限查询VPC终端节点接口版本列表。 | List | - | - | - |
vpcep::listSpecifiedVersion | 授予权限查询指定VPC终端节点接口版本信息。 | List | - | - | - |
VPCEP的API通常对应着一个或多个授权项。表2展示了API与授权项的关系,以及该API需要依赖的授权项。
API | 对应的授权项 | 依赖的授权项 |
|---|---|---|
POST /v1/{project_id}/vpc-endpoints | vpcep:endpoints:create | - |
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}/quotas | vpcep::listQuotas | - |
GET / | vpcep::listVersionDetails | - |
GET /{version} | vpcep::listSpecifiedVersion | - |
POST /v2/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/add-server-resources | vpcep:endpointServices:update | - |
POST /v2/{project_id}/vpc-endpoint-services/{vpc_endpoint_service_id}/remove-server-resources | vpcep:endpointServices:update | - |
POST /v2/{project_id}/vpc-endpoints/{vpc_endpoint_id}/add-availability-zones | vpcep:endpointServices:updateConnections | - |
POST /v2/{project_id}/vpc-endpoints/{vpc_endpoint_id}/remove-availability-zones | vpcep:endpointServices:updateConnections | - |
资源类型(Resource)
资源类型(Resource)表示身份策略所作用的资源。如表3中的某些操作指定了可以在该操作指定的资源类型,则必须在具有该操作的身份策略语句中指定该资源的URN,身份策略仅作用于此资源;如未指定,Resource默认为“*”,则身份策略将应用到所有资源。您也可以在身份策略中设置条件,从而指定资源类型。
VPCEP定义了以下可以在自定义身份策略的Resource元素中使用的资源类型。
资源类型 | URN |
|---|---|
routeTable | vpc:<region>:<account-id>:routeTable:<route-table-id> |
vpc | vpc:<region>:<account-id>:vpc:<vpc-id> |
endpointServices | vpcep:<region>:<account-id>:endpointServices:<endpoint-service-id> |
subnet | vpc:<region>:<account-id>:subnet:<subnet-id> |
endpoints | vpcep:<region>:<account-id>:endpoints:<endpoint-id> |
条件(Condition)
条件键概述
条件(Condition)是身份策略生效的特定条件,包括条件键和运算符。
- 条件键表示身份策略语句的Condition元素中的键值。根据适用范围,分为全局级条件键和服务级条件键。
- 全局级条件键(前缀为g:)适用于所有操作,在鉴权过程中,云服务不需要提供用户身份信息,系统将自动获取并鉴权。详情请参见:全局条件键。
- 服务级条件键(前缀通常为服务缩写,如vpcep:)仅适用于对应服务的操作,详情请参见表4。
- 单值/多值表示API调用时请求中与条件关联的值数。单值条件键在API调用时的请求中最多包含一个值,多值条件键在API调用时请求可以包含多个值。例如:g:SourceVpce是单值条件键,表示仅允许通过某个VPC终端节点发起请求访问某资源,一个请求最多包含一个VPC终端节点ID值。g:TagKeys是多值条件键,表示请求中携带的所有标签的key组成的列表,当用户在调用API请求时传入标签可以传入多个值。
- 运算符与条件键、条件值一起构成完整的条件判断语句,当请求信息满足该条件时,身份策略才能生效。支持的运算符请参见:运算符。
VPCEP支持的服务级条件键
VPCEP定义了以下可以在自定义身份策略的Condition元素中使用的条件键,您可以使用这些条件键进一步细化身份策略语句应用的条件。
服务级条件键 | 类型 | 单值/多值 | 说明 |
|---|---|---|---|
vpcep:VpceServiceName | string | 单值 | 按照终端节点服务名称进行筛选。 |
vpcep:VpceServiceOwner | string | 单值 | 按照终端节点服务所有者进行筛选。 |
vpcep:VpceServicePrivateDnsName | string | 单值 | 按您传入的终端节点服DNS名称筛选访问权限。 |
vpcep:VpceServiceOrgPath | string | 单值 | 按照终端节点服务所有者的组织路径进行筛选。 |
vpcep:VpceEndpointOrgPath | string | 多值 | 按照终端节点所有者的组织路径进行筛选。 |
vpcep:VpceEndpointOwner | string | 多值 | 按照终端节点所有者的账号进行筛选。 |

