授權(quán)RAM用戶操作CloudLens for SLS
本文介紹如何授予RAM用戶操作CloudLens for SLS的權(quán)限。
前提條件
已創(chuàng)建RAM用戶。具體操作,請參見創(chuàng)建RAM用戶。
背景信息
您可以通過如下兩種方式為RAM用戶授予CloudLens for SLS的操作權(quán)限。
系統(tǒng)權(quán)限策略:權(quán)限范圍較大,用戶無法修改系統(tǒng)權(quán)限策略的內(nèi)容,但配置步驟簡單。
自定義權(quán)限策略:權(quán)限范圍更精細(xì),用戶可以修改自定義權(quán)限策略的內(nèi)容,配置步驟比系統(tǒng)權(quán)限策略更復(fù)雜。
系統(tǒng)權(quán)限策略
使用阿里云賬號(主賬號)或RAM管理員登錄RAM控制臺。
為RAM用戶授予日志服務(wù)的只讀權(quán)限
AliyunLogReadOnlyAccess
或管理權(quán)限AliyunLogFullAccess
。具體操作,請參見為RAM用戶授權(quán)。
自定義權(quán)限策略
使用阿里云賬號(主賬號)或RAM管理員登錄RAM控制臺。
創(chuàng)建權(quán)限策略。
您可以授予RAM用戶使用CloudLens for SLS的只讀權(quán)限或讀寫權(quán)限。
只讀權(quán)限
只允許查看CloudLens for SLS中的各個(gè)頁面。
在創(chuàng)建權(quán)限策略頁面,單擊腳本編輯頁簽,并使用以下腳本替換配置框中的原有內(nèi)容。具體操作,請參見通過腳本編輯模式創(chuàng)建自定義權(quán)限策略。
{ "Statement": [ { "Action": [ "log:GetLogStore", "log:ListLogStores", "log:GetIndex", "log:GetLogStoreHistogram", "log:GetLogStoreLogs", "log:GetDashboard", "log:ListDashboard", "log:ListSavedSearch", "log:GetProjectLogs" ], "Resource": [ "acs:log:*:*:project/*/logstore/*", "acs:log:*:*:project/*/dashboard/*", "acs:log:*:*:project/*/savedsearch/*" ], "Effect": "Allow" }, { "Action": "log:GetProductDataCollection", "Resource": "acs:log:*:*:project/*", "Effect": "Allow" }, { "Action": [ "log:ListCollectionPolicies" ], "Resource": "acs:log::*:collectionpolicy/*", "Effect": "Allow" }, { "Action": "log:ListProject", "Resource": "acs:log:*:*:project/*", "Effect": "Allow" } ], "Version": "1" }
讀寫權(quán)限
允許操作CloudLens for SLS中的各個(gè)功能。
在創(chuàng)建權(quán)限策略頁面,單擊腳本編輯頁簽,并使用以下腳本替換配置框中的原有內(nèi)容。具體操作,請參見通過腳本編輯模式創(chuàng)建自定義權(quán)限策略。
{ "Statement": [ { "Action": [ "log:GetLogStore", "log:ListLogStores", "log:GetIndex", "log:GetLogStoreHistogram", "log:GetLogStoreLogs", "log:GetDashboard", "log:ListDashboard", "log:ListSavedSearch", "log:CreateProject", "log:CreateLogStore", "log:CreateIndex", "log:UpdateIndex", "log:ListLogStores", "log:GetLogStore", "log:GetLogStoreLogs", "log:CreateDashboard", "log:CreateChart", "log:UpdateDashboard", "log:UpdateLogStore", "log:GetProjectLogs" ], "Resource": [ "acs:log:*:*:project/*/logstore/*", "acs:log:*:*:project/*/dashboard/*", "acs:log:*:*:project/*/savedsearch/*" ], "Effect": "Allow" }, { "Action": [ "log:GetProductDataCollection", "log:OpenProductDataCollection", "log:CloseProductDataCollection" ], "Resource": "acs:log:*:*:project/*", "Effect": "Allow" }, { "Action": "log:SetGeneralDataAccessConfig", "Resource": "acs:log:*:*:resource/sls.general_data_access.sls.global_conf.standard_channel/record", "Effect": "Allow" }, { "Action": "ram:CreateServiceLinkedRole", "Resource": "*", "Effect": "Allow", "Condition": { "StringEquals": { "ram:ServiceName": "audit.log.aliyuncs.com" } } }, { "Action": [ "log:ListCollectionPolicies", "log:UpsertCollectionPolicy", "log:DeleteCollectionPolicy" ], "Resource": "acs:log::*:collectionpolicy/*", "Effect": "Allow" }, { "Action": "log:ListProject", "Resource": "acs:log:*:*:project/*", "Effect": "Allow" } ], "Version": "1" }
為RAM用戶添加創(chuàng)建的自定義權(quán)限策略。具體操作,請參見為RAM用戶授權(quán)。