分享方式:


針對 DICOM 服務設定客戶自控金鑰

藉由使用客戶自控金鑰 (CMK),您可以透過您建立和管理的金鑰來保護和控制貴組織資料的存取權。 您可以使用 Azure Key Vault 來建立和管理 CMK,然後使用金鑰來加密 DICOM® 服務所儲存的資料。

必要條件

  • 請確定您熟悉客戶自控金鑰的最佳做法

  • 在 Azure Key Vault 中新增 DICOM 服務的金鑰。 如需步驟,請參閱在 Azure Key Vault 中新增金鑰。 客戶自控金鑰必須符合下列需求:

    • 金鑰已設定版本。

    • 金鑰類型為 RSA-HSMRSA

    • 金鑰為 2048 位元3072 位元

    • 金鑰保存庫與您的 DICOM 服務位於同一個 Azure 租用戶中。

    • 使用具有防火牆的金鑰保存庫來停用公用存取時,必須啟用 [允許受信任的 Microsoft 服務略過此防火牆] 選項。

    • 若要防止遺失 DICOM 服務的加密金鑰,金鑰保存庫或受控 HSM 必須已啟用虛刪除和清除保護。 這些功能可讓您復原已刪除一段時間的金鑰 (預設為 90 天),並封鎖永久刪除,直到該時間結束為止。

啟用 DICOM 服務的受控識別

您可以使用系統指派或使用者指派的受控識別。 若要了解系統指派和使用者指派受控識別類型之間的差異,請參閱 受控識別類型

系統指派的受控識別

  1. 在 Azure 入口網站中,移至 DICOM 執行個體。 從左側窗格選取 [身分識別]

  2. 在 [身分識別] 頁面上,選取 [系統指派] 索引標籤。

  3. 將 [狀態] 欄位設為 [開啟]

  4. 選擇儲存

Screenshot showing the system-assigned managed identity toggle on the Identity page.

使用者指派的受控識別

如需新增使用者指派受控識別的步驟,請參閱管理使用者指派的受控識別

指派 Key Vault 密碼編譯服務加密使用者

系統指派的受控識別需要 Key Vault 密碼編譯服務加密使用者以存取金鑰,並將其用於加密和解密資料。

  1. 在 Azure 入口網站中,移至金鑰保存庫,然後從左側窗格選擇 [存取控制 (IAM)]

  2. 在 [存取控制 (IAM)] 頁面上,選取 [新增角色指派]

Screenshot of the Access control (IAM) view for the key vault.

  1. 在 [新增角色指派] 頁面上,選取 [Key Vault 密碼編譯服務加密使用者] 角色。

  2. 選取 [下一步]。

Screenshot showing the Key Vault Crypto Officer role selected on the role assignments tab.

  1. 在 [成員] 索引標籤上,選取 [受控識別],然後選取 [+選取成員]

  2. 在 [選取受控識別] 窗格的 [受控識別] 下拉式清單,選取 [DICOM 服務]。 選取 [DICOM 服務]。

  3. 在 [選取受控識別] 窗格上,選擇 [選取]

Screenshot of selecting the system assigned managed identity in the Add role assignment page.

  1. 檢閱角色指派,然後選取 [檢閱 + 指派]

Screenshot of the role assignment with the review + assign action.

使用加密金鑰更新 DICOM 服務

新增金鑰之後,您必須使用金鑰 URL 更新 DICOM 服務。

  1. 在金鑰保存庫中,選取 [金鑰]

  2. 選取 DICOM 服務的金鑰。

Screenshot of the Keys page and the key to use with the DICOM service.

  1. 選取金鑰版本。

  2. 複製金鑰識別碼。 當您使用 ARM 範本更新金鑰時,您需要金鑰 URL。

Screenshot showing the key version details and the copy action for the Key Identifier.

使用 Azure 入口網站更新金鑰

  1. 在 Azure 入口網站中,移至 DICOM 服務,然後從左側窗格中選取 [加密]

  2. 針對 [加密類型],選取 [客戶自控金鑰]

  3. 選取金鑰保存庫和金鑰,或輸入先前所建立金鑰的金鑰 URI。

  4. 選取與先前所設定受控識別類型相符的系統指派或使用者指派身分識別類型。

  5. 選取 [儲存] 以更新 DICOM 服務為使用客戶自控金鑰。

