01 Sign in to the AWS Management Console.
02 To create your own KMS Customer Managed Key (CMK), navigate to Key Management Service (KMS) console available at https://console.aws.amazon.com/kms/.
03 In the main navigation panel, choose Customer managed keys.
04 Choose Create Key to initiate the key setup process.
05 For Step 1 Configure key, perform the following actions:
- Choose Symmetric for Key type.
- Select KMS for Key usage.
- Choose Advanced options, select KMS - recommended for Key material origin, and choose whether to allow your KMS key to be replicated into other AWS cloud regions. If Single-Region key is selected, the AWS region must match the region of your Amazon Bedrock agent.
- Select Next to continue the key setup process.
06 For Step 2 Add labels, provide the following details:
- Provide a unique name (alias) for your KMS key in the Alias box.
- (Optional) Enter a short description in the Description box.
- (Optional) Choose Add tag from the Tags - optional section to create any necessary tag sets. Tags can be used to categorize and identify your KMS keys and help you track your AWS costs.
- Select Next to continue the setup.
07 For Step 3 Define key administrative permissions, perform the following operations:
- For Key administrators, select which IAM users and/or roles can administer your new key through the KMS API. You may need to add additional permissions for the users or roles to administer the key from the AWS Management Console.
- For Key deletion, choose whether to allow key administrators to delete your KMS key.
- Select Next to continue the setup process.
08 For Step 4 Define key usage permissions, perform the following actions:
- For Key users, select which IAM users and/or roles can use your KMS key in cryptographic operations.
- (Optional) For Other AWS accounts section, specify the AWS accounts that can use your key. To configure cross-account access, choose Add another AWS account and enter the ID of the AWS cloud account that can use your KMS key for cryptographic operations. The administrators of the AWS accounts you specify at this step are responsible for managing the permissions that allow their IAM users and/or roles to use your key.
- Select Next to continue the setup.
09 For Step 5 Review, review the key configuration and key policy, then choose Finish to create your new Amazon KMS Customer Managed Key (CMK).
10 Once your new KMS Customer Managed Key (CMK) is available, navigate to Amazon Bedrock console available at https://console.aws.amazon.com/bedrock/.
11 In the main navigation panel, under Builder tools, select Agents.
12 In the Agents section, select the Amazon Bedrock agent that you want to configure, and choose Edit.
13 To be able to encrypt agent sessions with your Amazon KMS Customer Managed Key (CMK), you must configure the agent service role permissions to allow Amazon Bedrock to encrypt and decrypt agent resources on your behalf. To add the necessary permissions, perform the following actions:
- In the Agent overview section, click on the ARN (link) of the service role associated with the agent, available under Permissions, to open the role page in Amazon IAM.
- Select the Permissions tab, choose Add permissions, select Create inline policy, choose the JSON tab, and paste the policy document listed below (JSON format). Replace \<aws-region\>, \<aws-account-id\>, \<kms-key-id\>, and \<agent-id\> with your own AWS resource information.
- Choose Next, provide a unique name for your new inline policy in the Policy name box, and choose Create policy to create an attach the identity-based policy to your agent service role.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"kms:GenerateDataKey",
"kms:Decrypt"
],
"Resource": "arn:aws:kms:<aws-region>:<aws-account-id>:key/<kms-key-id>",
"Condition": {
"StringEquals": {
"kms:EncryptionContext:aws:bedrock:arn": "arn:aws:bedrock:<aws-region>:<aws-account-id>:agent/<agent-id>"
}
}
}
]
}
14 Navigate back to the Bedrock agent configuration page to apply the encryption key. In the KMS key selection section, check the Customize encryption settings (advanced) setting checkbox, and choose the ID of the Amazon KMS Customer Managed Key (CMK) created earlier in the Remediation process, from the Choose an AWS KMS key dropdown list.
15 Choose Save and exit to apply the configuration changes and return to the Agents listing page.
16 Repeat steps no. 12 - 15 for each Amazon Bedrock agent that you want to encrypt, available in the current AWS region.
17 Change the AWS cloud region from the navigation bar and repeat the Remediation process for other regions.