---
title: CMEK 疑難排解
url: https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting
description: 找出 CMEK 錯誤訊息、驗證失敗或非預期日誌項目的原因與修正方式。
---

Claude Console 中的 **Verify**、claude.ai 上的 **Add**，以及 Admin API 的 validate 呼叫，全都執行相同的檢查。當檢查失敗時（在 Claude Console 中顯示 **Connection failed**），請參閱 [AWS KMS](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#aws-kms)、[Google Cloud KMS](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#google-cloud-kms) 或 [Azure Key Vault](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#azure-key-vault) 的原因說明。

如果某項功能停止運作，它可能是「customer-managed encryption keys」（客戶管理的加密金鑰），即 CMEK 會關閉的功能之一。請查看 [Claude Platform 清單](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-coverage-claude-platform#turned-off-or-changed)或 [Claude Enterprise 清單](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-coverage-claude-enterprise#turned-off-or-changed)。

如果這裡沒有符合的情況，請聯絡您的 Anthropic 客戶團隊。

## 設定完成後請求失敗

### `cmek_key_disabled`

```text wrap
Customer-managed encryption key is disabled or revoked. Re-enable the key to restore access.
```

這個 400 錯誤表示您的「key management service」（金鑰管理服務）拒絕了 Anthropic 的呼叫。請依序檢查以下原因：

1. 金鑰已停用。
2. Anthropic 對您的金鑰的存取權已被移除。[您的設定頁面](https://platform.claude.com/docs/zh-TW/manage-claude/cmek#set-it-up)列出了 Anthropic 需要的存取權。
3. 在 AWS KMS 上，金鑰政策[列出了工作區](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms-workspaces)，但未包含此工作區。
4. 在 AWS KMS 上，IP 條件封鎖了 [Anthropic 的對外 IP 位址](https://platform.claude.com/docs/zh-TW/api/ip-addresses#outbound-ip-addresses)。

修正該原因。存取權恢復時，[有兩項限制適用](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-key-lifecycle#restore-access)。

### `cmek_key_network_blocked`

```text wrap
The request to your key management service was blocked by its network access controls (for example, a KMS firewall or IP allowlist). Verify that your KMS network rules allow requests from Anthropic's published IP addresses, or contact Anthropic support if your configuration looks correct.
```

這是一個 400 錯誤。金鑰本身可能仍然正常。請在您的金鑰管理服務的網路規則中允許 [Anthropic 公布的 IP 位址](https://platform.claude.com/docs/zh-TW/api/ip-addresses)。

### `cmek_key_unreachable`

```text wrap
The workspace's customer-managed encryption key could not be reached. Try again shortly. If this continues, check that the key is available in your key management service, or contact Anthropic support.
```

這個 503 錯誤表示 [Anthropic 無法連線到您的金鑰](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-key-lifecycle#unreachable-key)。請重試該請求。

## 驗證失敗：AWS KMS

| 原因                  | 修正方式                                                                                                                                          |
| ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| 組織 ID 錯誤            | `org_uuid` 條件必須列出[您的 Anthropic 組織 ID](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms#prerequisites)，也就是不含 `org_` 前綴的 UUID。 |
| 政策中缺少某個工作區          | `compartment_uuid` 條件必須[列出金鑰所附加的每個工作區的隔間 ID](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms-workspaces)。                   |
| 存取權是透過 IAM 而非金鑰政策授予 | Anthropic 的角色需要在[金鑰政策本身](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms#key-policy)中取得存取權。                                 |

若要列印金鑰政策，請執行：

```bash
aws kms get-key-policy \
  --region <REGION> \
  --key-id <KEY_ARN> \
  --policy-name default
```

### 已在保護資料的金鑰

如果您要[替換某個金鑰上的政策](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-aws-kms-workspaces#replace-the-key-policy)，而該金鑰已在保護資料，請加入此政策陳述式，讓 Anthropic 仍能解密那些資料。在其條件中，列出該金鑰目前或曾經附加的每個工作區的隔間 ID。

```json
{
  "Sid": "AllowAnthropicCMEKDecryptExistingData",
  "Effect": "Allow",
  "Principal": {
    "AWS": "arn:aws:iam::915198916910:role/anthropic-cmek-client-us"
  },
  "Action": "kms:Decrypt",
  "Resource": "*",
  "Condition": {
    "StringEquals": {
      "kms:EncryptionContext:anthropic:compartment_uuid": ["<COMPARTMENT_UUID>"]
    }
  }
}
```

## 驗證失敗：Google Cloud KMS

| 原因          | 修正方式                                                                                                                                |
| ----------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| 組織標記錯誤      | 金鑰需要帶有[組織標記](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-google-cloud-kms#organization-label)，其值為小寫的 Anthropic 組織 ID。 |
| 網域限制共用      | 此組織政策會封鎖對 Anthropic 服務帳戶的授權。[新增例外](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-google-cloud-kms#prerequisites)。       |
| 金鑰版本已停用或已銷毀 | 金鑰的主要版本必須處於啟用狀態。                                                                                                                    |

若要檢查授權，請執行：

```bash
gcloud kms keys get-iam-policy <your-key-name> \
  --project=<your-project-id> \
  --location=<region> \
  --keyring=<your-keyring-name>
```

## 驗證失敗：Azure Key Vault

| 原因                    | 修正方式                                                                                                                                      |
| --------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| 組織標籤錯誤                | 金鑰的目前版本需要帶有[組織標籤](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-azure-key-vault#organization-tag)。                            |
| 角色指派尚未生效              | 新的角色指派可能需要幾分鐘才會生效。請稍候，然後再試一次。                                                                                                             |
| 保存庫的網路規則封鎖了 Anthropic | 請對照 [Anthropic 需要的保存庫設定](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-azure-key-vault#check-your-vault-configuration)檢查這些規則。 |

## 在 Claude Platform on AWS 上附加失敗

Claude Platform on AWS 沒有 **Verify** 步驟，因此金鑰的問題會在您附加金鑰時才顯示出來。

| 原因      | 修正方式                                                                                                                                                                                                                                         |
| ------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 金鑰政策不符  | 使用 [`get-key-policy` 命令](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#aws-kms)列印金鑰政策，並與[設定頁面上的政策](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-claude-platform-on-aws#prepare-the-key-policy)進行比較。 |
| 條件不符    | 任何 `EncryptionContext` 或 `aws:SourceArn` 條件都必須包含此工作區。                                                                                                                                                                                        |
| 金鑰狀態或位置 | 金鑰必須處於啟用狀態、為單一區域金鑰，且與工作區位於相同的 AWS 帳戶和區域。                                                                                                                                                                                                     |
| 缺少權限    | 您登入所使用的主體需要對該金鑰擁有 `kms:DescribeKey`、`kms:Encrypt` 和 `kms:Decrypt` 權限。                                                                                                                                                                        |

如果附加仍然失敗，請在金鑰所屬帳戶的 CloudTrail 中找出被拒絕的 `kms:` 事件。它會顯示呼叫的主體，以及（針對密碼編譯呼叫）加密內容。修正該原因後，再次點擊 **Save**。

## 附加或新增金鑰遭到拒絕

### 工作區不保留資料

```text wrap
CMEK keys can only be attached to workspaces in this organization that have inference data retention enabled.
```

[您的組織使用「zero data retention」（零資料保留），即 ZDR](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-data-retention#zdr-organizations)，而金鑰需要一個會保留資料的工作區。請先將工作區切換為 **Standard data retention**。

### 工作區沒有 Encryption key 設定

只有[會保留資料的工作區](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-data-retention#data-retention)才有此設定，因此請先為該工作區選取 **Standard data retention**。ZDR 組織的預設工作區無法切換，因此請使用其他工作區。

### 沒有 Encryption keys 區段

在 Claude Console 中，從 Data retention 頁面頂端的下拉式選單選取 **Organization**。如果該區段仍未出現，表示您的角色不包含此區段，或您的組織尚未開啟 CMEK。CMEK 由您的 Anthropic 客戶團隊開啟。

### 工作區已有金鑰

```text wrap
This workspace already has a different external key attached.
```

工作區的金鑰無法替換，因此若要使用不同的金鑰，請[建立新的工作區](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-key-lifecycle#change-keys)。

### 在 claude.ai 上新增金鑰失敗

```text wrap
The encryption key couldn’t be added.
```

對您的金鑰所進行的檢查失敗。請查找 [AWS KMS](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#aws-kms)、[Google Cloud KMS](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#google-cloud-kms) 或 [Azure Key Vault](https://platform.claude.com/docs/zh-TW/manage-claude/cmek-troubleshooting#azure-key-vault) 的原因。若要重試，請再次點擊 **Add key**。對話方塊開啟時會帶入您先前填寫的詳細資料。勾選核取方塊，點擊 **Continue**，然後點擊 **Add**。

## CloudTrail 中的預期錯誤

在 Claude Platform 和 Claude Enterprise 上，每當您驗證金鑰、將金鑰附加到工作區，或在 claude.ai 上檢視金鑰時，Anthropic 都會檢查您的金鑰。每次檢查都會在 CloudTrail 中新增四個預期的存取遭拒錯誤。

若要將這些錯誤篩選掉，請同時比對以下三個值：

* `requestParameters.encryptionContext.associatedData`：`Y21lay12YWxpZGF0aW9u`
* `userIdentity.accountId`：`915198916910`
* `resources.ARN`：`arn:aws:kms:<REGION>:<AWS_ACCOUNT_ID>:key/<KEY_ID>`

僅比對第一個值並不足夠，因為任何呼叫者都可以設定該值。
