This topic describes how to bind cloud vendor accounts and grant them KMS permissions.
Background information
In OceanBase Cloud, instances can obtain and use custom keys from cloud service providers for data encryption to enhance security by binding the account information of the cloud service provider.
Considerations
- The cloud vendor account authorization feature is supported only in OceanBase Database V4.3.5 and later.
- Currently, instances on self-managed channels of Huawei Cloud, Alibaba Cloud, AWS, and GCP are supported.
Account authorization
Create an OceanBase Cloud cross-account access role.
Create a new role in Alibaba Cloud's RAM Access Control > Identity Management > Roles. Note the following configurations:

Click Switch Editor.
Set Effect to Allow.
Select Cloud Account for Subject Type, then click Edit.
For Cloud Account, select Other Cloud Accounts and enter the root account provided by OceanBase Cloud (automatically generated by the instance).
For Identity Type, select RAM User and enter the RAM username provided by OceanBase Cloud (automatically generated by the instance).
Note
The root account and RAM username provided by OceanBase Cloud can be viewed under Security Settings > TDE > View Alibaba Cloud Account Authorization.

Configure KMS access permissions.
Note
The first configuration requires creating a permission policy with specified authorization. If a similar policy already exists, skip the first step.
Create a custom KMS permission policy.
On the RAM Access Control page, click Permission Management > Permission Policies in the left navigation bar.
On the Permission Policies page, click Create Permission Policy.

On the Visual Editing tab, select the following configurations:
OptionDescriptionEffect Allow Service Key Management Service Operation Select Specify Operation and choose the following permissions: - kms:ListKeys
- kms:ListAliases
- kms:ListAliasesByKeyId
- kms:DescribeKey
- kms:Encrypt
- kms:Decrypt
- kms:GenerateDataKey
Resource The default selection is All Resources. If you only want to grant access to specific KMS resources for OceanBase, you can select Specify Resources. Click OK to complete the creation. The created permission policy is as follows:

Configure KMS key permissions for the Alibaba Cloud RAM user.
In the left-side navigation pane, click Identity Management > Roles.
Click the name of the role created in the previous step to go to its details page.
Click Add Authorization and specify the following configurations.
OptionDescriptionResource Scope The authorization subject is automatically populated and does not need to be changed. Permission Policy Select the custom policy created in Step 1. After authorization, the status is as follows:

Obtain the ARN information from the Alibaba Cloud RAM user details.
Authorization verification.
Log in to the OceanBase Cloud console.
In the left-side navigation pane, click Cluster List, select the target cluster, and go to the Cluster Dashboard page.
In the left-side navigation pane, click Security.
On the Security Settings page, click the Transparent Data Encryption (TDE) tab.
Click View Alibaba Cloud Account Authorization.
Enter the ARN obtained from the Alibaba Cloud RAM user details into the ARN field and click Complete.

Create an OceanBase Cloud cross-account access user and delegate.
Create a new delegate in the Huawei Cloud Identity and Access Management Service IAM > Delegation section. Note the following configurations:
For Delegate Type, select Regular Account.
For Delegated Account, enter the root account provided by OceanBase Cloud (automatically obtained for the current instance).
Note
The root account provided by OceanBase Cloud can be viewed in Security Settings > TDE > View Huawei Cloud Account Authorization.
Configure KMS access permissions.
Note
To configure for the first time, you need to create a permission policy with specified authorization. If a similar policy already exists, you can skip the first step.
Create a custom policy.
On the Identity and Access Management (IAM) management page, click Permission Management > Permissions in the left navigation bar.
On the Permission Policy page, click Create Custom Policy in the upper-right corner.
Enter a policy name, then on the Visual View tab, select the following configuration:
OptionDescriptionEffect Allow Service Data Encryption Service Operation Select the following permissions: - kms:cmk:get (Query key information)
- kms:cmk:list (Query key list)
- kms:dek:create (Create data key)
- kms:dek:encrypt (Encrypt data key)
- kms:dek:decrypt (Decrypt data key)
Resource All Resources is selected by default. If you only want to grant access to specific KMS resources for OceanBase, you can select Specific Resources. Click OK to complete the creation.
Configure KMS key permissions for the grant.
In the left navigation bar, click Grants.
In the grant list, click Authorize in the Actions column of the target grant.
On the authorization page, select the policy created in the first step and click Next.
After setting the minimum authorization scope, click OK.
Obtain the URN information in the IAM Grant Details.
Perform authorization verification.
Log in to the OceanBase Cloud console.
In the left navigation bar, click Cluster List, select the target cluster, and go to the Cluster Dashboard page.
In the left navigation bar, click Security.
On the Security Settings page, click the Transparent Data Encryption (TDE) tab.
Click View Huawei Cloud Account Authorization.
Enter the URN obtained from the IAM delegation details and click Complete.

