訪問控制(RAM)是阿里云提供的管理用戶身份與資源訪問權限的服務。使用RAM可以讓您避免與其他用戶共享阿里云賬號密鑰,并可按需為用戶授予最小權限。RAM中使用權限策略描述授權的具體內容。
本文為您介紹日志服務(Sls)為RAM權限策略定義的操作(Action)、資源(Resource)和條件(Condition)。日志服務(Sls)的RAM代碼(RamCode)為[{"popCode":"Sls","ramCodes":["log"]}],支持的授權粒度為RESOURCE。
權限策略通用結構
權限策略支持JSON格式,其通用結構如下:
{
"Version": "1",
"Statement": [
{
"Effect": "<Effect>",
"Action": "<Action>",
"Resource": "<Resource>",
"Condition": {
"<Condition_operator>": {
"<Condition_key>": [
"<Condition_value>"
]
}
}
}
]
}
- Effect:權限策略效果。取值:Allow(允許)、Deny(拒絕)。
- Action:授予允許或拒絕權限的具體操作。具體信息,請參見操作(Action)。
- Resource:受操作影響的具體對象,您可以使用資源ARN來描述指定資源。具體信息,請參見資源(Resource)。
- Condition:指授權生效的條件。可選字段。具體信息,請參見條件(Condition)。
- Condition_operator:條件運算符,不同類型的條件對應不同的條件運算符。具體信息,請參見權限策略基本元素。
- Condition_key:條件關鍵字。
- Condition_value:條件關鍵字對應的值。
操作(Action)
下表是日志服務(Sls)定義的操作,這些操作可以在RAM權限策略語句的Action
元素中使用,用來授予執行該操作的權限。下面對表中的具體項提供說明:- 操作:是指具體的權限點。
- API:是指操作對應的API接口。
- 訪問級別:是指每個操作的訪問級別,取值為寫入(Write)、讀取(Read)或列出(List)。
- 資源類型:是指操作中支持授權的資源類型。具體說明如下:
- 對于必選的資源類型,用背景高亮的方式表示。
- 對于不支持資源級授權的操作,用
全部資源
表示。
- 條件關鍵字:是指云產品自身定義的條件關鍵字。該列不體現適用于任何操作的通用條件關鍵字。
- 關聯操作:是指成功執行操作所需要的其他權限。操作者必須同時具備關聯操作的權限,操作才能成功。
操作 | API | 訪問級別 | 資源類型 | 條件關鍵字 | 關聯操作 |
---|---|---|---|---|---|
log:ListConfig | ListConfig | list | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logtailconfig/* | log:TLSVersion | 無 |
log:GetLogtailPipelineConfig | GetLogtailPipelineConfig | get | 全部資源 * | log:TLSVersion | 無 |
log:UpdateProject | UpdateProject | update | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName} | log:TLSVersion | 無 |
log:GetMachineGroup | GetMachineGroup | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/machinegroup/{#MachineGroupName} | log:TLSVersion | 無 |
log:ListDomains | ListDomains | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/domain/* | log:TLSVersion | 無 |
log:GetCursorOrData | GetCursorTime | get | LogStore acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName} | log:TLSVersion | 無 |
log:GetAppliedMachineGroups | GetAppliedMachineGroups | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logtailconfig/{#LogtailConfigName} | log:TLSVersion | 無 |
log:ConsumerGroupHeartBeat | ConsumerGroupHeartBeat | none | 全部資源 * | log:TLSVersion | 無 |
log:GetDashboard | GetDashboard | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/dashboard/{#DashboardName} | log:TLSVersion | 無 |
log:UpdateLogtailPipelineConfig | UpdateLogtailPipelineConfig | update | 全部資源 * | log:TLSVersion | 無 |
log:UpdateDashboard | UpdateDashboard | update | 全部資源 * | log:TLSVersion | 無 |
log:UpdateConsumerGroup | UpdateConsumerGroup | update | LogStore acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#logstoreName}/consumergroup/{#ConsumerGroup} | log:TLSVersion | 無 |
log:GetLogStore | GetLogStore | get | LogStore acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/{#logstore} | log:TLSVersion | 無 |
log:ChangeResourceGroup | ChangeResourceGroup | update | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName} | log:TLSVersion | 無 |
log:CreateIndex | CreateIndex | create | LogStore acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/{#logstore} | log:TLSVersion | 無 |
log:ListTagResources | ListTagResources | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName} | log:TLSVersion | 無 |
log:GetAppliedConfigs | GetAppliedConfigs | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/machinegroup/{#MachineGroupName} | log:TLSVersion | 無 |
log:GetIndex | GetIndex | get | LogStore acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/{#logstore} | log:TLSVersion | 無 |
log:ListMachineGroup | ListMachineGroup | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/machinegroup/* | log:TLSVersion | 無 |
log:ListETLs | ListETLs | list | 全部資源 * | 無 | 無 |
log:GetLogStoreMeteringMode | GetLogStoreMeteringMode | get | 全部資源 * | 無 | 無 |
log:CreateLogStore | CreateLogStore | create | LogStore acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/{#logstoreName} | log:TLSVersion log:Encrypted | 無 |
log:UpdateIndex | UpdateIndex | update | LogStore acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/{#logstore} | log:TLSVersion | 無 |
log:GetConfig | GetConfig | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logtailconfig/{#LogtailConfigName} | log:TLSVersion | 無 |
log:ListLogStores | ListLogStores | get | LogStore acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/* | log:TLSVersion | 無 |
log:ConsumerGroupUpdateCheckPoint | ConsumerGroupUpdateCheckPoint | update | 全部資源 * | log:TLSVersion | 無 |
log:UpdateConfig | UpdateConfig | update | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logtailconfig/{#LogtailConfigName} | log:TLSVersion | 無 |
log:GetProject | GetProject | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName} | log:TLSVersion | 無 |
log:CreateSavedSearch | CreateSavedSearch | create | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/savedsearch/{#SavedSearchName} | log:TLSVersion | 無 |
log:CreateDashboard | CreateDashboard | create | 全部資源 * | log:TLSVersion | 無 |
log:GetLogging | GetLogging | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logging | log:TLSVersion | 無 |
log:CreateLogging | CreateLogging | create | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logging | log:TLSVersion | 無 |
log:ListProject | ListProject | get | Project acs:log:{#regionId}:{#accountId}:project/* | log:TLSVersion | 無 |
log:ListConsumerGroup | ListConsumerGroup | get | LogStore acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName}/consumergroup/* | log:TLSVersion | 無 |
log:CreateMachineGroup | CreateMachineGroup | create | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/machinegroup/{#MachineGroupName} | log:TLSVersion | 無 |
log:CreateConfig | CreateConfig | create | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logtailconfig/{#LogtailConfigName} | log:TLSVersion | 無 |
log:ListShards | ListShards | get | LogStore acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName} | log:TLSVersion | 無 |
log:GetETL | GetETL | get | 全部資源 * | 無 | 無 |
log:UpdateSavedSearch | UpdateSavedSearch | update | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/savedsearch/{#SavedSearchName} | log:TLSVersion | 無 |
log:ListSavedSearch | ListSavedSearch | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/savedsearch/* | log:TLSVersion | 無 |
log:UpdateLogStore | UpdateLogStore | update | LogStore acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/{#logstore} | log:TLSVersion log:Encrypted | 無 |
log:DeleteProject | DeleteProject | delete | Project acs:log:{#regionId}:{#accountId}:project/{#project} | log:TLSVersion | 無 |
log:CreateConsumerGroup | CreateConsumerGroup | create | LogStore acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#logstoreName}/consumergroup/{#ConsumerGroup} | log:TLSVersion | 無 |
log:GetSqlInstance | GetSqlInstance | none | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName} | 無 | 無 |
log:ListMachines | ListMachines | get | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/machinegroup/{#MachineGroupName} | log:TLSVersion | 無 |
log:GetCursorOrData | GetCursor | get | LogStore acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName} | log:TLSVersion | 無 |
log:CreateProject | CreateProject | create | Project acs:log:{#regionId}:{#accountId}:project/{#projectName} | log:TLSVersion | 無 |
log:ListDashboard | ListDashboard | list | Project acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/dashboard/* | log:TLSVersion | 無 |
資源(Resource)
下表是日志服務(Sls)定義的資源,這些資源可以在RAM權限策略語句的Resource
元素中使用,用來授予對該資源執行具體操作的權限。 其中,資源ARN是資源在阿里云上的唯一標識。具體說明如下:{#}
為變量標識,需要您替換為實際值。例如:{#ramcode}
需要您替換為實際的云服務RAM代碼。-
*
表示全部。例如:{#resourceType}
為*
時:表示全部資源。{#regionId}
為*
時:表示全部地域。{#accountId}
為*
時:表示全部阿里云賬號。
資源類型 | 資源ARN |
---|---|
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logtailconfig/* |
CollectionPolicy | acs:log::{#accountId}:collectionpolicy/{#policyName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logtailconfig/{#LogtailConfigName} |
Service | acs:log::{#AccountId}:service |
LogStore | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName} |
LogStore | acs:log:*:{#accountId}:project/{ProjectName}/logstore/{#LogstoreName} |
AgentInstanceConfig | acs:log:{#regionId}:{#accountId}:agentinstanceconfig/{#configName} |
IngestProcessor | acs:log:{#regionId}:{#accountId}:project/{#project}/ingestprocessor/{#processorName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/machinegroup/{#MachineGroupName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/dashboard/{DashboardName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}//dashboard/{#DashboardName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/domain/* |
Dashboard | acs:log::{#accountId}:project/{#projectName}/dashboard/{#dashboardId} |
ExternalStore | acs:log:{#regionId}:{#accountId}:externalstore/{#ProjectName}/{#ExternalStoreName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logtailconfig/{#LogtailConfigName} |
Region | acs:log:{#regionId}:{#accountId}:* |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/externalstore/{#ExternalStoreName} |
LogStore | acs:log:${regionId}:${accountId}:project/{#ProjectName}/logstore/{#LogstoreName}/consumergroup/{#ConsumerGroupName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/dashboard/{#DashboardName} |
Ticket | acs:log::{#accountId}:ticket/* |
AgentInstanceConfig | acs:log:{#regionId}:{#accountId}:agentinstanceconfig/* |
LogStore | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#logstoreName}/consumergroup/{#ConsumerGroup} |
LogStore | acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/{#logstore} |
MetricStore | acs:log:{#regionId}:{#accountId}:project/{#project}/metricstore/{#name} |
CollectionPolicy | acs:log::{#accountId}:collectionpolicy/* |
MetricStore | acs:log:{#regionId}:{#accountId}:project/{#project}/metricstore/* |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logging |
ProcessConfig | acs:log:{#regionId}:{#accountId}:processconfig/* |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/machinegroup/* |
UnifiedObservabilityModel | acs:log:{#regionId}:{#accountId}:UnifiedObservabilityModel/{#instanceId} |
LogStore | acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/{#logstoreName} |
Dashboard | acs:log::{#accountId}:project/* |
UnifiedObservabilityModel | acs:log:{#regionId}:{#accountId}:UnifiedObservabilityModel/* |
ConsumeProcessor | acs:log:{#regionId}:{#accountId}:project/{#project}/consumeprocessor/{#processorName} |
LogStore | acs:log:{#regionId}:{#accountId}:project/{#project}/logstore/* |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/domain/{#DomainName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/savedsearch/{#SavedSearchName} |
LogStore | acs:log:*:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName} |
Project | acs:log:{#Region}:{#AccountId}:project/{#ProjectName} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/dashboard/{#DashboardName} |
Project | acs:log:{#regionId}:{#accountId}:project/* |
LogStore | acs:log:{#Region}:{#AccountId}:project/{#ProjectName}/logstore/{#LogstoreName} |
LogStore | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{#LogstoreName}/consumergroup/* |
ConsumeProcessor | acs:log:{#regionId}:{#accountId}:project/{#project}/consumeprocessor/* |
LogStore | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/logstore/{l#ogstoreName}/consumergroup/{#ConsumerGroup} |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/machinegroup/{MachineGroup} |
Alert | acs:log:{#regionId}:{#accountId}:project/{#project}/alert/* |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/savedsearch/* |
Project | acs:log:{#regionId}:{#accountId}:project/{#project} |
IngestProcessor | acs:log:{#regionId}:{#accountId}:project/{#project}/ingestprocessor/* |
Project | acs:log:{#regionId}:{#accountId}:project/{#ProjectName}/dashboard/* |
MetricStore | acs:log:{#regionId}:{#accountId}:project/{#project}/metricstore/{#metricstore} |