Configure Bring your own key (BYOK)
Scenario
A Key Vault customer would like to securely transfer a key from their on-premises Hardware Security Module (HSM) outside Azure, into the HSM backing Azure Key Vault. The process of importing a key generated outside Key Vault is referred to as Bring Your Own Key (BYOK).
The following are the requirements:
- The key to be transferred never exists outside an HSM in plain text form.
- Outside an HSM, the key to be transferred is always protected by a key held in the Azure Key Vault HSM.
Terminology
| Key Name | Key Type | Origin | Description |
|---|---|---|---|
| Key Exchange Key (KEK) | RSA | Azure Key Vault HSM | An HSM backed RSA key pair generated in Azure Key Vault |
| Wrapping Key | AES | Vendor HSM | An [ephemeral] AES key generated by HSM on-premises |
| Target Key | RSA, EC, AES (Managed HSM only) | Vendor HSM | The key to be transferred to the Azure Key Vault HSM |
Key Exchange Key (KEK): This is a customer-generated, HSM-backed key within the key vault intended for the import of the BYOK (Bring Your Own Key) key. The KEK should have the following properties:
- It must be an RSA-HSM key, with a size of 4096-bit, 3072-bit, or 2048-bit.
- Its key operations (key_ops) are limited to 'import', allowing its use exclusively during the BYOK process.
- It must reside in the same vault where the Target Key is to be imported.
User steps
To perform a key transfer:
- Generate KEK.
- Retrieve the public key of the KEK.
- Using HSM vendor provided BYOK tool, import the KEK into the target HSM and exports the Target Key protected by the KEK.
- Import the protected Target Key to Azure Key Vault.
Customers use the BYOK tool and documentation provided by HSM vendor to complete Steps 3. It produces a Key Transfer Blob (a ".byok" file).
HSM constraints
The existing HSM may apply constraints on key that they manage, including:
- The HSM may need to be configured to allow key wrap-based export
- The target key may need to be marked Cryptoki Attribute (CKA)_EXTRACTABLE for the HSM to allow controlled export
- In some cases, the KEK and wrapping key may need to be marked as CKA_TRUSTED, which allows it to be used to wrap keys in the HSM.
The configuration of source HSM is, generally, outside the scope of this specification. Microsoft expects the HSM vendor to produce documentation accompanying their BYOK tool to include any such configuration steps.
Comments
Post a Comment