If system policies do not meet your requirements, you can create custom policies to implement the principle of least privilege. You can use custom policies to implement fine-grained permission management and improve resource security. This topic describes the scenarios of custom policies in ActionTrail. This topic also provides sample custom policies.
What is a custom policy?
Resource Access Management (RAM) policies are classified into system policies and custom policies. You can manage custom policies based on your business requirements.
After you create a custom policy, you must attach the policy to a RAM user, RAM user group, or RAM role. This way, the permissions that are specified in the policy can be granted to the principal.
You can delete a RAM policy that is not attached to a principal. If the RAM policy is attached to a principal, you must detach the RAM policy from the principal before you can delete the RAM policy.
Custom policies support version control. You can manage custom policy versions based on the version management mechanism provided by RAM.
References
Scenarios of custom policies and sample custom policies
Example 1: Grant a Resource Access Management (RAM) user full permissions on ActionTrail and the permissions to query a list of Object Storage Service (OSS) buckets and a list of Simple Log Service projects. This way, the RAM user can manage trails.
{ "Version": "1", "Statement": [ { "Action": [ "actiontrail:*", "oss:GetService", "log:ListProject" ], "Resource": "*", "Effect": "Allow" } ] }
Example 2: Grant a RAM user the permissions to manage trails in ActionTrail and the permissions to manage Logstores, indexes, dashboards, charts, and projects in Simple Log Service. This way, the RAM user can manage alerts.
{ "Version": "1", "Statement": [ { "Effect": "Allow", "Action": [ "actiontrail:DescribeTrails", "actiontrail:SetDefaultTrail", "actiontrail:GetDefaultTrail", "actiontrail:CreateTrail" ], "Resource": "*" }, { "Effect": "Allow", "Action": [ "log:CreateLogStore", "log:CreateIndex", "log:UpdateIndex" ], "Resource": [ "acs:log:*:*:project/Project name/logstore/internal-alert-history", "acs:log:*:*:project/sls-alert-*/logstore/internal-alert-center-log" ] }, { "Effect": "Allow", "Action": [ "log:CreateDashboard", "log:CreateChart", "log:UpdateDashboard" ], "Resource": "acs:log:*:*:project/Project name/dashboard/*" }, { "Effect": "Allow", "Action": [ "log:*" ], "Resource": "acs:log:*:*:project/Project name/job/*" }, { "Effect": "Allow", "Action": [ "log:CreateProject" ], "Resource": [ "acs:log:*:*:project/sls-alert-*" ] } ] }
Authorization information
To use custom policies, you must understand the access control requirements of your business and the authorization information about ActionTrail. For more information, see RAM authorization.