

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 建立客戶受管金鑰
<a name="health-scribe-encryption-customer"></a>

 您可以使用 AWS 管理主控台或 AWS KMS APIs 來建立對稱客戶受管金鑰。若要建立對稱客戶受管金鑰，請遵循《 AWS Key Management Service 開發人員指南》中的[建立對稱客戶受管金鑰](https://docs.aws.amazon.com//kms/latest/developerguide/create-keys.html#create-symmetric-cmk)的步驟。

金鑰政策會控制客戶受管金鑰的存取權限。每個客戶受管金鑰都必須只有一個金鑰政策，其中包含決定誰可以使用金鑰及其使用方式的陳述式。在建立客戶受管金鑰時，可以指定金鑰政策。如需詳細資訊，請參閱《 AWS Key Management Service 開發人員指南》中的[管理對客戶受管金鑰的存取](https://docs.aws.amazon.com//kms/latest/developerguide/control-access-overview.html#managing-access)。

## AWS KMS AWS HealthScribe 的關鍵政策
<a name="health-scribe-key-policies"></a>

 如果您在與 [StartMedicalScribeJob](https://docs.aws.amazon.com//transcribe/latest/APIReference/API_StartMedicalScribeJob.html) 或 `ResourceAccessRole` [StartMedicalScribeStream](https://docs.aws.amazon.com/transcribe/latest/APIReference/API_streaming_StartMedicalScribeStream.html) 請求`DataAccessRole`中指定為 IAM 的角色相同的帳戶中使用金鑰，則不需要更新金鑰政策。若要在與 DataAccessRole （用於轉錄任務） 或 ResourceAccessRole （用於串流） 不同的帳戶中使用客戶受管金鑰，您必須信任金鑰政策中的個別角色，才能執行下列動作：
+ [https://docs.aws.amazon.com//kms/latest/APIReference/API_Encrypt.html](https://docs.aws.amazon.com//kms/latest/APIReference/API_Encrypt.html)：允許使用客戶受管金鑰進行加密
+ [https://docs.aws.amazon.com//kms/latest/APIReference/API_Decrypt.html](https://docs.aws.amazon.com//kms/latest/APIReference/API_Decrypt.html)：允許使用客戶受管金鑰進行解密
+ [https://docs.aws.amazon.com//kms/latest/APIReference/API_DescribeKey.html](https://docs.aws.amazon.com//kms/latest/APIReference/API_DescribeKey.html) — 提供客戶受管金鑰詳細資訊，以允許 AWS HealthScribe 驗證金鑰

以下是可用來授予 ResourceAccessRole 跨帳戶許可的金鑰政策範例，以使用客戶受管金鑰進行 AWS HealthScribe 串流。若要將此政策用於轉錄任務，請更新 `Principal` 以使用 DataAccessRole ARN，並移除或修改加密內容。

------
#### [ JSON ]

****  

```
{
   "Version":"2012-10-17",		 	 	 
   "Statement":[
      {  
         "Sid": "AllowAccessForKeyAdministrators", 
         "Effect": "Allow", 
         "Principal": {
            "AWS": "arn:aws:iam::111122223333:root" 
         }, 
         "Action": [
           "kms:*" 
         ], 
         "Resource": "*"
      },
      {
         "Sid": "AllowAccessToResourceAccessRoleForMedicalScribe",
         "Effect": "Allow",
         "Principal": {
            "AWS": "arn:aws:iam::111122223333:role/ResourceAccessRole"
         },
         "Action": [
            "kms:Encrypt",
            "kms:Decrypt",
            "kms:GenerateDataKey*"
         ],
         "Resource": "*",
         "Condition": {
            "StringEquals": {
                "kms:EncryptionContext:aws:us-east-1:transcribe:medical-scribe:session-id": "1234abcd-12ab-34cd-56ef-123456SAMPLE"
            }
         }
      },
      {
         "Sid": "AllowAccessToResourceAccessRoleForDescribeKey",
         "Effect": "Allow",
         "Principal": {
             "AWS": "arn:aws:iam::111122223333:role/ResourceAccessRole"
         },
         "Action": "kms:DescribeKey",
         "Resource": "*"
     }
   ]
}
```

------

## 存取角色的 IAM 政策許可
<a name="health-scribe-key-data-access-role"></a>

 連接至 DataAccessRole 或 ResourceAccessRole 的 IAM 政策必須授予執行必要 AWS KMS 動作的許可，無論客戶受管金鑰和角色是否位於相同或不同的帳戶中。此外，角色的信任政策必須授予 AWS HealthScribe 擔任角色的許可。

下列 IAM 政策範例顯示如何授予 AWS HealthScribe 串流的 ResourceAccessRole 許可。若要將此政策用於轉錄任務，請將 取代`transcribe.streaming.amazonaws.com`為 ，`transcribe.amazonaws.com`並移除或修改加密內容。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "kms:Encrypt",
                "kms:Decrypt",
                "kms:GenerateDataKey*"
            ],
            "Resource": "arn:aws:kms:us-west-2:111122223333:key/KMS-Example-KeyId",
            "Condition": {
                "StringEquals": {
                    "kms:ViaService": "transcribe.streaming.amazonaws.com",
                    "kms:EncryptionContext:aws:us-east-1:transcribe:medical-scribe:session-id": "1234abcd-12ab-34cd-56ef-123456SAMPLE"
                }
            }
        },
        {
            "Effect": "Allow",
            "Action": [
                "kms:DescribeKey"
            ],
            "Resource": "arn:aws:kms:us-west-2:111122223333:key/KMS-Example-KeyId",
            "Condition": {
                "StringEquals": {
                    "kms:ViaService": "transcribe.streaming.amazonaws.com"
                }
            }
        }
    ]
}
```

------

以下是 ResourceAccessRole 的信任政策範例。對於 DataAccessRole，將 取代`transcribe.streaming.amazonaws.com`為 `transcribe.amazonaws.com`。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Effect": "Allow",
            "Principal": {
                "Service": "transcribe.streaming.amazonaws.com"
            },
            "Action": "sts:AssumeRole",
            "Condition": {
                "StringEquals": {
                    "aws:SourceAccount": "111122223333"
                },
                "ArnLike": {
                    "aws:SourceArn": "arn:aws:transcribe:us-west-2:111122223333:*"
                }
            }
        }
    ]
}
```

------

 如需在[政策中指定許可](https://docs.aws.amazon.com//kms/latest/developerguide/control-access-overview.html#overview-policy-elements)或對[金鑰存取進行疑難排解](https://docs.aws.amazon.com//kms/latest/developerguide/policy-evaluation.html#example-no-iam)的詳細資訊，請參閱 AWS Key Management Service 開發人員指南。