Skip to content

Commit 98d149b

Browse files
committed
Updates
1 parent 0d15a69 commit 98d149b

File tree

1 file changed

+39
-38
lines changed

1 file changed

+39
-38
lines changed

articles/key-vault/managed-hsm/tls-offload-library.md

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ author: msmbaldwin
66
ms.service: key-vault
77
ms.workload: identity
88
ms.topic: conceptual
9-
ms.date: 02/20/2023
9+
ms.date: 02/25/2023
1010
ms.author: mbaldwin
1111
---
1212

1313
# Azure Managed HSM TLS Offload Library
1414

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.
1616

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).
1818

1919
The TLS Offload Library internally uses the Azure Key Vault REST API to interact with Azure Managed HSM.
2020

@@ -35,20 +35,21 @@ Applications that use the TLS Offload Library use one or more PKCS#11 attributes
3535
> [!WARNING]
3636
> 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.
3737
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
4039

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.
4241

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.
4643

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.
4849

4950
```azurepowershell
50-
MHSM_CLIENT_ID="Service Principal Application Id" \
51-
MHSM_CLIENT_SECRET="Service Principal Password" \
51+
MHSM_CLIENT_ID="<service-principal-application-id>" \
52+
MHSM_CLIENT_SECRET="<service-principal-password>" \
5253
mhsm_p11_create_key --RSA 4K --label tlsKey
5354
5455
Key is generated successfully. \
@@ -69,12 +70,12 @@ For more information on Azure Managed HSM local RBAC, see:
6970
- [Azure Managed HSM local RBAC built-in roles](built-in-roles.md)
7071
- [Azure Managed HSM role management](role-management.md)
7172

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.
7374

74-
#### TLS Offload Service Principal
75+
#### TLS Offload service principal
7576

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
7879
- KeySign permission to the keys necessary for TLS offloading
7980

8081
#### Admin User
@@ -86,7 +87,7 @@ The Admin User will create a custom role definition and role assignments. Hence,
8687

8788
#### Key generation service principal
8889

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.
9091

9192
#### Azure CLI
9293

@@ -96,7 +97,7 @@ Azure CLI can be used to perform tasks such as Role Assignment.
9697

9798
The permissive approach is simpler, and suitable when the Azure Managed HSM is exclusively used for TLS offloading.
9899

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.
100101

101102
```azurecli
102103
az keyvault role assignment create --hsm-name ContosoMHSM \
@@ -107,13 +108,13 @@ az keyvault role assignment create --hsm-name ContosoMHSM \
107108

108109
### Granular Approach
109110

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.
111112

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.
113114

114115
#### TLS Offload Library User Read Role
115116

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.
117118

118119
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:
119120

@@ -130,11 +131,11 @@ az keyvault role definition create --hsm-name ContosoMHSM --role-definition '{ \
130131

131132
#### Generate Keys
132133

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).
134135

135136
#### Grant Permission
136137

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.
138139
- Assign "TLS Library User Read Role" role at the "/keys" scope
139140
- Assign "Managed HSM Crypto User" role at the "/keys/{key name}" scope
140141

@@ -158,17 +159,17 @@ az keyvault role assignment create --hsm-name ContosoMHSM \
158159

159160
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.
160161

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.
162163

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)
166167

167168
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.
168169

169170
```azurepowershell
170-
MHSM_CLIENT_ID="Service Principal Application Id" \
171-
MHSM_CLIENT_SECRET="Service Principal Password" \
171+
MHSM_CLIENT_ID="<service-principal-application-id>" \
172+
MHSM_CLIENT_SECRET="<service-principal-password>" \
172173
mhsm_p11_create_key --RSA 4K --label tlsKey
173174
174175
Key is generated successfully.
@@ -186,8 +187,8 @@ There are two approaches to generating a key and using the key for the Key Less
186187

187188
#### Simpler approach
188189

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.
191192
```azurecli
192193
az keyvault role assignment create --hsm-name ContosoMHSM \
193194
--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
196197
```
197198
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).
198199
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
200201
201202
#### Granular approach
202203
203204
1. Create an Admin User (for example, TLSOffloadAdminUser) with the following role:
204205
- "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:
206207
- "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)
208209
1. The Admin User creates the following custom role definition:
209210
```azurecli
210211
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
216217
"notDataActions": []
217218
}'
218219
```
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:
220221
- Key Label: tlsKey
221222
- 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
223224
- "TLS Library User Read Role" role at the "/keys" scope
224225
- "Managed HSM Crypto User" role at the "/keys/{key name}" scope
225226
```azurecli
@@ -233,8 +234,8 @@ There are two approaches to generating a key and using the key for the Key Less
233234
--assignee [email protected] \
234235
--scope /keys/p11-6a2155dc40c94367a0f97ab452dc216f
235236
```
236-
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
238239
239240
## Next steps
240241

0 commit comments

Comments
 (0)