

 Amazon Forecast 不再提供給新客戶。Amazon Forecast 的現有客戶可以繼續正常使用服務。[進一步了解」](https://aws.amazon.com/blogs/machine-learning/transition-your-amazon-forecast-usage-to-amazon-sagemaker-canvas/)

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

# Amazon Forecast 中的資料保護
<a name="data-protection"></a>

 AWS [共同責任模型](https://aws.amazon.com/compliance/shared-responsibility-model/)適用於 Amazon Forecast 中的資料保護。如此模型所述， AWS 負責保護執行所有 的全域基礎設施 AWS 雲端。您負責維護在此基礎設施上託管內容的控制權。您也同時負責所使用 AWS 服務 的安全組態和管理任務。如需資料隱私權的詳細資訊，請參閱[資料隱私權常見問答集](https://aws.amazon.com/compliance/data-privacy-faq/)。如需有關歐洲資料保護的相關資訊，請參閱*AWS 安全性部落格*上的[AWS 共同責任模型和 GDPR](https://aws.amazon.com/blogs/security/the-aws-shared-responsibility-model-and-gdpr/) 部落格文章。

基於資料保護目的，我們建議您保護 AWS 帳戶 登入資料，並使用 AWS IAM Identity Center 或 AWS Identity and Access Management (IAM) 設定個別使用者。如此一來，每個使用者都只會獲得授與完成其任務所必須的許可。我們也建議您採用下列方式保護資料：
+ 每個帳戶均要使用多重要素驗證 (MFA)。
+ 使用 SSL/TLS 與 AWS 資源通訊。我們需要 TLS 1.2 並建議使用 TLS 1.3。
+ 使用 設定 API 和使用者活動記錄 AWS CloudTrail。如需有關使用 CloudTrail 追蹤擷取 AWS 活動的資訊，請參閱*AWS CloudTrail 《 使用者指南*》中的[使用 CloudTrail 追蹤](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-trails.html)。
+ 使用 AWS 加密解決方案，以及其中的所有預設安全控制 AWS 服務。
+ 使用進階的受管安全服務 (例如 Amazon Macie)，協助探索和保護儲存在 Amazon S3 的敏感資料。
+ 如果您在 AWS 透過命令列界面或 API 存取 時需要 FIPS 140-3 驗證的密碼編譯模組，請使用 FIPS 端點。如需有關 FIPS 和 FIPS 端點的更多相關資訊，請參閱[聯邦資訊處理標準 (FIPS) 140-3](https://aws.amazon.com/compliance/fips/)。

我們強烈建議您絕對不要將客戶的電子郵件地址等機密或敏感資訊，放在標籤或自由格式的文字欄位中，例如**名稱**欄位。這包括當您使用 Forecast 或使用主控台、API AWS CLI或 AWS SDKs的其他 AWS 服務 時。您在標籤或自由格式文字欄位中輸入的任何資料都可能用於計費或診斷日誌。如果您提供外部伺服器的 URL，我們強烈建議請勿在驗證您對該伺服器請求的 URL 中包含憑證資訊。

## 靜態加密
<a name="encryption-at-rest"></a>

在 Amazon Forecast 中，加密組態會在 [CreateDataset](API_CreateDataset.md)和 [CreatePredictor](API_CreatePredictor.md)操作期間提供。如果在 CreateDataset 操作中提供加密組態，[CreateDatasetImportJob](API_CreateDatasetImportJob.md)則操作會使用靜態加密的 CMK 和 IAM 角色。

例如，如果您在 CreateDataset 操作的 EncryptionConfig 陳述式中提供金鑰的 KMSKeyArn 和 RoleArn，Forecast 將擔任該角色並使用金鑰來加密資料集。如果未提供組態，則 Forecast 會使用預設的服務金鑰進行加密。此外，如果您提供 CreatePredictor 操作的 EncryptionConfig 資訊，則 CreatePredictorExplanability、CreateForecast 和 CreatePredictorBacktestExportJob 等所有後續操作將使用相同的組態來執行靜態加密。同樣地，如果您不提供加密組態，則 Forecast 將使用預設的服務加密。

對於存放在 Amazon S3 儲存貯體中的任何資料，資料會以預設的 Amazon S3 金鑰加密。您也可以使用自己的 AWS KMS 金鑰來加密資料，並授予預測對此金鑰的存取權。如需 Amazon S3 中資料加密的資訊，請參閱[使用加密保護資料](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingEncryption.html)。如需有關管理您自己的 AWS KMS 金鑰的資訊，請參閱《 *AWS Key Management Service 開發人員指南*》中的[管理金鑰](https://docs.aws.amazon.com/kms/latest/developerguide/overview.html)。

## 傳輸中和處理中的加密
<a name="encryption-in-transit"></a>

 Amazon Forecast 使用 TLS 搭配 AWS 憑證來加密傳送至其他服務的任何資料 AWS 。與其他 AWS 服務的任何通訊都會透過 HTTPS 進行，而預測端點僅支援透過 HTTPS 的安全連線。

 Amazon Forecast 會從您的帳戶複製資料，並在內部 AWS 系統中處理資料。處理資料時，預測會使用預測 AWS KMS 金鑰或您提供的任何 AWS KMS 金鑰來加密資料。

## Amazon Forecast 如何在 AWS KMS 中使用授予
<a name="kms-grants"></a>

Amazon Forecast 需要[授予](https://docs.aws.amazon.com/kms/latest/developerguide/grants.html)才能使用客戶受管金鑰。

Forecast 會使用 [CreatePredictor](https://docs.aws.amazon.com/forecast/latest/dg/API_CreatePredictor.html#forecast-CreatePredictor-request-EncryptionConfig) 或 [CreateDataset](https://docs.aws.amazon.com/forecast/latest/dg/API_CreateDataset.html#forecast-CreateDataset-request-EncryptionConfig) 操作中 **EncryptionConfig** 期間傳遞的 IAM 角色來建立授予。預測會擔任 角色，並代表您執行建立授予操作。如需詳細資訊，請參閱[設定 IAM 角色](https://docs.aws.amazon.com/forecast/latest/dg/aws-forecast-iam-roles.html)。

不過，當您建立使用客戶受管金鑰加密的預測器時，Amazon Forecast 會透過傳送 [CreateGrant](https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateGrant.html) 請求至 來代表您建立授予 AWS KMS。中的授予 AWS KMS 用於授予 Amazon Forecast 存取客戶帳戶中 AWS KMS 金鑰的權限。

Amazon Forecast 需要授予，以便可以使用您的客戶受管金鑰將解密請求傳送至 AWS KMS ，以讀取加密的資料集成品。Forecast 也會使用 授權將 GenerateDataKey 請求傳送至 AWS KMS ，以便將訓練成品[加密](https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html)回 Amazon S3。

您可以隨時撤銷授予的存取權，或移除服務對客戶受管金鑰的存取權。如果您這麼做，Amazon Forecast 將無法存取客戶受管金鑰加密的任何資料，這會影響相依於該資料的操作。例如，如果您嘗試在 Amazon Forecast 無法存取的加密預測器上執行 CreateForecast 操作，則該操作將傳回 AccessDeniedException 錯誤。

## 建立客戶自管金鑰
<a name="customer-managed-key"></a>

您可以使用 AWS 管理主控台 或 AWS KMS API 來建立對稱客戶受管金鑰。若要建立對稱客戶受管金鑰，請遵循《 *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)。

若要將客戶受管金鑰與 Amazon Forecast 資源搭配使用，必須在金鑰政策中允許下列 API 操作：
+ [kms:DescribeKey](https://docs.aws.amazon.com/kms/latest/APIReference/API_DescribeKey.html) – 提供客戶受管金鑰詳細資訊，允許 Amazon Forecast 驗證金鑰。
+ [kms:CreateGrant](https://docs.aws.amazon.com/kms/latest/APIReference/API_CreateGrant.html) — 新增客戶自管金鑰的授予。授予控制對指定 AWS KMS 金鑰的存取，允許存取 Amazon Forecast 所需的[授予操作](https://docs.aws.amazon.com/kms/latest/developerguide/grants.html#terms-grant-operations)。此操作允許 Amazon Forecast 呼叫 `GenerateDataKey` 來產生加密的資料金鑰並將其存放，因為資料金鑰不會立即用於加密。此外， 操作允許 Amazon Forecast 呼叫 ，`Decrypt`使其可以使用儲存的加密資料金鑰並存取加密的資料。
+ [kms:RetireGrant](https://docs.aws.amazon.com/kms/latest/APIReference/API_RetireGrant.html) - 在`CreateGrant`操作完成後，淘汰操作期間提供的所有授予。

**注意**  
Amazon Forecast 會對發起人的身分執行`kms:Decrypt`和`kms:GenerateDataKey`驗證。如果發起人沒有相關許可，您將收到 AccessDeniedException。金鑰政策也應該類似下列程式碼：  

```
"Effect": "Allow",
"Principal": {
    "AWS": “AWS Invoking Identity”
},
"Action": [
    "kms:Decrypt",
    "kms:GenerateDataKey”
    ],
    "Resource": "*"
}
```

如需詳細資訊，請參閱 [IAM 政策](https://docs.aws.amazon.com/forecast/latest/dg/security_iam_id-based-policy-examples.html)。

以下是您可以為 Amazon Forecast 新增的政策陳述式範例。這些是所需的最低許可，也可以使用 IAM 政策新增這些許可。

```
  "Statement" : [ 
    {"Sid" : "Allow access to principals authorized to use Amazon Forecast",
      "Effect" : "Allow",
      "Principal" : {"AWS" : "arn:aws:iam::111122223333:role/ROLE_PASSED_TO_FORECAST"
      },
      "Action" : [ 
        "kms:DescribeKey", 
        "kms:CreateGrant",
        "kms:RetireGrant"
      ],
      "Resource" : "*",
      "Condition" : {"StringEquals" : {"kms:ViaService" : "forecast.region.amazonaws.com",
          "kms:CallerAccount" : "111122223333"
        }
    },
    {"Sid": "Allow access for key administrators",
      "Effect": "Allow",
      "Principal": {"AWS": "arn:aws:iam::111122223333:root"
       },
      "Action" : [ 
        "kms:*"
       ],
      "Resource": "arn:aws:kms:region:111122223333:key/key_ID"
    }
  ]
```

如需在[政策中指定許可](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 開發人員指南*。

## 監控 Amazon Forecast Service 的加密金鑰
<a name="monitoring-keys"></a>

當您搭配 Amazon Forecast Service 資源使用 AWS KMS 客戶受管金鑰時，您可以使用 [AWS CloudTrail](https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-user-guide.html)或 [Amazon CloudWatch Logs](https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html) 來追蹤預測傳送的請求 AWS KMS。下列範例是 `CreateGrant`、 和 AWS CloudTrail 的事件`RetireGrant`，`DescribeKey`用於監控 Amazon Forecast 呼叫 AWS KMS 的操作，以存取客戶受管金鑰加密的資料。

------
#### [ DescribeKey ]

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AROAIGDTESTANDEXAMPLE:Sampleuser01",
        "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01",
        "accountId": "111122223333",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE3",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AROAIGDTESTANDEXAMPLE:Sampleuser01",
                "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01",
                "accountId": "111122223333",
                "userName": "Admin"
            },
            "webIdFederationData": {},
            "attributes": {
                "creationDate": "2022-10-05T21:16:23Z",
                "mfaAuthenticated": "false"
            }
        }
    },
    "eventTime": "2022-10-05T21:16:23Z",
    "eventSource": "kms.amazonaws.com",
    "eventName": "DescribeKey",
    "awsRegion": "region",
    "sourceIPAddress": "172.12.34.56",
    "userAgent": "ExampleDesktop/1.0 (V1; OS)",
    "requestParameters": {
        "keyId": "arn:aws:kms:region:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE"
    },
    "responseElements": null,
    "requestID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE",
    "eventID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE",
    "readOnly": true,
    "resources": [
        {
            "accountId": "111122223333",
            "type": "AWS::KMS::Key",
            "ARN": "arn:aws:kms:region:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE"
        }
    ],
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "eventCategory": "Management",
    "tlsDetails": {
        "tlsVersion": "TLSv1.2",
        "cipherSuite": "ECDHE-RSA-AES256-GCM-SHA384",
        "clientProvidedHostHeader": "kms.region.amazonaws.com"
    }
}
```

------
#### [ CreateGrant ]

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AROAIGDTESTANDEXAMPLE:Sampleuser01",
        "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01",
        "accountId": "111122223333",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE3",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AROAIGDTESTANDEXAMPLE:Sampleuser01",
                "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01",
                "accountId": "111122223333",
                "userName": "Admin"
            },
            "webIdFederationData": {},
            "attributes": {
                "creationDate": "2022-10-05T23:10:27Z",
                "mfaAuthenticated": "false"
            }
        }
    },
    "eventTime": "2022-10-05T23:10:27Z",
    "eventSource": "kms.amazonaws.com",
    "eventName": "CreateGrant",
    "awsRegion": "region",
    "sourceIPAddress": "172.12.34.56",
    "userAgent": "ExampleDesktop/1.0 (V1; OS)",
    "requestParameters": {
        "operations": [
            "Decrypt",
            "GenerateDataKey"
        ],
        "granteePrincipal": "AWS Internal",
        "keyId": "arn:aws:kms:region:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE"
    },
    "responseElements": {
        "grantId": "0ab0ac0d0b000f00ea00cc0a0e00fc00bce000c000f0000000c0bc0a0000aaafSAMPLE"
    },
    "requestID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE",
    "eventID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE",
    "readOnly": false,
    "resources": [
        {
            "accountId": "111122223333",
            "type": "AWS::KMS::Key",
            "ARN": "arn:aws:kms:region:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE"
        }
    ],
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "eventCategory": "Management",
    "tlsDetails": {
        "tlsVersion": "TLSv1.2",
        "cipherSuite": "ECDHE-RSA-AES256-GCM-SHA384",
        "clientProvidedHostHeader": "kms.region.amazonaws.com"
    }
}
```

------
#### [ RetireGrant ]

```
{
    "eventVersion": "1.08",
    "userIdentity": {
        "type": "AssumedRole",
        "principalId": "AROAIGDTESTANDEXAMPLE:Sampleuser01",
        "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01",
        "accountId": "111122223333",
        "accessKeyId": "AKIAIOSFODNN7EXAMPLE3",
        "sessionContext": {
            "sessionIssuer": {
                "type": "Role",
                "principalId": "AROAIGDTESTANDEXAMPLE:Sampleuser01",
                "arn": "arn:aws:sts::111122223333:assumed-role/Admin/Sampleuser01",
                "accountId": "111122223333",
                "userName": "Admin"
            },
            "webIdFederationData": {},
            "attributes": {
                "creationDate": "2022-10-06T04:56:14Z",
                "mfaAuthenticated": "false"
            }
        }
    },
    "eventTime": "2022-10-06T04:56:14Z",
    "eventSource": "kms.amazonaws.com",
    "eventName": "RetireGrant",
    "awsRegion": "region",
    "sourceIPAddress": "172.12.34.56",
    "userAgent": "ExampleDesktop/1.0 (V1; OS)",
    "requestParameters": null,
    "responseElements": null,
    "additionalEventData": {
        "grantId": "0ab0ac0d0b000f00ea00cc0a0e00fc00bce000c000f0000000c0bc0a0000aaafSAMPLE"
    },
    "requestID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE",
    "eventID": "ff000af-00eb-00ce-0e00-ea000fb0fba0SAMPLE",
    "readOnly": false,
    "resources": [
        {
            "accountId": "111122223333",
            "type": "AWS::KMS::Key",
            "ARN": "arn:aws:kms:region:111122223333:key/1234abcd-12ab-34cd-56ef-123456SAMPLE"
        }
    ],
    "eventType": "AwsApiCall",
    "managementEvent": true,
    "recipientAccountId": "111122223333",
    "eventCategory": "Management",
    "tlsDetails": {
        "tlsVersion": "TLSv1.2",
        "cipherSuite": "ECDHE-RSA-AES256-GCM-SHA384",
        "clientProvidedHostHeader": "kms.region.amazonaws.com"
    }
}
```

------