Bastionhost integrates with the Alibaba Cloud account system. By default, the Alibaba Cloud account acts as the super administrator of Bastionhost. To follow the principle of least privilege, grant specific permissions to Resource Access Management (RAM) users based on their roles.
Permission types
Bastionhost supports the following permission types. Each type restricts what the RAM user can do in the Bastionhost console.
Permission | Corresponding policy | What the RAM user can do |
Administrative rights | AliyunYundunBastionHostFullAccess | Manage Bastionhost instances, users, and assets; configure access control policies and system settings; view audit information |
Project administrator permissions | AliyunYundunBastionHostProjectAdminAccess | Manage user groups, assets, asset authorizations, control policies, and view audit information within authorized projects in Bastionhost. |
Auditor permissions | AliyunYundunBastionHostAuditOnlyAccess | View audit information, including logs and videos, in the Bastionhost console |
Read-only permissions | AliyunYundunBastionHostReadOnlyAccess | Read configuration, auditing, and system information from the Bastionhost console |
O&M engineer permissions | AliyunYundunBastionHostOperateOnlyAccess | Perform O&M operations using the asset O&M feature |
Because AliyunYundunBastionHostProjectAdminAccess is a Deny-type policy, do not grant it together with AliyunYundunBastionHostFullAccess to the same RAM user. Otherwise, the RAM user cannot access modules such as System Settings in Bastionhost.
These permissions only apply to operations performed in the Bastionhost console. They do not restrict client-based O&M. Client-based O&M access is controlled by the authorization relationship between users and assets configured in Bastionhost.
An Alibaba Cloud account is granted management permissions by default and cannot be imported into Bastionhost as a Bastionhost user.
A single RAM user can hold multiple permission types at the same time.
Additional requirements for administrative rights
To import Alibaba Cloud assets or RAM users into Bastionhost using a RAM user with administrative rights, attach the corresponding read-only policy to that RAM user:
Import target | Required policy |
Elastic Compute Service (ECS) instances | AliyunECSReadOnlyAccess |
RAM users | AliyunRAMReadOnlyAccess |
API calling permissions
If a RAM user needs to call Bastionhost APIs using an AccessKey ID and AccessKey Secret (AK/SK)—for example, ListHostAccounts, GetWatermarkConfig, or other management and configuration operations—grant one of the following policies:
Scenario | Required policy |
Full API access (management, configuration, and O&M operations via AK/SK) | AliyunYundunBastionHostFullAccess |
Audit-related API access only | AliyunYundunBastionHostAuditOnlyAccess |
You can also create a custom policy that includes only the specific Bastionhost actions required for your use case.
Cross-product O&M permissions
If a RAM user needs to perform O&M operations on resources from multiple cloud services through Bastionhost, grant the corresponding permissions for each cloud service in addition to the Bastionhost permissions. For example, to enable a RAM user to perform O&M on both Bastionhost and Server Load Balancer (SLB) resources, grant AliyunSLBFullAccess in addition to the Bastionhost permissions.
Prerequisites
Before you begin, ensure that you have:
A RAM user created within the Alibaba Cloud account that owns the Bastionhost instance.
(Optional). A virtual multi-factor authentication (MFA) device bound to the RAM user. When an MFA device is bound, Bastionhost verifies the RAM user's identity using the configured MFA settings at each logon.
Grant permissions to a RAM user
Log on to the RAM console as a RAM administrator.
In the left-side navigation pane, choose Identities > Users.
On the Users page, find the RAM user and click Add Permissions in the Actions column. To grant permissions to multiple RAM users at once, select them and click Add Permissions at the bottom of the page.
In the Add Permissions panel, configure the following parameters:
Resource Scope: Select the scope for the authorization.
Account: The authorization takes effect on the current Alibaba Cloud account.
ResourceGroup: The permissions apply to a specific resource group.
ImportantIf you select ResourceGroup, make sure the cloud service supports resource groups. See Services that work with Resource Group. For instructions on granting permissions scoped to a resource group, see Use a resource group to grant a RAM user the permissions to manage a specific ECS instance.
Principal: The RAM user to grant permissions to. The current RAM user is automatically selected.
Policy: Select one or more policies that correspond to the permission types you want to grant.
NoteWhen you create a Bastionhost instance, in addition to the
AliyunYundunBastionHostFullAccesspermission, you also need theAliyunBSSOrderAccesspermission to pay for the instance order. Without these permissions, the instance creation will fail.AliyunYundunBastionHostFullAccess: Provides full permissions to manage Bastionhost.AliyunBSSOrderAccess: Grants permissions to view, pay for, and cancel orders in the User Center.
The
AliyunYundunBastionHostFullAccesspolicy grants permissions only to manage Bastionhost and view instance details. It does not include the permissions required to pay for orders in the User Center. Therefore, you cannot create a Bastionhost instance with only this policy.
Click Grant permissions.
Click Close.
FAQ
Q: What should I do if calling Bastionhost APIs returns an InvalidAccessKeyId or unknown endpoint error?
Perform the following checks in sequence to troubleshoot the issue:
Check permission policies: Verify that the RAM user has been granted AliyunYundunBastionHostFullAccess or a custom policy that includes the required Bastionhost actions. Insufficient permissions can cause
InvalidAccessKeyId-class authentication failures.Specify the correct endpoint: When calling Bastionhost APIs, you must explicitly specify the regional endpoint. For example, use
yundun-bastionhost.aliyuncs.comfor the China (Shanghai) region. Bastionhost does not support default endpoint resolution, so if no endpoint is specified the SDK returns anunknown endpointerror.Verify your AK/SK: Confirm that the AccessKey ID and AccessKey Secret are valid and correctly matched. If you suspect the AccessKey Secret has been exposed or is incorrect, create a new AccessKey for testing.
Verify permissions using OpenAPI Explorer: Use OpenAPI Explorer with the RAM user's AK/SK to test the
ListHostAccountsoperation (specify theRegionIdparameter). A successful call confirms that both the permissions and AK/SK are correctly configured.
Q: What should I do if a RAM user reports a missing ListTagResources permission error when logging on to the Bastionhost O&M console?
Cause: The preset read-only permission policy for Bastionhost does not include the yundun-bastionhost:ListTagResources action. When the O&M console attempts to load tag resources, the authorization check fails and returns a missing permission error.
Solution: Create a custom permission policy in the RAM console and grant it to the affected RAM user:
Log on to the RAM console.
In the left-side navigation pane, choose Permissions > Policies.
Click Create Policy and switch to the JSON editing mode.
Add the
yundun-bastionhost:ListTagResourcesaction for the Bastionhost service.Complete the policy creation, then grant the custom policy to the target RAM user.
Q: What should I do if a RAM user reports insufficient permissions when calling management APIs such as GetWatermarkConfig?
Cause: This issue typically occurs when the RAM user's permissions are scoped to a resource group that does not include the target Bastionhost instance. Even if the RAM user has been granted AliyunYundunBastionHostFullAccess or another management policy, API calls such as GetWatermarkConfig will fail if the resource group scope does not cover the Bastionhost instance being accessed.
Solution: Perform one of the following:
In the RAM console, review the authorization scope for the RAM user. If resource group-level authorization is configured, ensure the resource group includes the target Bastionhost instance.
Change the Resource Scope of the permission grant from ResourceGroup to Account to grant access across all instances under the current Alibaba Cloud account.