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/managed-hsm/tls-offload-library.md
+39-38Lines changed: 39 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@ author: msmbaldwin
6
6
ms.service: key-vault
7
7
ms.workload: identity
8
8
ms.topic: conceptual
9
-
ms.date: 02/20/2023
9
+
ms.date: 02/25/2023
10
10
ms.author: mbaldwin
11
11
---
12
12
13
13
# Azure Managed HSM TLS Offload Library
14
14
15
-
Azure Managed HSM offers a TLS Offload library, which is compliant with PKCS#11 version 2.40. We don't support all possible functions listed in the PKCS#11 specification. Our TLS Offload library supports a limited set of mechanisms and interface functions for SSL/TLS Offload with F5 (BigIP) and Nginx only, primarily to generate TLS server certificate keys and generate digital signatures during TLS handshakes.
15
+
Azure Managed HSM offers a TLS Offload library, which is compliant with PKCS#11 version 2.40. Azure Managed HSM doesn't support all functions listed in the PKCS#11 specification; instead, the TLS Offload library supports a limited set of mechanisms and interface functions for SSL/TLS Offload with F5 (BigIP) and Nginx only, primarily to generate TLS server certificate keys and generate digital signatures during TLS handshakes.
16
16
17
-
For more information, [Azure Managed HSM TLS Offload Library GitHub](https://github.com/microsoft/AzureManagedHsmTLSOffload).
17
+
For more information, see [Azure Managed HSM TLS Offload Library GitHub](https://github.com/microsoft/AzureManagedHsmTLSOffload).
18
18
19
19
The TLS Offload Library internally uses the Azure Key Vault REST API to interact with Azure Managed HSM.
20
20
@@ -35,20 +35,21 @@ Applications that use the TLS Offload Library use one or more PKCS#11 attributes
35
35
> [!WARNING]
36
36
> Keys generated by the TLS Offload Library and their Tags are accessible over Azure Key Vault REST API. Manipulating these P11 Attribute Tags using Azure Key Vault REST API may break the TLS Offload Library applications.
37
37
38
-
### Key Generation
39
-
The TLS Offload Library includes a key creation tool - mhsm_p11_create_key. Running the tool without any command line arguments shows the correct usage of the tool.
38
+
### Key Generation
40
39
41
-
The key creation tool requires a Service Principal, which is assigned to the "Managed HSM Crypto User" role at the "/keys" scope.
40
+
The TLS Offload Library includes a key creation tool, mhsm_p11_create_key. Running the tool without any command line arguments shows the correct usage of the tool.
42
41
43
-
The key creation tool reads the Service Principal credentials from the environment variables MHSM_CLIENT_ID and MHSM_CLIENT_SECRET.
44
-
- MHSM_CLIENT_ID – must be set to the Service Principal's Application (Client) ID
45
-
- MHSM_CLIENT_SECRET – must be set to the Service Principal's Password (Client Secret)
42
+
The key creation tool requires a service principal, which is assigned to the "Managed HSM Crypto User" role at the "/keys" scope.
46
43
47
-
The key creation tool randomly generates a name for the key at the time of creation. The full Azure Key Vault Key ID and the Key Name are printed to the console for your convenience.
44
+
The key creation tool reads the service principal credentials from the environment variables MHSM_CLIENT_ID and MHSM_CLIENT_SECRET.
45
+
- MHSM_CLIENT_ID – must be set to the service principal's application (client) ID
46
+
- MHSM_CLIENT_SECRET – must be set to the service principal's password (client secret)
47
+
48
+
The key creation tool randomly generates a name for the key at the time of creation. The full Azure Key Vault key ID and the key name are printed to the console for your convenience.
48
49
49
50
```azurepowershell
50
-
MHSM_CLIENT_ID="Service Principal Application Id" \
@@ -69,12 +70,12 @@ For more information on Azure Managed HSM local RBAC, see:
69
70
-[Azure Managed HSM local RBAC built-in roles](built-in-roles.md)
70
71
-[Azure Managed HSM role management](role-management.md)
71
72
72
-
The following section describes different approaches to implement access control for the TLS Offload Library Service Principal.
73
+
The following section describes different approaches to implement access control for the TLS Offload Library service principal.
73
74
74
-
#### TLS Offload Service Principal
75
+
#### TLS Offload service principal
75
76
76
-
The TLS Offload Service Principal is used by the application that uses TLS Offload Library to access keys. This Service Principal should have at minimum the following permission via role assignments:
77
-
- KeyRead permission to all the keys in the Managed HSM
77
+
The TLS Offload service principal is used by the application that uses TLS Offload Library to access keys, and should have at minimum the following permission via role assignments:
78
+
- KeyRead permission to all the keys in the managed HSM
78
79
- KeySign permission to the keys necessary for TLS offloading
79
80
80
81
#### Admin User
@@ -86,7 +87,7 @@ The Admin User will create a custom role definition and role assignments. Hence,
86
87
87
88
#### Key generation service principal
88
89
89
-
The key generation service principal is used with the key creation tool (mhsm_p11_create_key) to generate TLS offload keys. This Service Principal should be assigned to the "Managed HSM Crypto User" role at the "/keys" scope.
90
+
The key generation service principal is used with the key creation tool (mhsm_p11_create_key) to generate TLS offload keys. This service principal should be assigned to the "Managed HSM Crypto User" role at the "/keys" scope.
90
91
91
92
#### Azure CLI
92
93
@@ -96,7 +97,7 @@ Azure CLI can be used to perform tasks such as Role Assignment.
96
97
97
98
The permissive approach is simpler, and suitable when the Azure Managed HSM is exclusively used for TLS offloading.
98
99
99
-
Assign the Crypto User role to TLS Offload Service Principal at the "/keys" scope. This gives the TLS Offload Service Principal the permission to generate keys and find them for TLS Offloading.
100
+
Assign the Crypto User role to TLS Offload service principal at the "/keys" scope. This gives the TLS Offload service principal the permission to generate keys and find them for TLS Offloading.
100
101
101
102
```azurecli
102
103
az keyvault role assignment create --hsm-name ContosoMHSM \
@@ -107,13 +108,13 @@ az keyvault role assignment create --hsm-name ContosoMHSM \
107
108
108
109
### Granular Approach
109
110
110
-
The granular approach implements fine grained access control. It requires two Service Principals (TLS Offload Service Principal and Key Generation Service Principal) and an Admin User.
111
+
The granular approach implements fine grained access control. It requires two service principals (TLS Offload service principal and Key Generation service principal) and an Admin User.
111
112
112
-
The objective is to restrict the TLS Offload Service Principal's permissions to support the minimum required for TLS offload. The user must have the Read permission for other keys to support the library's C_FindObject* function.
113
+
The objective is to restrict the TLS Offload service principal's permissions to support the minimum required for TLS offload. The user must have the Read permission for other keys to support the library's C_FindObject* function.
113
114
114
115
#### TLS Offload Library User Read Role
115
116
116
-
The first step in implementing the granular approach is to create a custom role. This is a one-time operation.
117
+
The first step in implementing the granular approach is to create a custom role. This operation only needs to be done once.
117
118
118
119
The Admin User (with Managed HSM Crypto Officer or Managed HSM Administrator or Managed HSM Policy Administrator role) creates a custom "TLS Library User Read Role" role definition:
119
120
@@ -130,11 +131,11 @@ az keyvault role definition create --hsm-name ContosoMHSM --role-definition '{ \
130
131
131
132
#### Generate Keys
132
133
133
-
Keys can be generated using the Key Generation Service Principal with the key creation tool (mhsm_p11_create_key).
134
+
Keys can be generated using the Key Generation service principal with the key creation tool (mhsm_p11_create_key).
134
135
135
136
#### Grant Permission
136
137
137
-
The Admin User assigns the following roles to the TLS Offload Service Principal.
138
+
The Admin User assigns the following roles to the TLS Offload service principal.
138
139
- Assign "TLS Library User Read Role" role at the "/keys" scope
139
140
- Assign "Managed HSM Crypto User" role at the "/keys/{key name}" scope
140
141
@@ -158,17 +159,17 @@ az keyvault role assignment create --hsm-name ContosoMHSM \
158
159
159
160
The TLS Offload Library includes a key creation tool - mhsm_p11_create_key. Running the tool without any command line arguments shows the correct usage of the tool.
160
161
161
-
The key creation tool requires a Service Principal, which is assigned to the "Managed HSM Crypto User" role at the "/keys" scope.
162
+
The key creation tool requires a service principal, which is assigned to the "Managed HSM Crypto User" role at the "/keys" scope.
162
163
163
-
The key creation tool reads the Service Principal credentials from the environment variables MHSM_CLIENT_ID and MHSM_CLIENT_SECRET.
164
-
- MHSM_CLIENT_ID – must be set to the Service Principal's Application (Client) ID
165
-
- MHSM_CLIENT_SECRET – must be set to the Service Principal's Password (Client Secret)
164
+
The key creation tool reads the service principal credentials from the environment variables MHSM_CLIENT_ID and MHSM_CLIENT_SECRET.
165
+
- MHSM_CLIENT_ID – must be set to the service principal's application (client) ID
166
+
- MHSM_CLIENT_SECRET – must be set to the service principal's password (client secret)
166
167
167
168
The key creation tool randomly generates a name for the key at the time of creation. The full Azure Key Vault Key ID and the Key Name are printed to the console for your convenience.
168
169
169
170
```azurepowershell
170
-
MHSM_CLIENT_ID="Service Principal Application Id" \
@@ -186,8 +187,8 @@ There are two approaches to generating a key and using the key for the Key Less
186
187
187
188
#### Simpler approach
188
189
189
-
1. Create a Service Principal for the TLS Offload Library (for example, TLSOffload ServicePrincipal)
190
-
2. Assign "Managed HSM Crypto User" role to the TLS Offload Service Principal at the "/keys" scope.
190
+
1. Create a service principal for the TLS Offload Library (for example, TLSOffload ServicePrincipal)
191
+
2. Assign "Managed HSM Crypto User" role to the TLS Offload service principal at the "/keys" scope.
191
192
```azurecli
192
193
az keyvault role assignment create --hsm-name ContosoMHSM \
193
194
--role "Managed HSM Crypto User" \
@@ -196,15 +197,15 @@ There are two approaches to generating a key and using the key for the Key Less
196
197
```
197
198
3. Generate key with required label following the steps in [How to generate keys using the TLS Offload Library](#how-to-generate-keys-using-the-tls-offload-library).
198
199
4. Configure the TLS server to use the Managed HSM TLS Offload Library as the PKCS#11 interface library
199
-
5. Configure the TLS server (for example, the nginx SSL configuration setting `ssl_certificate_key') with the key label and the TLS Offload Service Principal credentials
200
+
5. Configure the TLS server (for example, the nginx SSL configuration setting `ssl_certificate_key') with the key label and the TLS Offload service principal credentials
200
201
201
202
#### Granular approach
202
203
203
204
1. Create an Admin User (for example, TLSOffloadAdminUser) with the following role:
204
205
- "Managed HSM Crypto Officer" role at the "/" scope
205
-
1. Create a Key Generation Service Principal (for example, TLSOffloadKeyGenServicePrincipal) for the TLS Offload Key generation and assign the following role:
206
+
1. Create a Key Generation service principal (for example, TLSOffloadKeyGenServicePrincipal) for the TLS Offload Key generation and assign the following role:
206
207
- "Managed HSM Crypto User" role at the "/keys" scope.
207
-
1. Create a Service Principal for the TLS Offloading (for example, TLSOffload ServicePrincipal)
208
+
1. Create a service principal for the TLS Offloading (for example, TLSOffload ServicePrincipal)
208
209
1. The Admin User creates the following custom role definition:
209
210
```azurecli
210
211
az keyvault role definition create --hsm-name ContosoMHSM --role-definition '{ \
@@ -216,10 +217,10 @@ There are two approaches to generating a key and using the key for the Key Less
216
217
"notDataActions": []
217
218
}'
218
219
```
219
-
1. Generate a key with required label following "How to generate keys using the TLS Offload Library". Use the Key Generation Service Principal (for example, TLSOffloadKeyGenServicePrincipal) while generating keys. Note down the Key Label and Key Name. For example:
220
+
1. Generate a key with required label following "How to generate keys using the TLS Offload Library". Use the Key Generation service principal (for example, TLSOffloadKeyGenServicePrincipal) while generating keys. Note down the Key Label and Key Name. For example:
220
221
- Key Label: tlsKey
221
222
- Key Name: p11-6a2155dc40c94367a0f97ab452dc216f
222
-
1. Admin User assigns the following roles to the TLS Offload Service Principal
223
+
1. Admin User assigns the following roles to the TLS Offload service principal
223
224
- "TLS Library User Read Role" role at the "/keys" scope
224
225
- "Managed HSM Crypto User" role at the "/keys/{key name}" scope
225
226
```azurecli
@@ -233,8 +234,8 @@ There are two approaches to generating a key and using the key for the Key Less
1. Configure the TLS server to use the Managed HSM TLS Offload Library as the PKCS#11 interface library
237
-
1. Configure the TLS server (for example, the nginx SSL configuration setting `ssl_certificate_key') with the key label and the TLS Offload Service Principal credentials
237
+
1. Configure the TLS server to use the Azure Managed HSM TLS Offload Library as the PKCS#11 interface library
238
+
1. Configure the TLS server (for example, the nginx SSL configuration setting `ssl_certificate_key') with the key label and the TLS Offload service principal credentials
0 commit comments