Serverless App Engine (SAE) uses Alibaba Cloud Resource Access Management (RAM) to control access to SAE resources. Instead of sharing account credentials or AccessKey pairs across multiple users, you grant RAM users only the permissions they need — reducing security exposure.
This document covers the available system policies, how to create custom policies, and ready-to-use policy JSON for common authorization scenarios.
Prerequisites
Before you begin, ensure that you have:
A basic understanding of RAM policy structure and syntax. See Policy structure and syntax and Basic elements of a policy
RAM policy overview
A RAM policy defines what actions are allowed or denied on which resources, and under what conditions. SAE supports two policy types:
| Policy type | Who manages it | Granularity | Modifiable |
|---|---|---|---|
| System policy | Alibaba Cloud | Coarse-grained | No |
| Custom policy | You | Fine-grained | Yes |
System policies
SAE provides a set of Alibaba Cloud-managed system policies. Attach these to RAM users through the RAM console.
When a RAM user logs in to the SAE console for the first time, SAE displays a welcome dialog box. The account owner can then attach the required policies in the RAM console.
The following system policies are available:
| Policy name | What it unlocks |
|---|---|
| AliyunSAEFullAccess | Full access to SAE. Required to manage applications. |
| AliyunSLBReadOnlyAccess | Read-only access to Server Load Balancer (SLB). Required to use SLB-related features in SAE. |
| AliyunACMFullAccess | Full access to Application Configuration Management (ACM). Required to use SAE's built-in ACM features. |
| AliyunECSReadOnlyAccess | Read-only access to Elastic Compute Service (ECS). Required to select an existing security group when creating an application. |
| AliyunOOSReadOnlyAccess | Read-only access to Operation Orchestration Service (OOS). Required to use the scheduled start and stop feature for batch application management. |
| AliyunBSSReadOnlyAccess | Read-only access to Billing Management. Required to view resource plan balances on the SAE console Overview page. |
| AliyunARMSReadOnlyAccess | Read-only access to Application Real-Time Monitoring Service (ARMS). Required to use SAE's built-in application monitoring. |
| AliyunRAMReadOnlyAccess | Read-only access to RAM. Required to query a RAM user's permissions and receive prompts to grant missing permissions. |
| AliyunCloudMonitorReadOnlyAccess | Read-only access to CloudMonitor. Required to use SAE's built-in basic monitoring. |
| AliyunContainerRegistryReadOnlyAccess | Read-only access to Container Registry. Required to select Container Registry Enterprise Edition when deploying applications using images. |
| AliyunALBReadOnlyAccess | Read-only access to Application Load Balancer (ALB). |
| AliyunYundunCertReadOnlyAccess | Read-only access to Certificate Management Service. |
| AliyunEventBridgeReadOnlyAccess | Read-only access to EventBridge. Required to create and update jobs. |
AliyunSAEFullAccess grants full permissions on all SAE resources. For finer-grained control at the namespace or application level, or for permissions on associated services, use a custom policy instead.Custom policies
If system policies don't meet your needs, create a custom policy to define exact permissions at the namespace or application level.
The SAE Permission Assistant lets you configure permissions visually and generate policy statements without writing JSON by hand. It also helps you create and attach custom policies to RAM users directly from the RAM console.
Authorization rules
Resource ARN format
The SAE resource type you can authorize is application. The ARN format is:
acs:sae:${regionid}:${accountid}:application/${namespaceid}/${appid}| Parameter | Description |
|---|---|
${regionid} | Region ID (e.g., cn-shanghai). You can use * instead. |
${accountid} | Alibaba Cloud account ID. You can use * instead. |
${namespaceid} | Namespace ID. The default namespace has an empty ID, escaped as _default in ARNs. Namespace IDs can contain only lowercase letters or digits. |
${appid} | Application ID. You can use * instead. |
ARN examples
The following examples use the China (Shanghai) region (cn-shanghai).
A specific application in the test namespace:
acs:sae:cn-shanghai:*:application/test/0c815215-46a1-46a2-ba1e-0102a740****All applications in the default namespace:
acs:sae:cn-shanghai:*:application/_default/*Policy examples
All examples use the China (Shanghai) region. Adjust the region ID, namespace IDs, and application IDs to match your environment.
Scenario 1: Grant namespace-level permissions
Goal: Give a RAM user read access across SAE and full write access to specific namespaces and their applications.
In this example, the RAM user is authorized to manage resources related to the default namespace, the namespace with the ID test, and the applications within those namespaces.
| Resource | Actions | Effect |
|---|---|---|
acs:sae:cn-shanghai:*:* | sae:Query*, sae:List*, sae:Describe*, sae:*Ingress*, sae:*ChangeOrder*, sae:*Pipeline* | Allow |
acs:sae:cn-shanghai:*:application/test/* | sae:* | Allow |
This policy grants full write access to the entiretestnamespace, including all applications in it. The read-only statement in the first row covers all resources in the region, but does not grant write access outside thetestnamespace. To also grant write access to the default namespace, add a second resource entry foracs:sae:cn-shanghai:*:application/_default/*.
{
"Version": "1",
"Statement": [
{
"Action": [
"sae:Query*",
"sae:List*",
"sae:Describe*",
"sae:*Ingress*",
"sae:*ChangeOrder*",
"sae:*Pipeline*"
],
"Resource": "acs:sae:cn-shanghai:*:*",
"Effect": "Allow"
},
{
"Action": [
"sae:*"
],
"Resource": [
"acs:sae:cn-shanghai:*:application/test/*"
],
"Effect": "Allow"
}
]
}Scenario 2: Grant application-level permissions
Goal: Give a RAM user read access across SAE and full write access to specific applications only.
In this example, the RAM user can manage two specific applications:
| Application | Namespace | Application ID |
|---|---|---|
| Application 1 | test | 0c815215-46a1-46a2-ba1e-102a740**** |
| Application 2 | default | e468a92b-1529-4d20-8ab1-9d1595dc**** |
| Resource | Actions | Effect |
|---|---|---|
acs:sae:cn-shanghai:*:* | sae:Query*, sae:List*, sae:Describe*, sae:*Ingress*, sae:*ChangeOrder*, sae:*Pipeline* | Allow |
acs:sae:cn-shanghai:*:application/test/0c815215-46a1-46a2-ba1e-0102a740**** | sae:* | Allow |
acs:sae:cn-shanghai:*:application/_default/e468a92b-1529-4d20-8ab1-9d1595dc**** | sae:* | Allow |
This policy restricts write access to the two named applications only. The RAM user cannot create, update, or delete other applications in these namespaces, even though the first statement grants read access across the region.
{
"Version": "1",
"Statement": [
{
"Action": [
"sae:Query*",
"sae:List*",
"sae:Describe*",
"sae:*Ingress*",
"sae:*ChangeOrder*",
"sae:*Pipeline*"
],
"Resource": "acs:sae:cn-shanghai:*:*",
"Effect": "Allow"
},
{
"Action": [
"sae:*"
],
"Resource": [
"acs:sae:cn-shanghai:*:application/test/0c815215-46a1-46a2-ba1e-0102a740****",
"acs:sae:cn-shanghai:*:application/_default/e468a92b-1529-4d20-8ab1-9d1595dc****"
],
"Effect": "Allow"
}
]
}Scenario 3: Grant access to associated Alibaba Cloud services
SAE applications often need to call APIs of other Alibaba Cloud services at runtime — for example, to access load balancers, compute instances, or monitoring data. Attach the corresponding system policies to the RAM user for each service they need.
For example, you can grant the RAM user read-only access to ECS (AliyunECSReadOnlyAccess), SLB (AliyunSLBReadOnlyAccess), and ARMS (AliyunARMSReadOnlyAccess).
Attach only the policies for the services your application actually uses.