在使用云监控2.0服务时,不同的使用人员可能需要不同的访问权限,此时主账号使用者可以通过对RAM设置不同的权限策略来实现对云监控2.0的资源的访问控制。
权限策略类型
若您使用RAM,请根据需要向主账号使用者申请权限策略。授权操作请参考为RAM用户授权。
阿里云为用户提供了两类策略类型,分别是系统权限策略与自定义策略。
系统权限策略:由阿里云统一创建,使用更简单,无法修改。
自定义策略:需要用户自定义策略内容,若系统权限策略不能满足要求,可创建自定义权限策略实现最小授权,实现权限精细化管控。
系统权限策略
系统权限策略统一由阿里云创建,策略的版本更新由阿里云维护,用户只能使用不能修改。云监控2.0的系统权限策略如下:
AliyunCloudMonitorFullAccess:授予管理云监控的权限。
AliyunCloudMonitorReadOnlyAccess:授予只读访问云监控的权限。
自定义策略
自定义策略由用户管理,策略的版本更新由用户维护。用户可以自主创建、更新和删除自定义策略。当系统策略无法满足您的需求时,您可以通过创建自定义权限策略实现精细化权限管理。
您可以参考操作列表进行配置,相关操作如下:
操作类型 | 操作(Action) | 描述 |
读/查询操作 | cms:Get* | 获取云监控服务下的各类资源 |
列表操作 | cms:List* | 列出云监控服务下的各类资源 |
读/查询操作 | cms:GetAddonMetrics | 获取Addon的监控指标 |
读/查询操作 | cms:GetAddonCodeTemplate | 获取Addon的代码模板 |
列表操作 | cms:ListAddons | 列出Addon |
读/查询操作 | cms:GetAddonAlertTemplates | 获取Addon的告警模板 |
读/查询操作 | cms:GetAddonSchema | 获取Addon的结构定义 |
读/查询操作 | cms:GetAddon | 获取单个Addon的详细信息 |
列表操作 | cms:ListEventLabelCacheKeys | 列出事件标签的缓存键 |
列表操作 | cms:ListEventLabelCacheValues | 列出事件标签的缓存值 |
读/查询操作 | cms:DescribeMetricDataForAlertPreview | 查询用于告警预览的指标数据 |
检查操作 | cms:CheckDispatchRole | 检查分派角色是否有效 |
读/查询操作 | cms:GetPrometheusUserSetting | 获取Prometheus的用户设置 |
执行操作 | arms:DoInsightsAction | 执行ARMS洞察分析操作 |
读/查询操作 | arms:Describe* | 查询ARMS服务下各类资源的详细信息 |
列表操作 | arms:List* | 列出ARMS服务下的各类资源 |
读/查询操作 | arms:Get* | 获取ARMS服务下的各类资源 |
读/查询操作 | arms:Search* | 搜索ARMS服务下的各类资源 |
检查操作 | arms:Check* | 检查ARMS服务下的各类资源或状态 |
读/查询操作 | arms:Query* | 查询ARMS服务下的各类数据 |
读/查询操作 | xtrace:Read* | 读取可观测链路 OpenTelemetry 版 的相关数据 |
读/查询操作 | xtrace:Get* | 获取可观测链路 OpenTelemetry 版的相关资源 |
读/查询操作 | xtrace:Describe* | 查询可观测链路 OpenTelemetry 版的相关资源详情 |
读/查询操作 | log:Get* | 获取日志服务下的各类资源 |
列表操作 | log:List* | 列出日志服务下的各类资源 |
读/查询操作 | log:Query* | 查询日志服务下的各类资源 |
写操作 | log:CreateAgentInstanceConfig | 创建日志服务的Agent实例配置 |
写操作 | log:UpdateAgentInstanceConfig | 更新日志服务的Agent实例配置 |
读/查询操作 | log:GetAgentInstanceConfig | 获取日志服务的Agent实例配置 |
写操作 | log:DeleteAgentInstanceConfig | 删除日志服务的Agent实例配置 |
常见自定义权限策略场景及示例
授予RAM用户云监控2.0服务模块的读写权限,示例如下所示:
读权限
{
"Version": "1",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cms:Get*",
"cms:List*"
],
"Resource": [
"acs:cms:*:*:workspace/*",
"acs:cms:*:*:contactgroup/*",
"acs:cms:*:*:alertEventIntegrationPolicy/*",
"acs:cms:*:*:workspace/*/entitystore",
"acs:cms:*:*:cloudresource",
"acs:cms:*:*:workspace/*/umodel",
"acs:cms:*:*:ruminstance/*",
"acs:cms:*:*:cmsservice/*",
"acs:cms:*:*:alerthistory/*",
"acs:cms:*:*:prometheusview/*",
"acs:cms:*:*:contact/*",
"acs:cms:*:*:alertNotifyTemplate/*",
"acs:cms:*:*:alertruletemplate/*",
"acs:cms:*:*:alertmetricgroup/*",
"acs:cms:*:*:alertaction/*",
"acs:cms:*:*:webhook/*",
"acs:cms:*:*:oncallschedule/*",
"acs:cms:*:*:alertrule/*",
"acs:cms:*:*:alertmetric/*",
"acs:cms:*:*:subscription/*",
"acs:cms:*:*:prometheusinstance/*",
"acs:cms:*:*:biztrace/*",
"acs:cms:*:*:maintainWindow/*",
"acs:cms:*:*:integrationpolicy/*/addonrelease/*",
"acs:cms:*:*:prometheusinstance/*",
"acs:cms:*:*:notifyStrategy/*",
"acs:cms:*:*:entitygroup/*",
"acs:cms:*:*:integrationpolicy/*",
"acs:cms:*:*:robot/*",
"acs:cms:*:*:transformer/*"
]
},
{
"Effect": "Allow",
"Action": [
"cms:GetAddonMetrics",
"cms:GetAddonCodeTemplate",
"cms:ListAddons",
"cms:GetAddonAlertTemplates",
"cms:GetAddonSchema",
"cms:GetAddon",
"cms:ListEventLabelCacheKeys",
"cms:ListEventLabelCacheValues",
"cms:DescribeMetricDataForAlertPreview",
"cms:CheckDispatchRole",
"cms:GetPrometheusUserSetting"
],
"Resource": [
"*"
]
},
{
"Action": [
"arms:DoInsightsAction",
"arms:Describe*",
"arms:List*",
"arms:Get*",
"arms:Search*",
"arms:Check*",
"arms:Query*",
"xtrace:Read*",
"xtrace:Get*",
"xtrace:Describe*"
],
"Resource": "*",
"Effect": "Allow"
},
{
"Action": [
"log:Get*",
"log:List*",
"log:Query*"
],
"Resource": "*",
"Effect": "Allow"
}
]
}写权限
{
"Version": "1",
"Statement": [
{
"Action": "ram:CreateServiceLinkedRole",
"Resource": "*",
"Effect": "Allow",
"Condition": {
"StringEquals": {
"ram:ServiceName": "cloudmonitor.aliyuncs.com"
}
}
},
{
"Action": "cms:*",
"Resource": "*",
"Effect": "Allow"
},,
{
"Action": "arms:*",
"Resource": "*",
"Effect": "Allow"
},
{
"Action": "log:*",
"Resource": "*",
"Effect": "Allow"
}
]
}