阿里云API网关(12)为员工创建子账号,实现分权管理API:使用RAM管理API
网关指南: https://help.aliyun.com/document_detail/29487.html?spm=5176.doc48835.6.550.23Oqbl
网关控制台: https://apigateway.console.aliyun.com/?spm=5176.doc42740.2.2.Q4z5ws#/cn-hangzhou/apis/list
使用RAM管理API
API 网关结合阿里云访问控制(RAM)来实现企业内多职员分权管理 API。API 提供者可以为员工建立子账户,并控制不同职员负责不同的 API 管理。
- 使用 RAM 可以允许子帐号,查看、创建、管理、删除 API 分组、API、授权、流控策略等。但子帐号不是资源的所有者,其操作权限随时都可以被主帐号收回。
- 在查看本文前,请确保您已经祥读了 RAM 帮助手册 和API 网关 API 手册.
- 若您不无此业务场景, 请跳过此章节。
第一部分:策略管理
授权策略(Policy),来描述授权的具体内容,授权内容主要包含效力( Effect )、资源( Resource )、对资源所授予的操作权限( Action )以及限制条件( Condition )这几个基本元素。
系统授权策略
API 网关已经预置了两个系统权限,AliyunApiGatewayFullAccess和AliyunApiGatewayReadOnlyAccess,可以到 RAM 的在 RAM 控制台-策略管理进行查看。
- AliyunApiGatewayFullAccess: 管理员权限,拥有主帐号下包含 API 分组、API、流控策略、应用等所有资源的管理权限。
- AliyunApiGatewayReadOnlyAccess:可以查看主帐号下包含 API 分组、API、流控策略、应用等所有资源,但不可以操作。
自定义授权策略
您可以根据需要自定义管理权限,支持更为精细化的授权,可以为某个操作,也可以是某个资源。如:API GetUsers 的编辑权限。可以在RAM 控制台-策略管理-自定义授权策略查看已经定义好的自定义授权:自定义授权查看、创建、修改、删除方法请参照:授权策略管理。
授权策略内容填写方法请参照:Policy 基本元素和Policy 语法结构和下文的授权策略。
第二部分:授权策略
授权策略是一组权限的集合,它以一种策略语言来描述。通过给用户或群组附加授权策略,用户或群组中的所有用户就能获得授权策略中指定的访问权限。
授权策略内容填写方法请参照:Policy 基本元素和 Policy 语法结构。
示例:
{"Version": "1","Statement": [{"Action": "apigateway:Describe*","Resource": "*","Effect": "Allow"}]}
此示例表示:允许所有的查看操作
Action(操作名称列表)格式为:
"Action":"<service-name>:<action-name>"
其中:
- service-name 为:阿里云产品名称,请填写 apigateway
- action-name 为:API 接口名称,请参照下表, 支持通配符 *
"Action": "apigateway:Describe*" 表示所有的查询操作" Action": "apigateway:*" 表示 API 网关所有操作
第三部分:Resource(操作对象列表)
Resource 通常指操作对象, API 网关中的 API 分组、流控策略、应用都被称为 Resource,书写格式:
acs:<service-name>:<region>:<account-id>:<relative-id>
其中:
- acs: Alibaba Cloud Service 的首字母缩写,表示阿里云的公有云平台
- service-name 为:阿里云产品名称,请填写 apigateway
- region: 地区信息,可以使用通配符*号来代替,*表示所有区域
- account-id: 账号 ID,比如 1234567890123456,也可以用*代替
- relative-id: 与 API 网关相关的资源描述部分,这部分的格式描述支持类似于一个文件路径的树状结构。
示例:
acs:apigateway:$regionid:$accountid:apigroup/$groupId
书写:
acs:apigateway:*:$accountid:apigroup/
请结合 API 网关的API 手册来查看下表
| action-name | 资源( Resource ) |
|---|---|
| AbolishApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| AddTrafficSpecialControl | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolid |
| CreateApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| CreateApiGroup | acs:apigateway:$regionid:$accountid:apigroup/* |
| CreateTrafficControl | acs:apigateway:$regionid:$accountid:trafficcontrol/* |
| DeleteAllTrafficSpecialControl | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolid |
| DeleteApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DeleteApiGroup | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DeleteDomain | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DeleteDomainCertificate | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DeleteTrafficControl | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId |
| DeleteTrafficSpecialControl | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId |
| DeployApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeApiError | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeApiGroupDetail | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeApiGroups | acs:apigateway:$regionid:$accountid:apigroup/* |
| DescribeApiLatency | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeApiQps | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeApiRules | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeApis | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeApisByRule | acs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId oracs:apigateway:$regionid:$accountid:secretkey/$secretKeyId |
| DescribeApiTraffic | acs:apigateway:$regionid:$accountid:apigroup/$groupid |
| DescribeAppsByApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| AddBlackList | acs:apigateway:$regionid:$accountid:blacklist/* |
| DescribeBlackLists | acs:apigateway:$regionid:$accountid:blacklist/* |
| DescribeDeployedApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeDeployedApis | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeDomain | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeDomainResolution | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeHistoryApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| DescribeHistoryApis | acs:apigateway:$regionid:$accountid:apigroup/* |
| DescribeRulesByApi | acs:apigateway:$regionid:$accountid:group/$groupId |
| DescribeSecretKeys | acs:apigateway:$regionid:$accountid:secretkey/* |
| DescribeTrafficControls | acs:apigateway:$regionid:$accountid:trafficcontrol/* |
| ModifyApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| ModifyApiGroup | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| ModifySecretKey | acs:apigateway:$regionid:$accountid:secretkey/$secretKeyId |
| RecoverApiFromHistorical | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| RefreshDomain | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| RemoveAccessPermissionByApis | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| RemoveAccessPermissionByApps | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| RemoveAllBlackList | acs:apigateway:$regionid:$accountid:blacklist/* |
| RemoveApiRule | acs:apigateway:$regionid:$accountid:apigroup/$groupId(acs:apigateway:$regionid:$accountid:secretkey/$secretKeyId oracs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId) |
| RemoveAppsFromApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| RemoveBlackList | acs:apigateway:$regionid:$accountid:blacklist/$blacklistid |
| SetAccessPermissionByApis | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| SetAccessPermissions | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| SetApiRule | acs:apigateway:$regionid:$accountid:apigroup/$groupId(acs:apigateway:$regionid:$accountid:secretkey/$secretKeyId oracs:apigateway:$regionid:$accountid:trafficcontrol/$trafficcontrolId) |
| SetDomain | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| SetDomainCertificate | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| SwitchApi | acs:apigateway:$regionid:$accountid:apigroup/$groupId |
| CreateSecretKey | acs:apigateway:$regionid:$accountid:secretkey/* |
| DeleteSecretKey | acs:apigateway:$regionid:$accountid:secretkey/$secretKeyId |
阿里云API网关(12)为员工创建子账号,实现分权管理API:使用RAM管理API的更多相关文章
- IPsecVPN:阿里云VPN网关和深信服防火墙打通公有云和公司内网
简介 目前许多公司网络环境为混合云(私有云,IDC,公司内网融合)的状态,通过内网ip的访问使得工作更加方便,需求也更为迫切,而本文介绍的即是实现私有云和公司内网互通的一种方法,希望对有此需求的小伙伴 ...
- 阿里云 Server (Ubuntu 12.04) 配置 FTP
来自 http://blog.csdn.net/zgrjkflmkyc/article/details/45510345 这个是阿里云的官方用户手册 http://bbs.aliyun.com/re ...
- 阿里云对象存储 OSS,不使用主账号,使用子账号来访问存储内容
https://help.aliyun.com/document_detail/31932.html?spm=5176.doc31929.2.5.R7sEzr 这个示例从一个没有任何Bucket的阿里 ...
- 阿里云php-7.2.12 安装
安装依赖 yum -y install libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml ...
- 阿里云学习之API网关
注:此处仅供api的创建做一个补充参考,API网关的优缺点及创建过程中的参数详情,请参考阿里云开放文档:https://helpcdn.aliyun.com/document_detail/29478 ...
- 阿里云API网关(11)API的三种安全认证方式
网关指南: https://help.aliyun.com/document_detail/29487.html?spm=5176.doc48835.6.550.23Oqbl 网关控制台: https ...
- 阿里云API网关(9)常见问题
网关指南: https://help.aliyun.com/document_detail/29487.html?spm=5176.doc48835.6.550.23Oqbl 网关控制台: https ...
- 阿里云API网关(7)开发指南-API参考
网关指南: https://help.aliyun.com/document_detail/29487.html?spm=5176.doc48835.6.550.23Oqbl 网关控制台: https ...
- 阿里云API网关(6)用户指南(开放 API )
网关指南: https://help.aliyun.com/document_detail/29487.html?spm=5176.doc48835.6.550.23Oqbl 网关控制台: https ...
随机推荐
- linux实验一 双系统安装
(一)首先来简要了解一些linux的概念! 1.发行版本和内核版本的区别与联系:linux发行版本是"内核版本+一系列挂载软件"的集合体,光是一个内核版本是无法当做操作系统运行的. ...
- 云计算之路-阿里云上:针对 docker swarm 故障的部署调整以及应急措施
针对这周 docker swarm 集群的频繁故障(详见故障一 .故障二.故障三),我们今天对 docker swarm 集群的部署进行了如下调整. 将 docker engine 由 “17.12 ...
- 微信小程序之swiper组件高度自适应
微信小程序之swiper组件高度自适应 要求: (顶部广告栏 ) 改变swiper组件的固定高度,使之随内部每张图片的高度做自适应 原理: 图片加载完之后,获取图片的原始宽高,根据宽高比,计算出适应后 ...
- 笔记:XML-解析文档-XPath 定位信息
如果需要定位某个XML文档中的一段特定信息,那么通过遍历DOM 树的众多节点来进行行查找显得有些麻烦,XPath语言使得访问树节点变得很容易,例如,下面的XML文档结构: <?xml versi ...
- Javscript的函数链式调用基础篇
我们都很熟悉jQuery了,只能jQuery中一种非常牛逼的写法叫链式操作: $('#div').css('background','#ccc').removeClass('box').stop(). ...
- git项目初始化
Command line instructions 1.Git global setup git config --global user.name "99176942"git c ...
- C语言第六周博客作业--数据类型
一.PTA实验作业 题目1: 7-6 掉入陷阱的数字 1. 本题PTA提交列表 2.设计思路 定义变量N,i,g=1表示位数,a表示各位数字相加的和,b=0,j,N1,c,d用于储存N do{ for ...
- Beta冲刺 第七天
Beta冲刺 第七天 昨天的困难 昨天的困难在一些多表查询上,不熟悉hibernate的套路,走了很多弯路. 第一次使用图表插件,在图表的显示问题上花了一定的时间. 对于页面绑定和后台数据自动填充的理 ...
- Java Collections API和泛型
Java Collections API和泛型 数据结构和算法 学会一门编程语言,你可以写出一些可以工作的代码用计算机来解决一些问题,然而想要优雅而高效的解决问题,就要学习数据结构和算法了.当然对数据 ...
- 转 Eclipse快捷键调试大全
(1)Ctrl+M --切换窗口的大小(2)Ctrl+Q --跳到最后一次的编辑处(3)F2 ---重命名类名 工程名 --当鼠标放在一个标记处出现Tooltip时候按F2则把鼠标移开时To ...