PolarDB must be granted the permissions to access Key Management Service (KMS) before the Transparent Data Encryption (TDE) feature can be used. You can perform the authorization in the Resource Access Management (RAM) console.
Prerequisites
You must use an Alibaba Cloud account.
1. Create the AliyunRDSInstanceEncryptionRolePolicy access policy
-
Log on to the Policy Management page of the RAM console.
-
Click Create Policy.
NoteAn access policy is a set of permissions, defined in a specific syntax, that specifies authorized resources, actions, and conditions.
-
Click the JSON tab and copy the following policy into the code editor.
{ "Version": "1", "Statement": [ { "Action": [ "kms:List*", "kms:DescribeKey", "kms:TagResource", "kms:UntagResource" ], "Resource": [ "acs:kms:*:*:*" ], "Effect": "Allow" }, { "Action": [ "kms:Encrypt", "kms:Decrypt", "kms:GenerateDataKey" ], "Resource": [ "acs:kms:*:*:*" ], "Effect": "Allow", "Condition": { "StringEqualsIgnoreCase": { "kms:tag/acs:rds:instance-encryption": "true" } } } ] } -
Click OK. In the dialog box that appears, configure the following parameters:
Parameter
Description
Name
Enter AliyunRDSInstanceEncryptionRolePolicy.
Remarks
Enter a description. For example: Allows PolarDB to access KMS.
-
Click OK.
2. Create the RAM role AliyunRDSInstanceEncryptionDefaultRole and grant permissions
After you create the policy, you must grant the policy to a RAM role so that PolarDB can access KMS resources.
-
Log on to the Roles page of the RAM console.
-
Click Create Role.
-
Select Alibaba Cloud Service. In the Trusted Entity Name drop-down list, select the entry whose suffix is
rds.aliyuncs.com, namely ApsaraDB RDS, and then click OK. -
In the Create Role panel, set RAM Role Name to
AliyunRDSInstanceEncryptionDefaultRoleand click OK. -
After the role is created, you are redirected to the role details page. Click the Permissions tab, and then click Add Permissions.
-
In the Add Permissions panel, search for and click the
AliyunRDSInstanceEncryptionRolePolicypolicy that you created. This adds the policy to the Selected list on the right. -
Click OK.
Next steps
After you create the access policy and the RAM role described above, you can enable Transparent Data Encryption (TDE) for your cluster, or enable TDE directly when you create a cluster.