Screenshot of the Encryption view, showing the selection of the Customer-managed key option, key vault settings, identity type settings, and Save button.

使用 ARM 範本更新金鑰

使用 Azure 入口網站來部署自訂範本,並使用其中一個 ARM 範本來更新金鑰。 如需詳細資訊,請參閱使用 Azure 入口網站建立及部署 ARM 範本

系統指派的受控識別的 ARM 範本

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "workspaceName": {
            "type": "String"
        },
        "dicomServiceName": {
            "type": "String"
        },
        "keyEncryptionKeyUrl": {
            "type": "String"
        },
        "region": {
            "defaultValue": "West US 3",
            "type": "String"
        }
    },
    "resources": [
        {
            "type": "Microsoft.HealthcareApis/workspaces/dicomservices",
            "apiVersion": "2023-06-01-preview",
            "name": "[concat(parameters('workspaceName'), '/', parameters('dicomServiceName'))]",
            "location": "[parameters('region')]",
            "identity": {
                "type": "SystemAssigned"
            },
            "properties": {
                "encryption": {
                    "customerManagedKeyEncryption": {
                        "keyEncryptionKeyUrl": "[parameters('keyEncryptionKeyUrl')]"
                    }
                }
            }
        }
    ]
}

使用者指派的受控識別的 ARM 範本

{
    "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
    "contentVersion": "1.0.0.0",
    "parameters": {
        "workspaceName": {
            "type": "String"
        },
        "dicomServiceName": {
            "type": "String"
        },
        "keyVaultName": {
            "type": "String"
        },
        "keyName": {
            "type": "String"
        },
        "userAssignedIdentityName": {
            "type": "String"
        },
        "roleAssignmentName": {
            "type": "String"
        },
        "region": {
            "defaultValue": "West US 3",
            "type": "String"
        },
        "tenantId": {
            "type": "String"
        }
    },
    "resources": [
        {
            "type": "Microsoft.KeyVault/vaults",
            "apiVersion": "2022-07-01",
            "name": "[parameters('keyVaultName')]",
            "location": "[parameters('region')]",
            "properties": {
              "accessPolicies": [],
              "enablePurgeProtection": true,
              "enableRbacAuthorization": true,
              "enableSoftDelete": true,
              "sku": {
                "family": "A",
                "name": "standard"
              },
              "tenantId": "[parameters('tenantId')]"
            }
        },
        {
            "type": "Microsoft.ManagedIdentity/userAssignedIdentities",
            "apiVersion": "2023-01-31",
            "name": "[parameters('userAssignedIdentityName')]",
            "location": "[parameters('region')]"
        },
        {
            "type": "Microsoft.KeyVault/vaults/keys",
            "apiVersion": "2022-07-01",
            "name": "[concat(parameters('keyVaultName'), '/', parameters('keyName'))]",
            "properties": {
              "attributes": {
                "enabled": true
              },
              "curveName": "P-256",
              "keyOps": [ "unwrapKey","wrapKey" ],
              "keySize": 2048,
              "kty": "RSA"
            },
            "dependsOn": [
                "[resourceId('Microsoft.KeyVault/vaults/', parameters('keyVaultName'))]"
            ]
        },
        {
            "type": "Microsoft.Authorization/roleAssignments",
            "apiVersion": "2021-04-01-preview",
            "name": "[guid(parameters('roleAssignmentName'))]",
            "properties": {
              "roleDefinitionId": "[resourceId('Microsoft.Authorization/roleDefinitions', '14b46e9e-c2b7-41b4-b07b-48a6ebf60603')]",
              "principalId": "[reference(resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('userAssignedIdentityName'))).principalId]"
            },
            "dependsOn": [
                "[resourceId('Microsoft.KeyVault/vaults/keys', parameters('keyVaultName'), parameters('keyName'))]",
                "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities', parameters('userAssignedIdentityName'))]"
            ]
        },
        {
            "type": "Microsoft.HealthcareApis/workspaces",
            "name": "[parameters('workspaceName')]",
            "apiVersion": "2022-05-15",
            "location": "[parameters('region')]"
        },
        {
            "type": "Microsoft.HealthcareApis/workspaces/dicomservices",
            "apiVersion": "2023-06-01-preview",
            "name": "[concat(parameters('workspaceName'), '/', parameters('dicomServiceName'))]",
            "location": "[parameters('region')]",
            "dependsOn": [
                "[resourceId('Microsoft.HealthcareApis/workspaces', parameters('workspaceName'))]",
                "[resourceId('Microsoft.Authorization/roleAssignments', guid(parameters('roleAssignmentName')))]"
            ],
            "identity": {
                "type": "userAssigned",
                "userAssignedIdentities": {
                    "[resourceId('Microsoft.ManagedIdentity/userAssignedIdentities/', parameters('userAssignedIdentityName'))]": {}
                }
            },
            "properties": {
                "encryption": {
                    "customerManagedKeyEncryption": {
                        "keyEncryptionKeyUrl": "[reference(resourceId('Microsoft.KeyVault/vaults/keys', parameters('keyVaultName'), parameters('keyName'))).keyUriWithVersion]"
                    }
                }
            }
        }
    ]
}
  1. 出現提示時,請選取資源群組、區域、工作區和 DICOM 服務名稱的值。

    • 如果您使用系統指派的受控識別,請輸入從金鑰保存庫的 [金鑰加密金鑰 URL] 欄位中複製的金鑰識別碼
    • 如果您使用使用者指派的受控識別,請輸入金鑰保存庫名稱、金鑰名稱、使用者指派的身分識別名稱和租用戶識別碼的值。
  2. 選取 [檢閱 + 建立] 來部署金鑰的更新。

