存取控制(RAM)是阿里雲提供的系統管理使用者身份與資源存取權限的服務。使用 RAM 可以讓您避免與其他使用者共用阿里雲帳號密鑰,並可按需為使用者授予最小許可權。RAM 中使用權限原則描述授權的具體內容。
本文為您介紹 為 RAM 權限原則定義的操作(Action)、資源(Resource)和條件(Condition)。 的 RAM 代碼(RamCode)為 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)
下表是定義的操作,這些操作可以在 RAM 權限原則語句的Action元素中使用,用來授予執行該操作的許可權。下面對錶中的具體項提供說明:
操作:是指具體的許可權點。
API:是指操作對應的 API 介面。
存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。
資源類型:是指操作中支援授權的資源類型。具體說明如下:
對於必選的資源類型,用前面加 * 表示。
對於不支援資源級授權的操作,用
全部資源表示。
條件關鍵字:是指雲產品自身定義的條件關鍵字。該列不體現適用於任何操作的通用條件關鍵字。
關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。
|
操作 |
API |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
| log:EnableScheduledSQL | EnableScheduledSQL | none |
*All Resource
|
無 | 無 |
| log:GetStoreViewIndex | GetStoreViewIndex | get |
*All Resource
|
無 | 無 |
| log:UpdateLogStore | UpdateLogStore | update |
*LogStore
|
log:TLSVersion log:Encrypted |
無 |
| log:UntagResources | UntagResources | delete |
*Project
|
log:TLSVersion |
無 |
| log:GetAlert | GetAlert | get |
*All Resource
|
無 | 無 |
| log:CreateConfig | CreateConfig | create |
*Project
|
log:TLSVersion |
無 |
| log:GetLogtailPipelineConfig | GetLogtailPipelineConfig | get |
*All Resource
|
log:TLSVersion |
無 |
| log:ListETLs | ListETLs | list |
*All Resource
|
無 | 無 |
| log:DeleteLogging | DeleteLogging | delete |
*Project
|
log:TLSVersion |
無 |
| log:CreateDashboard | CreateDashboard | create |
*All Resource
|
log:TLSVersion |
無 |
| log:GetMachineGroup | GetMachineGroup | get |
*Project
|
log:TLSVersion |
無 |
| log:ListMachines | ListMachines | get |
*Project
|
log:TLSVersion |
無 |
| log:CreateMachineGroup | CreateMachineGroup | create |
*Project
|
log:TLSVersion |
無 |
| log:UpdateProject | UpdateProject | update |
*Project
|
log:TLSVersion |
無 |
| log:ListOSSIngestions | ListOSSIngestions | list |
*All Resource
|
無 | 無 |
| log:GetCursorOrData | GetCursorTime | get |
*LogStore
|
log:TLSVersion |
無 |
| log:ListDashboard | ListDashboard | list |
*Project
|
log:TLSVersion |
無 |
| log:CreateLogging | CreateLogging | create |
*Project
|
log:TLSVersion |
無 |
| log:UpdateMachineGroup | UpdateMachineGroup | update |
*Project
|
log:TLSVersion |
無 |
| log:CreateDomain | CreateDomain | create |
*Project
|
log:TLSVersion |
無 |
| log:ListConsumerGroup | ListConsumerGroup | get |
*LogStore
|
log:TLSVersion |
無 |
| log:GetScheduledSQL | GetScheduledSQL | get |
*All Resource
|
無 | 無 |
| log:GetSavedSearch | GetSavedSearch | get |
*Project
|
log:TLSVersion |
無 |
| log:DeleteLogStore | DeleteLogStore | delete |
*LogStore
|
log:TLSVersion |
無 |
| log:EnableAlert | EnableAlert | none |
*All Resource
|
無 | 無 |
| log:UpdateLogging | UpdateLogging | update |
*Project
|
log:TLSVersion |
無 |
| log:CreateLogtailPipelineConfig | CreateLogtailPipelineConfig | create |
*All Resource
|
log:TLSVersion |
無 |
| log:UpdateConsumerGroup | UpdateConsumerGroup | update |
*LogStore
|
log:TLSVersion |
無 |
| log:UpdateConfig | UpdateConfig | update |
*Project
|
log:TLSVersion |
無 |
| log:GetSqlInstance | GetSqlInstance | none |
*Project
|
無 | 無 |
| log:GetLogStore | GetLogStore | get |
*LogStore
|
log:TLSVersion |
無 |
| log:GetLogging | GetLogging | get |
*Project
|
log:TLSVersion |
無 |
| log:ListLogtailPipelineConfig | ListLogtailPipelineConfig | list |
*All Resource
|
log:TLSVersion |
無 |
| log:ChangeResourceGroup | ChangeResourceGroup | update |
*Project
|
log:TLSVersion |
無 |
| log:GetConfig | GetConfig | get |
*Project
|
log:TLSVersion |
無 |
| log:ListScheduledSQLs | ListScheduledSQLs | none |
*All Resource
|
無 | 無 |
| log:UpdateLogStoreMeteringMode | UpdateLogStoreMeteringMode | update |
*All Resource
|
log:TLSVersion |
無 |
| log:DeleteMachineGroup | DeleteMachineGroup | delete |
*Project
|
log:TLSVersion |
無 |
| log:GetStoreView | GetStoreView | get |
*All Resource
|
無 | 無 |
| log:GetIndex | GetIndex | get |
*LogStore
|
log:TLSVersion |
無 |
| log:DeleteProject | DeleteProject | delete |
*Project
|
log:TLSVersion |
無 |
| log:GetLogStoreMeteringMode | GetLogStoreMeteringMode | get |
*All Resource
|
無 | 無 |
| log:UpdateAlert | UpdateAlert | update |
*All Resource
|
無 | 無 |
| log:DeleteDashboard | DeleteDashboard | delete |
*All Resource
|
log:TLSVersion |
無 |
| log:CreateScheduledSQL | CreateScheduledSQL | create |
*All Resource
|
無 | 無 |
| log:ListShards | ListShards | get |
*LogStore
|
log:TLSVersion |
無 |
| log:DeleteDomain | DeleteDomain | delete |
*Project
|
log:TLSVersion |
無 |
| log:ConsumerGroupUpdateCheckPoint | ConsumerGroupUpdateCheckPoint | update |
*All Resource
|
log:TLSVersion |
無 |
| log:CreateAlert | CreateAlert | create |
*All Resource
|
無 | 無 |
| log:GetAppliedMachineGroups | GetAppliedMachineGroups | get |
*Project
|
log:TLSVersion |
無 |
| log:ListOSSHDFSExports | ListOSSHDFSExports | list |
*All Resource
|
無 | 無 |
| log:DeleteSavedSearch | DeleteSavedSearch | delete |
*Project
|
log:TLSVersion |
無 |
| log:ApplyConfigToGroup | ApplyConfigToMachineGroup | update |
*Project
*Project
|
log:TLSVersion |
無 |
| log:ListDownloadJobs | ListDownloadJobs | list |
*All Resource
|
無 | 無 |
| log:UpdateIndex | UpdateIndex | update |
*LogStore
|
log:TLSVersion |
無 |
| log:DeleteIndex | DeleteIndex | delete |
*LogStore
|
log:TLSVersion |
無 |
| log:DisableScheduledSQL | DisableScheduledSQL | none |
*All Resource
|
無 | 無 |
| log:GetCursorOrData | GetCursor | get |
*LogStore
|
log:TLSVersion |
無 |
| log:DeleteConsumerGroup | DeleteConsumerGroup | delete |
*LogStore
|
log:TLSVersion |
無 |
| log:DeleteConfig | DeleteConfig | delete |
*All Resource
|
log:TLSVersion |
無 |
| log:MergeShard | MergeShard | update |
*LogStore
|
log:TLSVersion |
無 |
| log:CreateConsumerGroup | CreateConsumerGroup | create |
*LogStore
|
log:TLSVersion |
無 |
| log:UpdateDashboard | UpdateDashboard | update |
*Project
|
log:TLSVersion |
無 |
| log:CreateSavedSearch | CreateSavedSearch | create |
*Project
|
log:TLSVersion |
無 |
| log:CreateSqlInstance | CreateSqlInstance | create |
*Project
|
無 | 無 |
| log:CreateLogStore | CreateLogStore | create |
*LogStore
|
log:TLSVersion log:Encrypted |
無 |
| log:GetETL | GetETL | get |
*All Resource
|
無 | 無 |
| log:CreateStoreView | CreateStoreView | create |
*All Resource
|
無 | 無 |
| log:PutProjectPolicy | PutProjectPolicy | create |
*All Resource
|
log:TLSVersion |
無 |
| log:UpdateSqlInstance | UpdateSqlInstance | update |
*Project
|
無 | 無 |
| log:GetDashboard | GetDashboard | get |
*Project
|
log:TLSVersion |
無 |
| log:ListTagResources | ListTagResources | get |
*Project
|
log:TLSVersion |
無 |
| log:ConsumerGroupHeartBeat | ConsumerGroupHeartBeat | none |
*All Resource
|
log:TLSVersion |
無 |
| log:CreateMetricStore | CreateMetricStore | create |
*MetricStore
|
無 | 無 |
| log:DeleteProjectPolicy | DeleteProjectPolicy | delete |
*All Resource
|
log:TLSVersion |
無 |
| log:UpdateSavedSearch | UpdateSavedSearch | update |
*Project
|
log:TLSVersion |
無 |
| log:ListDomains | ListDomains | get |
*Project
|
log:TLSVersion |
無 |
| log:UpdateMachineGroupMachine | UpdateMachineGroupMachine | update |
*All Resource
|
log:TLSVersion |
無 |
| log:DeleteScheduledSQL | DeleteScheduledSQL | delete |
*All Resource
|
無 | 無 |
| log:GetAppliedConfigs | GetAppliedConfigs | get |
*Project
|
log:TLSVersion |
無 |
| log:UpdateScheduledSQL | UpdateScheduledSQL | update |
*All Resource
|
無 | 無 |
| log:TagResources | TagResources | create |
*Project
|
log:TLSVersion |
無 |
| log:DeleteStoreView | DeleteStoreView | delete |
*All Resource
|
無 | 無 |
| log:ListSavedSearch | ListSavedSearch | get |
*Project
|
log:TLSVersion |
無 |
| log:UpdateLogtailPipelineConfig | UpdateLogtailPipelineConfig | update |
*All Resource
|
log:TLSVersion |
無 |
| log:CreateProject | CreateProject | create |
*Project
|
log:TLSVersion |
無 |
| log:ListOSSExports | ListOSSExports | list |
*All Resource
|
無 | 無 |
| log:UpdateStoreView | UpdateStoreView | update |
*All Resource
|
無 | 無 |
| log:ListMachineGroup | ListMachineGroup | get |
*Project
|
log:TLSVersion |
無 |
| log:ListConfig | ListConfig | list |
*Project
|
log:TLSVersion |
無 |
| log:GetProjectPolicy | GetProjectPolicy | get |
*All Resource
|
log:TLSVersion |
無 |
| log:SplitShard | SplitShard | update |
*LogStore
|
log:TLSVersion |
無 |
| log:ListStoreViews | ListStoreViews | list |
*All Resource
|
無 | 無 |
| log:ListLogStores | ListLogStores | get |
*LogStore
|
log:TLSVersion |
無 |
| log:ListAlerts | ListAlerts | list |
*Alert
|
無 | 無 |
| log:DisableAlert | DisableAlert | none |
*All Resource
|
無 | 無 |
| log:DeleteAlert | DeleteAlert | delete |
*All Resource
|
無 | 無 |
| log:GetProject | GetProject | get |
*Project
|
log:TLSVersion |
無 |
| log:CreateIndex | CreateIndex | create |
*LogStore
|
log:TLSVersion |
無 |
| log:ListProject | ListProject | get |
*Project
|
log:TLSVersion |
無 |
資源(Resource)
下表是定義的資源,這些資源可以在 RAM 權限原則語句的Resource元素中使用,用來授予對該資源執行具體操作的許可權。 其中,資源 ARN 是資源在阿里雲上的唯一標識。具體說明如下:
{#}為變數標識,需要您替換為實際值。例如:{#ramcode}需要您替換為實際的雲端服務RAM代碼。*表示全部。例如:{#resourceType}為*時:表示全部資源。{#regionId}為*時:表示全部地區。{#accountId}為*時:表示全部阿里雲帳號。
資源類型 |
資源 ARN |
| LogStore |
|
| Project |
|
| AzureBlobIngestion |
|
| MaterializedView |
|
| ConsumeProcessor |
|
| AgentInstanceConfig |
|
| IngestProcessor |
|
| MetricStore |
|
| CollectionPolicy |
|
| Ticket |
|
| Region |
|
| Service |
|
| ESIngestion |
|
| Alert |
|
| S3Ingestion |
|
條件(Condition)
下表是 定義的產品級條件關鍵字,這些條件關鍵字可以在 RAM 權限原則語句的Condition元素中使用,用來描述授予許可權的條件。以下僅列舉產品級的條件關鍵字,阿里雲定義的通用條件關鍵字也同樣適用。
其中,資料類型決定了您可以使用哪些條件運算子將請求中的值與權限原則語句中的值進行比較。您必須使用與資料類型匹配的條件運算子,否則無法匹配策略語句,授權行為無效。資料類型與條件運算子的對應關係,請參見條件操作類型。
條件關鍵字 |
描述 |
類型 |
| log:TLSVersion | TLS 的版本。 | String |
| log:Encrypted | 建立或修改 Logstore 時是否指定加密設定。 | Boolean |
相關操作
您可以建立自訂權限原則,並將權限原則授予 RAM 使用者、RAM 使用者組或 RAM 角色。具體操作如下: