You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/key-vault/key-vault-hsm-protected-keys.md
+28-12Lines changed: 28 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,12 +13,12 @@ ms.workload: identity
13
13
ms.tgt_pltfrm: na
14
14
ms.devlang: na
15
15
ms.topic: article
16
-
ms.date: 12/05/2017
16
+
ms.date: 08/27/2018
17
17
ms.author: barclayn
18
18
19
19
---
20
20
# How to generate and transfer HSM-protected keys for Azure Key Vault
21
-
## Introduction
21
+
22
22
For added assurance, when you use Azure Key Vault, you can import or generate keys in hardware security modules (HSMs) that never leave the HSM boundary. This scenario is often referred to as *bring your own key*, or BYOK. The HSMs are FIPS 140-2 Level 2 validated. Azure Key Vault uses Thales nShield family of HSMs to protect your keys.
23
23
24
24
Use the information in this topic to help you plan for, generate, and then transfer your own HSM-protected keys to use with Azure Key Vault.
@@ -27,10 +27,7 @@ This functionality is not available for Azure China.
27
27
28
28
> [!NOTE]
29
29
> For more information about Azure Key Vault, see [What is Azure Key Vault?](key-vault-whatis.md)
30
-
>
31
30
> For a getting started tutorial, which includes creating a key vault for HSM-protected keys, see [Get started with Azure Key Vault](key-vault-get-started.md).
32
-
>
33
-
>
34
31
35
32
More information about generating and transferring an HSM-protected key over the Internet:
36
33
@@ -42,24 +39,28 @@ More information about generating and transferring an HSM-protected key over the
42
39
* Microsoft uses separate KEKs and separate Security Worlds in each geographical region. This separation ensures that your key can be used only in data centers in the region in which you encrypted it. For example, a key from a European customer cannot be used in data centers in North American or Asia.
43
40
44
41
## More information about Thales HSMs and Microsoft services
42
+
45
43
Thales e-Security is a leading global provider of data encryption and cyber security solutions to the financial services, high technology, manufacturing, government, and technology sectors. With a 40-year track record of protecting corporate and government information, Thales solutions are used by four of the five largest energy and aerospace companies. Their solutions are also used by 22 NATO countries, and secure more than 80 per cent of worldwide payment transactions.
46
44
47
45
Microsoft has collaborated with Thales to enhance the state of art for HSMs. These enhancements enable you to get the typical benefits of hosted services without relinquishing control over your keys. Specifically, these enhancements let Microsoft manage the HSMs so that you do not have to. As a cloud service, Azure Key Vault scales up at short notice to meet your organization’s usage spikes. At the same time, your key is protected inside Microsoft’s HSMs: You retain control over the key lifecycle because you generate the key and transfer it to Microsoft’s HSMs.
48
46
49
47
## Implementing bring your own key (BYOK) for Azure Key Vault
48
+
50
49
Use the following information and procedures if you will generate your own HSM-protected key and then transfer it to Azure Key Vault—the bring your own key (BYOK) scenario.
51
50
52
51
## Prerequisites for BYOK
52
+
53
53
See the following table for a list of prerequisites for bring your own key (BYOK) for Azure Key Vault.
54
54
55
55
| Requirement | More information |
56
56
| --- | --- |
57
57
| A subscription to Azure |To create an Azure Key Vault, you need an Azure subscription: [Sign up for free trial](https://azure.microsoft.com/pricing/free-trial/)|
58
58
| The Azure Key Vault Premium service tier to support HSM-protected keys |For more information about the service tiers and capabilities for Azure Key Vault, see the [Azure Key Vault Pricing](https://azure.microsoft.com/pricing/details/key-vault/) website. |
59
59
| Thales HSM, smartcards, and support software |You must have access to a Thales Hardware Security Module and basic operational knowledge of Thales HSMs. See [Thales Hardware Security Module](https://www.thales-esecurity.com/msrms/buy) for the list of compatible models, or to purchase an HSM if you do not have one. |
60
-
| The following hardware and software:<ol><li>An offline x64 workstation with a minimum Windows operation system of Windows 7 and Thales nShield software that is at least version 11.50.<br/><br/>If this workstation runs Windows 7, you must [install Microsoft .NET Framework 4.5](http://download.microsoft.com/download/b/a/4/ba4a7e71-2906-4b2d-a0e1-80cf16844f5f/dotnetfx45_full_x86_x64.exe).</li><li>A workstation that is connected to the Internet and has a minimum Windows operating system of Windows 7 and [Azure PowerShell](/powershell/azure/overview) **minimum version 1.1.0** installed.</li><li>A USB drive or other portable storage device that has at least 16 MB free space.</li></ol> |For security reasons, we recommend that the first workstation is not connected to a network. However, this recommendation is not programmatically enforced.<br/><br/>Note that in the instructions that follow, this workstation is referred to as the disconnected workstation.</p></blockquote><br/>In addition, if your tenant key is for a production network, we recommend that you use a second, separate workstation to download the toolset and upload the tenant key. But for testing purposes, you can use the same workstation as the first one.<br/><br/>Note that in the instructions that follow, this second workstation is referred to as the Internet-connected workstation.</p></blockquote><br/> |
60
+
| The following hardware and software:<ol><li>An offline x64 workstation with a minimum Windows operation system of Windows 7 and Thales nShield software that is at least version 11.50.<br/><br/>If this workstation runs Windows 7, you must [install Microsoft .NET Framework 4.5](http://download.microsoft.com/download/b/a/4/ba4a7e71-2906-4b2d-a0e1-80cf16844f5f/dotnetfx45_full_x86_x64.exe).</li><li>A workstation that is connected to the Internet and has a minimum Windows operating system of Windows 7 and [Azure PowerShell](https://docs.microsoft.com/powershell/azure/overview?view=azurermps-6.7.0) **minimum version 1.1.0** installed.</li><li>A USB drive or other portable storage device that has at least 16 MB free space.</li></ol> |For security reasons, we recommend that the first workstation is not connected to a network. However, this recommendation is not programmatically enforced.<br/><br/>Note that in the instructions that follow, this workstation is referred to as the disconnected workstation.</p></blockquote><br/>In addition, if your tenant key is for a production network, we recommend that you use a second, separate workstation to download the toolset and upload the tenant key. But for testing purposes, you can use the same workstation as the first one.<br/><br/>Note that in the instructions that follow, this second workstation is referred to as the Internet-connected workstation.</p></blockquote><br/> |
61
61
62
62
## Generate and transfer your key to Azure Key Vault HSM
63
+
63
64
You will use the following five steps to generate and transfer your key to an Azure Key Vault HSM:
64
65
65
66
*[Step 1: Prepare your Internet-connected workstation](#step-1-prepare-your-internet-connected-workstation)
@@ -69,29 +70,33 @@ You will use the following five steps to generate and transfer your key to an Az
69
70
*[Step 5: Transfer your key to Azure Key Vault](#step-5-transfer-your-key-to-azure-key-vault)
70
71
71
72
## Step 1: Prepare your Internet-connected workstation
73
+
72
74
For this first step, do the following procedures on your workstation that is connected to the Internet.
73
75
74
76
### Step 1.1: Install Azure PowerShell
77
+
75
78
From the Internet-connected workstation, download and install the Azure PowerShell module that includes the cmdlets to manage Azure Key Vault. This requires a minimum version of 0.8.13.
76
79
77
80
For installation instructions, see [How to install and configure Azure PowerShell](/powershell/azure/overview).
78
81
79
82
### Step 1.2: Get your Azure subscription ID
83
+
80
84
Start an Azure PowerShell session and sign in to your Azure account by using the following command:
81
85
82
86
```Powershell
83
-
Add-AzureAccount
87
+
Add-AzureRMAccount
84
88
```
85
89
In the pop-up browser window, enter your Azure account user name and password. Then, use the [Get-AzureSubscription](/powershell/module/servicemanagement/azure/get-azuresubscription?view=azuresmps-3.7.0) command:
86
90
87
91
```powershell
88
-
Get-AzureSubscription
92
+
Get-AzureRMSubscription
89
93
```
90
94
From the output, locate the ID for the subscription you will use for Azure Key Vault. You will need this subscription ID later.
91
95
92
96
Do not close the Azure PowerShell window.
93
97
94
98
### Step 1.3: Download the BYOK toolset for Azure Key Vault
99
+
95
100
Go to the Microsoft Download Center and [download the Azure Key Vault BYOK toolset](http://www.microsoft.com/download/details.aspx?id=45345) for your geographic region or instance of Azure. Use the following information to identify the package name to download and its corresponding SHA-256 package hash:
96
101
97
102
- - -
@@ -211,9 +216,11 @@ The toolset includes the following:
211
216
Copy the package to a USB drive or other portable storage.
212
217
213
218
## Step 2: Prepare your disconnected workstation
219
+
214
220
For this second step, do the following procedures on the workstation that is not connected to a network (either the Internet or your internal network).
215
221
216
222
### Step 2.1: Prepare the disconnected workstation with Thales HSM
223
+
217
224
Install the nCipher (Thales) support software on a Windows computer, and then attach a Thales HSM to that computer.
218
225
219
226
Ensure that the Thales tools are in your path (**%nfast_home%\bin**). For example, type the following:
@@ -225,20 +232,24 @@ Ensure that the Thales tools are in your path (**%nfast_home%\bin**). For exampl
225
232
For more information, see the user guide included with the Thales HSM.
226
233
227
234
### Step 2.2: Install the BYOK toolset on the disconnected workstation
235
+
228
236
Copy the BYOK toolset package from the USB drive or other portable storage, and then do the following:
229
237
230
238
1. Extract the files from the downloaded package into any folder.
231
239
2. From that folder, run vcredist_x64.exe.
232
240
3. Follow the instructions to the install the Visual C++ runtime components for Visual Studio 2013.
233
241
234
242
## Step 3: Generate your key
243
+
235
244
For this third step, do the following procedures on the disconnected workstation. To complete this step your HSM must be in initialization mode.
236
245
237
246
238
247
### Step 3.1: Change the HSM mode to 'I'
248
+
239
249
If you are using Thales nShield Edge, to change the mode: 1. Use the Mode button to highlight the required mode. 2. Within a few seconds, press and hold the Clear button for a couple of seconds. If the mode changes, the new mode’s LED stops flashing and remains lit. The Status LED might flash irregularly for a few seconds and then flashes regularly when the device is ready. Otherwise, the device remains in the current mode, with the appropriate mode LED lit.
240
250
241
251
### Step 3.2: Create a security world
252
+
242
253
Start a command prompt and run the Thales new-world program.
243
254
244
255
```cmd
@@ -252,10 +263,11 @@ Then do the following:
252
263
* Back up the world file. Secure and protect the world file, the Administrator Cards, and their pins, and make sure that no single person has access to more than one card.
253
264
254
265
### Step 3.3: Change the HSM mode to 'O'
255
-
If you are using Thales nShield Edge, to change the mode: 1. Use the Mode button to highlight the required mode. 2. Within a few seconds, press and hold the Clear button for a couple of seconds. If the mode changes, the new mode’s LED stops flashing and remains lit. The Status LED might flash irregularly for a few seconds and then flashes regularly when the device is ready. Otherwise, the device remains in the current mode, with the appropriate mode LED lit.
256
266
267
+
If you are using Thales nShield Edge, to change the mode: 1. Use the Mode button to highlight the required mode. 2. Within a few seconds, press and hold the Clear button for a couple of seconds. If the mode changes, the new mode’s LED stops flashing and remains lit. The Status LED might flash irregularly for a few seconds and then flashes regularly when the device is ready. Otherwise, the device remains in the current mode, with the appropriate mode LED lit.
257
268
258
269
### Step 3.4: Validate the downloaded package
270
+
259
271
This step is optional but recommended so that you can validate the following:
260
272
261
273
* The Key Exchange Key that is included in the toolset has been generated from a genuine Thales HSM.
@@ -264,8 +276,6 @@ This step is optional but recommended so that you can validate the following:
264
276
265
277
> [!NOTE]
266
278
> To validate the downloaded package, the HSM must be connected, powered on, and must have a security world on it (such as the one you’ve just created).
267
-
>
268
-
>
269
279
270
280
To validate the downloaded package:
271
281
@@ -325,6 +335,7 @@ This script validates the signer chain up to the Thales root key. The hash of th
325
335
You’re now ready to create a new key.
326
336
327
337
### Step 3.5: Create a new key
338
+
328
339
Generate a key by using the Thales **generatekey** program.
329
340
330
341
Run the following command to generate the key:
@@ -344,11 +355,12 @@ Back up this Tokenized Key File in a safe location.
344
355
> [!IMPORTANT]
345
356
> When you later transfer your key to Azure Key Vault, Microsoft cannot export this key back to you so it becomes extremely important that you back up your key and security world safely. Contact Thales for guidance and best practices for backing up your key.
346
357
>
347
-
>
358
+
348
359
349
360
You are now ready to transfer your key to Azure Key Vault.
350
361
351
362
## Step 4: Prepare your key for transfer
363
+
352
364
For this fourth step, do the following procedures on the disconnected workstation.
353
365
354
366
### Step 4.1: Create a copy of your key with reduced permissions
@@ -416,6 +428,7 @@ You may inspects the ACLS using following commands using the Thales utilities:
416
428
When you run these commands, replace contosokey with the same value you specified in **Step 3.5: Create a new key** from the [Generate your key](#step-3-generate-your-key) step.
417
429
418
430
### Step 4.2: Encrypt your key by using Microsoft’s Key Exchange Key
431
+
419
432
Run one of the following commands, depending on your geographic region or instance of Azure:
420
433
421
434
* For North America:
@@ -470,9 +483,11 @@ When you run this command, use these instructions:
470
483
When this completes successfully, it displays **Result: SUCCESS** and there is a new file in the current folder that has the following name: KeyTransferPackage-*ContosoFirstHSMkey*.byok
471
484
472
485
### Step 4.3: Copy your key transfer package to the Internet-connected workstation
486
+
473
487
Use a USB drive or other portable storage to copy the output file from the previous step (KeyTransferPackage-ContosoFirstHSMkey.byok) to your Internet-connected workstation.
474
488
475
489
## Step 5: Transfer your key to Azure Key Vault
490
+
476
491
For this final step, on the Internet-connected workstation, use the [Add-AzureKeyVaultKey](/powershell/module/azurerm.keyvault/add-azurermkeyvaultkey) cmdlet to upload the key transfer package that you copied from the disconnected workstation to the Azure Key Vault HSM:
477
492
478
493
```powershell
@@ -482,4 +497,5 @@ For this final step, on the Internet-connected workstation, use the [Add-AzureKe
482
497
If the upload is successful, you see displayed the properties of the key that you just added.
483
498
484
499
## Next steps
500
+
485
501
You can now use this HSM-protected key in your key vault. For more information, see the **If you want to use a hardware security module (HSM)** section in the [Getting started with Azure Key Vault](key-vault-get-started.md) tutorial.
0 commit comments