Skip to content

Commit 8cc53bc

Browse files
Merge pull request #236601 from msmbaldwin/patch-191
Update tls-offload-library.md
2 parents 5d9b8d5 + f89a693 commit 8cc53bc

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

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

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ The TLS Offload Library includes a key creation tool, mhsm_p11_create_key. Runni
4141

4242
The key creation tool requires a service principal, which is assigned to the "Managed HSM Crypto User" role at the "/keys" scope.
4343

44-
The key creation tool reads the service principal credentials from the environment variables MHSM_CLIENT_ID and MHSM_CLIENT_SECRET.
44+
The key creation tool reads the service principal credentials from the environment variables MHSM_CLIENT_ID and MHSM_CLIENT_SECRET:
4545
- MHSM_CLIENT_ID – must be set to the service principal's application (client) ID
4646
- MHSM_CLIENT_SECRET – must be set to the service principal's password (client secret)
4747

48+
For Managed Identities, the environment variables above are not needed.
49+
- Use the `--identity` argument to enable managed identity with the mhsm_p11_create_key tool.
50+
- The `client_id` of user-assigned managed identity should be cited in the MHSM configuration file (mhsm-pkcs11.conf). If the `client_id` of a user-assigned managed identity is not provided, it will consider it as system-assigned managed identity.
51+
4852
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.
4953

5054
```azurepowershell
@@ -70,7 +74,7 @@ For more information on Azure Managed HSM local RBAC, see:
7074
- [Azure Managed HSM local RBAC built-in roles](built-in-roles.md)
7175
- [Azure Managed HSM role management](role-management.md)
7276

73-
The following section describes different approaches to implement access control for the TLS Offload Library service principal.
77+
The following section describes different approaches to implement access control for the TLS Offload Library service principal and Managed Identity.
7478

7579
#### TLS Offload service principal
7680

@@ -105,6 +109,15 @@ az keyvault role assignment create --hsm-name ContosoMHSM \
105109
--assignee [email protected] \
106110
--scope /keys
107111
```
112+
For Managed Identities,specify command arguments as follows:
113+
114+
```azurecli
115+
az keyvault role assignment create --hsm-name ContosoMHSM \
116+
--role "Managed HSM Crypto User" \
117+
--assignee-object-id <object_id> \
118+
--assignee-principal-type MSI \
119+
--scope /keys
120+
```
108121

109122
### Granular approach
110123

@@ -152,6 +165,30 @@ az keyvault role assignment create --hsm-name ContosoMHSM \
152165
--assignee [email protected] \
153166
--scope /keys/p11-6a2155dc40c94367a0f97ab452dc216f
154167
```
168+
## Connection Caching
169+
170+
To improve the performance of Sign calls to the Managed HSM Service, TLS Offload Library caches its TLS connections to the Managed HSM service servers. By default, TLS Offload Library caches up to 20 TLS connections.
171+
Connection Caching can be controlled through MHSM configuration file (mhsm-pkcs11.conf).
172+
173+
```json
174+
"ConnectionCache": {
175+
"Disable": false,
176+
"MaxConnections": 20
177+
}
178+
```
179+
180+
**Disable**
181+
182+
If this value is true, Connection Caching will be disabled. It is enabled by default.
183+
184+
**MaxConnections**
185+
186+
Specifies maximum number of connections to cache. The maximum connection limit should be configured based on the number of concurrent PKCS11 sessions being used by the application. Applications typically create a pool of PKCS11 sessions and use them from a pool of threads to generate signing requests in parallel. The MaxConnections should match the number of concurrent signing requests generated by the applications.
187+
188+
The Signing Request Per Second (RPS) is dependent on the number of concurrent requests and the number of connections cached. Specifying a higher number or even the default limit will not improve the signing RPS if the number of concurrent PKCS11 Signing requests is lower than this limit.
189+
The maximum number of concurrent connections to achieve burst mode of Standard B1 HSM pool is about 30 depending on the instance type. But you should try with different numbers to figure out the optimal number concurrent connections.
190+
191+
Refer to your application documentation or contact your application vendor to learn more about how the application uses the PKCS11 library.
155192

156193
## Using the TLS Offload Library
157194

0 commit comments

Comments
 (0)