Simple Log Service supports authorization for Resource Access Management (RAM) users and RAM roles, tag-based authentication, and cross-service authorization. These features are implemented using access policies. This topic describes the actions and resources that are supported in Simple Log Service access policies to enable fine-grained permission control.
Policy
A policy defines a set of permissions that are described based on the policy structure and syntax. You can use policies to describe the authorized resource sets, authorized operation sets, and authorization conditions. For more information about the policy elements, structure, and syntax, see Policy elements and Policy structure and syntax.
RAM supports the following two types of policy:
System policy: System policies are created and upgraded by Alibaba Cloud. You can use system policies but cannot modify them.
Custom policy: You can create, modify, delete, and upgrade custom policies to meet your business requirements.
You can attach one or more policies to RAM identities. For more information, see Grant permissions to a RAM user, Grant permissions to a RAM user group, and Grant permissions to a RAM role.
Basic elements of an access policy
For more information about the concepts and syntax of access policies, see Basic elements of an access policy.
Element | Description |
Effect | Specifies whether a statement result is an explicit allow or an explicit deny. Valid values:
|
Action/NotAction | Specifies one or more API operations that are allowed or denied. You can specify either Action or NotAction in a policy.
|
Resource | Specifies one or more objects that the statement covers. |
Condition | Specifies the conditions that are required for a policy to take effect. |
Principal | Specifies the principal that is allowed or denied access to a resource. This element is available only for resource-based policies, such as a trust policy that specifies a trusted entity to assume a RAM role. |
Authorization flow
Create an account administrator.
An Alibaba Cloud account, also known as a root account, has full management permissions for all resources within the account. You cannot restrict these permissions using conditions, such as source IP addresses or access times. If multiple users share the account, you cannot identify the specific user from the operation logs. A leaked Alibaba Cloud account is a high security risk. Do not use your Alibaba Cloud account for daily operations management.
You can create a RAM user in RAM and grant the AdministratorAccess permissions to the user. This user acts as an account administrator and can manage all cloud resources under the account. You can then use this administrator to create other RAM users and assign different permissions to them.
RAM provides two types of access policies: system policies and custom policies. System policies are provided by Alibaba Cloud and can be viewed but not modified. If system policies do not meet your authorization needs, you can create custom policies to implement fine-grained permission management.
Create and authorize a RAM user or RAM role:
Create and authorize a RAM user.
You can create RAM users and grant permissions to them. This allows different RAM users to have different permissions to access resources.
If multiple users in your enterprise need to access resources, you can use RAM to assign the least privilege required to each user. This practice helps you avoid sharing the logon password or AccessKey pair of your Alibaba Cloud account and reduces security risks.
Create and authorize a RAM user group.
You can use RAM user groups to classify and authorize RAM users who have the same responsibilities. This helps you manage RAM users and their permissions more efficiently.
Create and authorize a RAM role.
A RAM role is a virtual user to which you can grant a set of access policies. Unlike a RAM user, a RAM role does not have permanent identity credentials, such as a logon password or an AccessKey pair. A RAM role must be assumed by a trusted entity. After the role is assumed, the trusted entity obtains temporary identity credentials for the RAM role. These credentials are provided in the form of a Security Token Service (STS) token. The trusted entity can then use the STS token to access authorized resources. For the steps to use a RAM role, see Assume a RAM role.
Action
The format of an action is log:${API_Name}, where ${API_Name} is the name of a Simple Log Service API. For a list of all public cloud APIs for Simple Log Service, see API overview.
When you create an authorization policy for Simple Log Service, you can separate multiple actions with commas (,). You can use the asterisk (*) as a wildcard character. For example, in log:Create*, Create* matches all API names that start with Create, such as CreateProduct, CreateThingModel, and CreateProductTopic.
The GetCursor and GetCursorTime APIs correspond to the same action: log:GetCursorOrData.
Resource
Resources in Simple Log Service are hierarchical. A project is the root resource. Logstores, configs, and machine groups are sub-resources of a project and are at the same level. Shippers and consumer groups are sub-resources of a Logstore.
Resource type | Resource description in an authorization policy |
Project |
|
| |
Project:Logstore |
|
| |
Project:Logstore:Shipper |
|
| |
Project:Config |
|
| |
Project:MachineGroup |
|
| |
Project:ConsumerGroup |
|
| |
Project:SavedSearch |
|
| |
Project:Dashboard |
|
| |
Project:Alarm |
|
| |
General pattern |
|
|
Parameter descriptions
Parameter name | Description |
| The name of a region. |
| The ID of an Alibaba Cloud account. |
| The name of the project. |
| The name of the Logstore. |
| The name of the Logtail configuration. |
| The name of the machine group. |
| The name of the LogShipper rule. |
| The name of the consumer group. |
| The name of the saved search. |
| The name of the dashboard. |
| The name of the alert rule. |