

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

# 使用 加密輸出資料和儲存磁碟區 AWS KMS
<a name="sms-security-kms-permissions"></a>

您可以在建立標籤工作時指定[客戶受管金鑰](https://docs.aws.amazon.com/kms/latest/developerguide/concepts.html#master_keys)，以使用 AWS Key Management Service (AWS KMS) 加密來自標籤工作的輸出資料。如果您使用 API 作業 `CreateLabelingJob` 建立使用自動化資料標籤的標籤工作，您也可以使用客戶受管金鑰來加密連接至機器學習 (ML) 運算執行個體的儲存磁碟區，以執行訓練和推論工作。

本節說明您必須附加至客戶受管金鑰以啟用輸出資料加密的 IAM 政策，以及必須附加至客戶受管金鑰和執行角色的政策，以使用儲存磁碟區加密。若要進一步了解這些選項，請參閱[輸出資料與儲存磁碟區加密](sms-security.md)。

## 使用 KMS 加密輸出資料
<a name="sms-security-kms-permissions-output-data"></a>

如果您指定 AWS KMS 客戶受管金鑰來加密輸出資料，則必須將類似以下內容的 IAM 政策新增至該金鑰。此政策提供您用來建立標籤工作權限的 IAM 執行角色，以便使用此金鑰執行 `"Action"` 中列出的所有動作。若要進一步了解這些動作，請參閱《 AWS Key Management Service 開發人員指南》中的[AWS KMS 許可](https://docs.aws.amazon.com/kms/latest/developerguide/kms-api-permissions-reference.html)。

要使用此政策，請將 `"Principal"` 的 IAM 服務角色 ARN，取代為您用來建立標籤工作的執行角色 ARN。在主控台中建立標籤工作時，這是您在**工作概觀**區段下為 **IAM 角色**指定的角色。使用 `CreateLabelingJob` 建立標籤工作時，這是您為 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html#sagemaker-CreateLabelingJob-request-RoleArn](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html#sagemaker-CreateLabelingJob-request-RoleArn) 指定的 ARN。

```
{
    "Sid": "AllowUseOfKmsKey",
    "Effect": "Allow",
    "Principal": {
        "AWS": "arn:aws:iam::111122223333:role/service-role/example-role"
    },
    "Action": [
        "kms:Encrypt",
        "kms:Decrypt",
        "kms:ReEncrypt*",
        "kms:GenerateDataKey*",
        "kms:DescribeKey"
    ],
    "Resource": "*"
}
```

## 加密自動化資料標籤機器學習 (ML) 運算執行個體儲存磁碟區
<a name="sms-security-kms-permissions-storage-volume"></a>

如果您指定一個 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_LabelingJobResourceConfig.html#sagemaker-Type-LabelingJobResourceConfig-VolumeKmsKeyId](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_LabelingJobResourceConfig.html#sagemaker-Type-LabelingJobResourceConfig-VolumeKmsKeyId)，用來加密機器學習 (ML) 運算執行個體的儲存磁碟區，其用於自動化資料標籤訓練和推論，則必須執行下列動作：
+ 將 [使用 KMS 加密輸出資料](#sms-security-kms-permissions-output-data) 中描述的許可附加至客戶受管金鑰。
+ 將類似下列內容的政策，附加至您用來建立標籤工作的 IAM 執行角色。這是您在 `CreateLabelingJob` 中為 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html#sagemaker-CreateLabelingJob-request-RoleArn](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateLabelingJob.html#sagemaker-CreateLabelingJob-request-RoleArn) 指定的 IAM 角色。若要進一步了解此政策允許`"kms:CreateGrant"`的動作，請參閱 AWS Key Management Service API 參考[https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateGrant.html](https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateGrant.html)中的 。

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

****  

```
{
"Version":"2012-10-17",		 	 	  
"Statement": 
 [  
   {
    "Effect": "Allow",
    "Action": [
       "kms:CreateGrant"
    ],
    "Resource": "*"
  }
]
}
```

------

若要進一步了解 Ground Truth 儲存磁碟區加密，請參閱[使用 KMS 金鑰加密自動化資料標籤儲存磁碟區 (僅限 API)](sms-security.md#sms-security-kms-storage-volume)。