Screenshot of the deployment template with details, including Key Encryption Key URL filled in.

從遺失的金鑰存取中復原

若要讓 DICOM 服務正常運作,必須一律能夠存取金鑰保存庫中的金鑰。 不過在某些情況下,服務可能會失去金鑰的存取權,包括:

  • 金鑰已停用或已從金鑰保存庫刪除。

  • DICOM 服務系統指派的受控識別已停用。

  • DICOM 服務系統指派的受控識別失去金鑰保存庫的存取權。

在 DICOM 服務無法存取金鑰的任何案例中,API 要求會傳回 500 錯誤,且資料在還原金鑰之前無法存取。 DICOM 服務的 Azure 資源健康狀態檢視可協助您診斷金鑰存取問題。

如果金鑰遺失超過 30 分鐘,請務必更新 DICOM 服務以重新整理金鑰存取。 如需詳細資訊,請參閱使用加密金鑰更新 DICOM 服務。 如果您也未更新 DICOM 服務,則即使已還原金鑰存取,仍繼續無法使用。

變更受控識別後更新 DICOM 服務

如果您以任何方式變更受控識別 (例如將 DICOM 服務移至不同的租用戶或訂用帳戶),則必須等到您使用 ARM 範本部署手動更新該服務之後 DICOM 服務才能存取您的金鑰。 如需相關步驟,請參閱使用 ARM 範本來更新加密金鑰

Screenshot of the encryption view with Encryption type showing Customer-managed key.

建立 DICOM 服務時設定金鑰

如果您搭配 FHIR 服務使用使用者指派的受控識別,您可以在建立 DICOM 服務的同時設定客戶自控金鑰。

  1. 在 [建立 DICOM 服務] 頁面上,輸入 FHIR 服務名稱

  2. 選擇 [下一步:安全性]

Screenshot of the Create DICOM service view with the DICOM service name filled in.

  1. 在 [安全性] 索引標籤的 [加密] 區段中,選取 [客戶自控金鑰]

  2. 選擇 [從金鑰保存庫選取],或 [輸入金鑰 URI],然後輸入金鑰。

  3. 選擇 [選取身分識別] 以使用使用者指派的受控識別。 在選取使用者指派的受控識別頁面上,篩選然後選取受控識別。 選擇新增

  4. 在 [安全性] 索引標籤上,選擇 [檢閱 + 建立]Screenshot of the Security tab with the Customer-managed key option selected.

  5. 在 [檢閱 + 建立] 索引標籤上,檢閱組態選項的摘要和驗證成功訊息。 選擇 [建立],以使用客戶自控金鑰來部署 DICOM 服務。

Screenshot of the Review + create tab with the selected options and validation success message shown.

注意

DICOM® 是美國電氣製造商協會對於其與醫療資訊數位通訊相關的標準出版物的註冊商標。