---
title: 使用 AWS KMS 設定 CMEK
url: https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms
description: 建立 AWS KMS 金鑰、授予 Anthropic 對該金鑰的存取權，並在 Claude Platform 或 Claude Enterprise 中使用它。
---

讓 Claude Code 為您設定此功能

```text
/claude-api 協助我使用 AWS KMS 設定客戶管理的加密金鑰
```

如果您的 Claude Console 側邊欄顯示 **Account managed by AWS**，請改為依照[在 Claude Platform on AWS 上設定 CMEK](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-claude-platform-on-aws) 進行操作。

## 開始之前

在 Claude 中：

* 客戶管理的加密金鑰（CMEK）已[為您的組織開啟](https://platform.claude.com/docs/zh-TW/manage-claude/cmek#availability)。
* 您已取得您的 Anthropic 組織 ID，即不含 `org_` 前綴的 UUID。請從 Claude Console 中的 [Organization](https://platform.claude.com/settings/organization) 複製，或從 claude.ai 上的 **Organization settings > Organization and access** 複製。建立金鑰的人需要此 ID。
* 您是 Claude Platform 上的 Organization Admin，或是 Claude Enterprise 上的 Owner 或 Primary Owner。
* 在 Claude Platform 上，您擁有一個[保留資料](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-data-retention#data-retention)的工作區，最好是新的工作區，因為[現有資料仍以 Anthropic 的金鑰加密](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-how-it-works#when-your-key-takes-effect)。
* 在 Claude Enterprise 上，您了解[哪些功能會關閉或變更](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-coverage-claude-enterprise#turned-off-or-changed)。

在 AWS 中：

* 您可以建立 AWS KMS 金鑰並設定其金鑰政策（`kms:CreateKey` 和 `kms:PutKeyPolicy`）。
* 任何對 AWS KMS 存取的 IP 限制都允許 [Anthropic 的輸出 IP 位址](https://platform.claude.com/docs/zh-TW/api/ip-addresses#outbound-ip-addresses)。

## 在 AWS 中：建立金鑰

若 **Verify** 或 **Add** 失敗，請參閱 [AWS KMS 的修正方法](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#aws-kms)。

### 撰寫金鑰政策

此政策授予 Anthropic 的 IAM 角色對您的金鑰的存取權。請僅使用本頁公布的角色 ARN，絕不要使用透過電子郵件或聊天傳送的角色 ARN。將政策複製到文字編輯器中：

```json key-policy.json
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "AccountRootAdmin",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::<AWS_ACCOUNT_ID>:root"
      },
      "Action": "kms:*",
      "Resource": "*"
    },
    {
      "Sid": "AllowAnthropicCMEKCrypto",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::915198916910:role/anthropic-cmek-client-us"
      },
      "Action": ["kms:Encrypt", "kms:Decrypt"],
      "Resource": "*",
      "Condition": {
        "StringEquals": {
          "kms:EncryptionContext:anthropic:org_uuid": ["<ORGANIZATION_UUID>"]
        }
      }
    },
    {
      "Sid": "AllowAnthropicCMEKDescribe",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::915198916910:role/anthropic-cmek-client-us"
      },
      "Action": "kms:DescribeKey",
      "Resource": "*"
    }
  ]
}
```

將 `<AWS_ACCOUNT_ID>` 替換為您的 [AWS 帳戶 ID](https://docs.aws.amazon.com/IAM/latest/UserGuide/console-account-id.html)，並將 `<ORGANIZATION_UUID>` 替換為您的 [Anthropic 組織 ID](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms#prerequisites)。請保留 `kms:EncryptionContext:anthropic:org_uuid` 條件，否則驗證會失敗。

您也可以列出工作區的隔間 ID，以[將金鑰限制於特定工作區](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms-workspaces)。如果您要替換已在保護 Claude 資料之金鑰上的政策，請[再新增一個政策陳述式](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#existing-data)。

### 建立金鑰

您可以在任何 AWS 商業區域中建立金鑰。為獲得最低的延遲，請使用 `us-east-2`。

若要使用您在 AWS KMS 中已有的金鑰，請[替換其金鑰政策](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms-workspaces#replace-the-key-policy)。

<Tabs>
  <Tab title="AWS Console">
    <Steps>
      <Step title="開啟 Create key 精靈">
        開啟 [AWS KMS 主控台](https://console.aws.amazon.com/kms)，並切換到該金鑰所在的區域。前往 **Customer managed keys**，然後按一下 **Create key**。
      </Step>

      <Step title="Configure key">
        請確認已選取以下選項：

        * **Key type:** Symmetric
        * **Key usage:** Encrypt and decrypt
        * **Advanced options > Key material origin:** KMS
        * **Advanced options > Regionality:** Single-Region key

        按一下 **Next**。

        <Frame caption="對稱、加密與解密、單一區域金鑰。">
          ![AWS KMS Configure key 步驟，已選取 Symmetric 金鑰類型、Encrypt and decrypt 金鑰用途以及 Single-Region key。](https://platform.claude.com/docs/images/cmek/aws-configure-key.png)
        </Frame>
      </Step>

      <Step title="Add labels">
        為金鑰輸入 **Alias**，例如 `anthropic-cmek`。按一下 **Next**。

        <Frame caption="金鑰的別名。">
          ![AWS KMS Add labels 步驟，別名為 anthropic-cmek，描述為 Anthropic CMEK。](https://platform.claude.com/docs/images/cmek/aws-add-labels.png)
        </Frame>
      </Step>

      <Step title="Define key administrative permissions">
        請勿選取任何金鑰管理員。您的金鑰政策已賦予您的 AWS 帳戶完整的管理控制權。按一下 **Next**。

        <Frame caption="將金鑰管理員保留空白。">
          ![AWS KMS Define key administrative permissions 步驟，列出可管理該金鑰的 IAM 角色。](https://platform.claude.com/docs/images/cmek/aws-admin-permissions.png)
        </Frame>
      </Step>

      <Step title="Define key usage permissions">
        請勿選取任何金鑰使用者，也不要在 **Other AWS accounts** 下新增任何項目。您的金鑰政策已授予所需的存取權。按一下 **Next**。
      </Step>

      <Step title="Edit key policy">
        按一下 **Edit**。將整個政策換成您的金鑰政策，然後按一下 **Next**。
      </Step>

      <Step title="Review">
        按一下 **Finish**。
      </Step>

      <Step title="複製金鑰 ARN">
        在 **Customer managed keys** 中，開啟新金鑰並複製其 ARN。在 Claude 中新增此金鑰的人需要用到它。
      </Step>
    </Steps>
  </Tab>

  <Tab title="AWS CLI">
    將您的金鑰政策儲存為 `key-policy.json`，然後建立金鑰。將 `<REGION>` 換成金鑰所在的區域。

    ```bash
    aws kms create-key \
      --region <REGION> \
      --description "Anthropic CMEK" \
      --key-usage ENCRYPT_DECRYPT \
      --policy file://key-policy.json
    ```

    從輸出中複製 `KeyMetadata.Arn`。在 Claude 中新增此金鑰的人需要用到此 ARN。
  </Tab>
</Tabs>

在 Claude 中每次檢查金鑰，都會在 CloudTrail 中新增四個預期的存取遭拒錯誤。您可以[將其篩選掉](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#cloudtrail)。

## 在 Claude 中：新增並附加金鑰

若要在 Claude Platform 上以指令碼執行此部分，請改為[使用 Admin API](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-admin-api)。

<Tabs>
  <Tab title="Claude Platform">
    <Steps>
      <Step title="開啟加密金鑰設定">
        在 Claude Console 中，開啟 Data retention 頁面上的 [Encryption keys](https://platform.claude.com/settings/privacy#encryption-keys)。如果該區段不存在，請從頂端的下拉選單中選取 **Organization**。
      </Step>

      <Step title="新增金鑰">
        在 **Encryption keys** 下，點擊 **Add key**。輸入 **Display name**，選取 **AWS KMS**，然後點擊 **Continue**。
      </Step>

      <Step title="輸入金鑰 ARN">
        確認您的[金鑰政策](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms#key-policy)包含對話方塊中顯示的 **Organization ID for the key policy**。將金鑰 ARN 貼到 **KMS key ARN** 中，然後點擊 **Add**。
      </Step>

      <Step title="驗證金鑰">
        在 **Encryption keys** 清單中，按一下金鑰旁的 **Verify**。檢查通過時會顯示 **Connected**。如果改為顯示 **Connection failed**，請參閱[疑難排解 CMEK](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting)。
      </Step>

      <Step title="將金鑰附加到工作區">
        <Warning>
          附加金鑰[無法復原](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-key-lifecycle#what-each-action-does)。您無法將其從工作區中移除，也無法替換它。如果該金鑰被刪除，Anthropic 將無法救回受其保護的資料。
        </Warning>

        1. 在 Data retention 頁面頂端，從下拉式選單中選取工作區。
        2. 在 **Encryption key** 下，選取金鑰並按一下 **Save**。
        3. 勾選核取方塊，確認您已閱讀 CMEK 文件，然後按一下 **Confirm**。

        您會看到 **Workspace settings updated.** 您的金鑰[生效](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-how-it-works#when-your-key-takes-effect)後，您的雲端供應商的稽核日誌會顯示 Anthropic 對您的金鑰的呼叫。

        在 [ZDR 組織](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-data-retention#zdr-organizations)中，選取工作區後，請選取 **Standard data retention**，**Encryption key** 才會出現。按一下 **Save** 後，請在資料保留條款上按一下 **Accept**。
      </Step>
    </Steps>
  </Tab>

  <Tab title="Claude Enterprise">
    在 Claude Enterprise 上，CMEK 適用於整個組織，且您只能新增單一金鑰。

    <Warning>
      新增金鑰[無法復原](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-key-lifecycle#what-each-action-does)。您無法將該金鑰從組織中移除，也無法替換它。如果該金鑰遭到刪除，Anthropic 將無法救回該金鑰所保護的資料。
    </Warning>

    新增金鑰會為每位使用者[關閉或變更部分功能](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-coverage-claude-enterprise#turned-off-or-changed)。若要先試用 CMEK，請使用另一個獨立的組織。

    <Steps>
      <Step title="開啟加密金鑰設定">
        前往 [claude.ai > Organization settings > Data and privacy](https://claude.ai/admin-settings/data-privacy-controls) 並找到 **Encryption keys**。
      </Step>

      <Step title="新增金鑰">
        點擊 **Add key**。輸入 **Display name** 並選取 **AWS KMS**。勾選核取方塊以確認您已閱讀 CMEK 文件，然後點擊 **Continue**。
      </Step>

      <Step title="輸入金鑰 ARN">
        確認您的[金鑰政策](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms#key-policy)包含對話方塊中顯示的 **Organization ID for the key policy**。將金鑰 ARN 貼到 **KMS key ARN** 中，然後點擊 **Add**。
      </Step>

      <Step title="確認金鑰已新增">
        檢查最多可能需要 30 秒。當出現 **Encryption key configured.** 時，請按一下 **Done**。如果改為出現 **The encryption key couldn’t be added.**，請[找出原因並重試](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#claude-ai-add-fails)。

        從那時起寫入的資料都會受到您的金鑰保護。請告知您的使用者[哪些功能已變更](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-coverage-claude-enterprise#turned-off-or-changed)。
      </Step>
    </Steps>
  </Tab>
</Tabs>