Log in to the AWS IAM Management Console.
Configure KMS access permissions.
Note
To configure for the first time, you need to create a permission policy with specified authorization. If a similar policy already exists, you can skip the first step.
Create a custom KMS permission policy.
On the Policy Management page, click Creation Strategy.
On the Visual Editing tab, select the following configuration:
OptionDescriptionSelect Service KMS Action Select Specify Actions and choose the following permissions: - ListAliases
- ListKeys
- DescribeKey
- GenerateDataKey
- Decrypt
- Encrypt
Resources All is selected by default. If you only want to allow OceanBase access to specific KMS resources, you can select Specify Resources. Click OK to complete the creation.
Create an IAM role and configure KMS key permissions.
On the Role Management page, click Create Role.
Select Custom Trust Policy, then fill in the following configuration, and insert the IAM user ARN provided by OceanBase Cloud into the
Principalfield.Note
The IAM user ARN can be viewed under Security Settings > TDE > View AWS Account Authorization.


{ "Version":"2012-10-17" "Statement":[ { "Effect":"Allow", "Principal":{****}, "Action":"sts:AssumeRole" }] }When adding permissions, select the custom permission policy created in Step 1.

Enter the name and description, then click OK.

Obtain the ARN information from the AWS IAM role details.
Authorization verification.
Log in to the OceanBase Cloud console.
In the left-side navigation pane, click Cluster List, select the target cluster, and go to the Cluster Workspace page.
In the left-side navigation pane, click Security.
On the Security Settings page, click the Transparent Data Encryption (TDE) tab.
Click View AWS Account Authorization.
Enter the ARN obtained from the AWS IAM role details into the ARN field, then click Complete.

Prerequisites
- You have enabled the KMS API service. To enable it, visit Cloud Key Management Service (KMS) API.
Procedure
Create a service account.
Log in to GCP IAM and Admin > Service Accounts.
Click Create Service Account.
In the service account creation dialog box, enter the service account name and click Create and Continue.
In the service account authorization step, authorize the following predefined GCP roles. For detailed role descriptions, see Permissions and roles.
- Cloud KMS Viewer
- Cloud KMS Crypto Operator
- Cloud KMS CryptoKey Encrypter/Decrypter

Click Complete.
Authorize permissions for the OB service account.
Click the name of the newly created account to go to its management page.
Click Principals with access.
On the View by principals tab, click Grant access.
On the authorization page that appears, enter the following information:
Add principals: Enter the complete information of the OB Cloud service account.
Note
The root account provided by OceanBase Cloud can be viewed under Security Settings > TDE > View Google Cloud Account Authorization.
Assign roles: Search for the token and select Service Account Token Creator.

Click Save.
After the role is created, obtain the email address from the service account details.

Authorize verification.
Log in to the OceanBase Cloud console.
In the left-side navigation pane, click Cluster List, select the target cluster, and go to the Cluster Dashboard page.
In the left-side navigation pane, click Security.
On the Security Settings page, click the Transparent Data Encryption (TDE) tab.
Click View Google Cloud Account Authorization.
Enter the email information obtained from the GCP service account details and click Complete.

