Skip to content

Commit 1b64802

Browse files
Merge pull request #2635 from MicrosoftDocs/main
Auto Publish – main to live - 2026-03-21 06:00 UTC
2 parents 1ee0cae + f224ed2 commit 1b64802

16 files changed

Lines changed: 705 additions & 48 deletions

articles/key-vault/includes/key-management-policy-grammar.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ The encoding is as follows:
257257
An Environment Assertion is a signed assertion, in JSON Web Token form, from a trusted authority. An Environment Asserting contains at least a key encryption key and one or more claims about the target environment (for example, TEE type, publisher, version) that are matched against the Key Release Policy. The key encryption key is a public RSA key owned and protected by the target execution environment that is used for key export. It must appear in the TEE keys claim (x-ms-runtime/keys). This claim is a JSON object representing a JSON Web Key Set. Within the JWKS, one of the keys must meet the requirements for use as an encryption key (key_use is "enc", or key_ops contains "encrypt"). The first suitable key is chosen.
258258

259259
## Key Vault and Managed HSM Attestation Token Requirements
260-
Azure Key Vault Premium and Managed HSM Secure Key Release were designed alongside [Microsoft Azure Attestation Service](../../attestation/overview.md) but may work with any attestation servers tokens if it conforms to the expected token structure, supports OpenID connect, and has the expected claims. DigiCert is presently the only public CA that Azure Key Vault Premium and Managed HSM trust for attestation token signing certificates.
260+
Azure Key Vault Premium and Managed HSM Secure Key Release were designed alongside [Microsoft Azure Attestation Service](/azure/attestation/overview) but may work with any attestation server's tokens if it conforms to the expected token structure, supports OpenID connect, and has the expected claims. DigiCert is presently the only public CA that Azure Key Vault Premium and Managed HSM trust for attestation token signing certificates.
261261

262262

263263

@@ -279,4 +279,4 @@ The full set of requirements are:
279279

280280
- Marked with **key_use** of encryption or a **key_ops** array containing the Encrypt operation.
281281

282-
For a sample token see [Examples of an Azure Attestation token](../../attestation/attestation-token-examples.md#sample-jwt-generated-for-sev-snp-attestation).
282+
For a sample token see [Examples of an Azure Attestation token](/azure/attestation/attestation-token-examples#sample-jwt-generated-for-sev-snp-attestation).
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.subservice: managed-hsm
6+
ms.topic: include
7+
ms.date: 03/13/2026
8+
# Include: Managed HSM cleanup warning
9+
---
10+
11+
> [!WARNING]
12+
> Deleting the resource group puts the Managed HSM into a soft-deleted state. The Managed HSM continues to be billed until it's purged. See [Managed HSM soft-delete and purge protection](/azure/key-vault/managed-hsm/recovery)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.subservice: managed-hsm
6+
ms.topic: include
7+
ms.date: 03/13/2026
8+
# Include: Managed HSM intro description
9+
---
10+
11+
Managed HSM is a fully managed, highly available, single-tenant, standards-compliant cloud service that enables you to safeguard cryptographic keys for your cloud applications, using **FIPS 140-3 Level 3** validated HSMs. For more information on Managed HSM, review the [Overview](/azure/key-vault/managed-hsm/overview).
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.subservice: managed-hsm
6+
ms.topic: include
7+
ms.date: 03/13/2026
8+
# Include: DefaultAzureCredential explanation table
9+
---
10+
11+
`DefaultAzureCredential` automatically selects the appropriate credential based on your environment:
12+
13+
| Environment | Credential used |
14+
|-------------|-----------------|
15+
| Azure VMs, App Service, Functions | System-assigned or user-assigned managed identity |
16+
| Azure Kubernetes Service | Workload identity |
17+
| Local development | Azure CLI, Visual Studio, or VS Code credentials |
18+
| CI/CD pipelines | Workload identity federation or service principal |
19+
20+
The credential checks these sources in order:
21+
1. Environment variables
22+
2. Workload identity
23+
3. Managed identity
24+
4. Azure CLI
25+
5. Azure PowerShell
26+
6. Visual Studio / VS Code credentials
27+
28+
For production workloads in Azure, managed identities are strongly recommended because they eliminate credential management entirely.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.subservice: managed-hsm
6+
ms.topic: include
7+
ms.date: 03/13/2026
8+
# Include: Managed HSM SDK prerequisites
9+
---
10+
11+
- An Azure subscription. [Create one for free](https://azure.microsoft.com/free/).
12+
- A provisioned and activated Managed HSM. See [Quickstart: Provision and activate a managed HSM using Azure CLI](/azure/key-vault/managed-hsm/quick-create-cli).
13+
- A key created in your Managed HSM. See [Manage keys in a Managed HSM](/azure/key-vault/managed-hsm/key-management).
14+
- An Azure resource with a managed identity (such as a VM, App Service, or Azure Function) or Azure CLI for local development.
15+
- The managed identity must have the appropriate Managed HSM local RBAC role assigned. See [Secure access to your managed HSMs](/azure/key-vault/managed-hsm/how-to-secure-access).
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.subservice: managed-hsm
6+
ms.topic: include
7+
ms.date: 03/13/2026
8+
# Include: Managed HSM role assignment CLI example
9+
---
10+
11+
## Assign Managed HSM roles
12+
13+
For your application to access keys, assign the appropriate Managed HSM local RBAC role to your managed identity:
14+
15+
```azurecli
16+
# Get the principal ID of your managed identity
17+
principalId=$(az vm identity show --name myVM --resource-group myRG --query principalId -o tsv)
18+
19+
# Assign the Crypto User role for key operations
20+
az keyvault role assignment create \
21+
--hsm-name ContosoMHSM \
22+
--role "Managed HSM Crypto User" \
23+
--assignee $principalId \
24+
--scope /keys
25+
```
26+
27+
For more information on roles and permissions, see [Managed HSM local RBAC built-in roles](/azure/key-vault/managed-hsm/built-in-roles).
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
author: msmbaldwin
3+
ms.author: mbaldwin
4+
ms.service: azure-key-vault
5+
ms.subservice: managed-hsm
6+
ms.topic: include
7+
ms.date: 03/13/2026
8+
# Include: Security domain RSA key pair generation prerequisites
9+
---
10+
11+
To activate your HSM, you need:
12+
13+
- A minimum of three RSA key pairs (maximum 10)
14+
- The minimum number of keys required to decrypt the security domain (called a *quorum*)
15+
16+
You send at least three (maximum 10) RSA public keys to the HSM. The HSM encrypts the security domain with these keys and sends it back. Once the security domain download completes successfully, your HSM is ready to use. You also need to specify the quorum, which is the minimum number of private keys required to decrypt the security domain.
17+
18+
The following example shows how to use `openssl` to generate three self-signed certificates:
19+
20+
```console
21+
openssl req -newkey rsa:2048 -nodes -keyout cert_0.key -x509 -days 365 -out cert_0.cer
22+
openssl req -newkey rsa:2048 -nodes -keyout cert_1.key -x509 -days 365 -out cert_1.cer
23+
openssl req -newkey rsa:2048 -nodes -keyout cert_2.key -x509 -days 365 -out cert_2.cer
24+
```
25+
26+
The certificate expiration date doesn't affect security domain operations—even an "expired" certificate can still be used to restore the security domain.
27+
28+
> [!IMPORTANT]
29+
> These RSA private keys are the root of trust for your Managed HSM. For production environments, generate these keys using an air-gapped system or on-premises HSM, and store them securely. See [Security domain best practices](/azure/key-vault/managed-hsm/security-domain#generating-the-rsa-key-pairs-securely) for detailed guidance.

articles/key-vault/managed-hsm/how-to-secure-access.md

Lines changed: 60 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ ms.custom: devx-track-azurecli
77
ms.service: azure-key-vault
88
ms.subservice: managed-hsm
99
ms.topic: how-to
10-
ms.date: 01/30/2026
10+
ms.date: 03/13/2026
1111
ms.author: mbaldwin
1212
# Customer intent: As a managed HSM administrator, I want to set access control and configure the Managed HSM, so that I can ensure it's secure and auditors can properly monitor all activities for this Managed HSM.
1313
---
@@ -144,6 +144,63 @@ storage_account_principal=$(az storage account show --id $storageresource --quer
144144
az keyvault role assignment create --hsm-name ContosoMHSM --role "Managed HSM Crypto Service Encryption User" --assignee $storage_account_principal
145145
```
146146

147+
## Configure Privileged Identity Management for just-in-time access
148+
149+
For highly sensitive environments, use [Microsoft Entra Privileged Identity Management (PIM)](/entra/id-governance/privileged-identity-management/pim-configure) to enforce just-in-time access for the Managed HSM Administrator role. PIM reduces the attack surface by eliminating standing administrative privileges.
150+
151+
### Prerequisites for PIM integration
152+
153+
- Microsoft Entra ID P2 or Microsoft Entra ID Governance license
154+
- Privileged Role Administrator or Global Administrator role in Microsoft Entra ID
155+
156+
### Enable PIM for Managed HSM Administrator role
157+
158+
1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com).
159+
160+
1. Navigate to **Identity governance** > **Privileged Identity Management** > **Microsoft Entra roles**.
161+
162+
1. Select **Roles** and search for roles that include "Managed HSM". While the data plane roles (Managed HSM Administrator, Crypto User, etc.) are managed through Managed HSM local RBAC, you can use PIM for the control plane **Managed HSM Contributor** role.
163+
164+
1. Select the role and configure:
165+
- **Activation maximum duration**: Set to a limited time window (for example, 4-8 hours)
166+
- **Require justification**: Enable to require users to provide a reason for activation
167+
- **Require approval**: Enable and specify approvers from your security team
168+
- **Require MFA**: Enable for an additional security layer
169+
170+
### Use Microsoft Entra security groups with PIM
171+
172+
For data plane roles managed through Managed HSM local RBAC, combine PIM with Microsoft Entra security groups:
173+
174+
1. Create a Microsoft Entra security group for HSM administrators (for example, "Contoso HSM Admins").
175+
176+
1. Assign the Managed HSM Administrator role to this security group:
177+
178+
```azurecli-interactive
179+
az keyvault role assignment create --hsm-name ContosoMHSM \
180+
--assignee $(az ad group show -g 'Contoso HSM Admins' --query 'id' -o tsv) \
181+
--scope / --role "Managed HSM Administrator"
182+
```
183+
184+
1. Configure the security group as PIM-eligible in Microsoft Entra admin center:
185+
- Navigate to **Identity governance** > **Privileged Identity Management** > **Groups**
186+
- Select **Discover groups** and add "Contoso HSM Admins"
187+
- Configure activation settings (duration, approval, MFA)
188+
189+
1. When administrators need access, they activate their group membership through PIM, which temporarily grants them the Managed HSM Administrator role.
190+
191+
### Monitor PIM activations
192+
193+
Configure alerts for PIM role activations to maintain visibility:
194+
195+
1. In Microsoft Entra admin center, navigate to **Privileged Identity Management** > **Microsoft Entra roles** > **Alerts**.
196+
197+
1. Configure alerts for:
198+
- Roles being activated too frequently
199+
- Roles being assigned outside of PIM
200+
- Eligible assignments being created
201+
202+
For comprehensive security monitoring, integrate these alerts with [Microsoft Sentinel](sentinel.md) alongside your Managed HSM audit logs.
203+
147204
## Considerations for production environments
148205

149206
This tutorial demonstrates a simplified scenario to illustrate access control implementation.
@@ -156,6 +213,8 @@ Adjust permissions for your managed HSM based on your specific requirements. In
156213
- For a getting-started tutorial for an administrator, see [What is Managed HSM?](overview.md)
157214
- For more information about usage logging for Managed HSM logging, see [Managed HSM logging](logging.md).
158215
- To learn about managing roles in Managed HSM, see [Managed HSM local RBAC](role-management.md).
216+
- Learn about [Microsoft Entra Privileged Identity Management](/entra/id-governance/privileged-identity-management/pim-configure).
217+
- Review [Secure your Azure Managed HSM deployment](secure-managed-hsm.md).
159218
- See [Azure RBAC documentation](/azure/role-based-access-control/overview).
160219
- See [Azure RBAC: Built-in roles](/azure/role-based-access-control/built-in-roles).
161220
- See [Manage Azure RBAC with Azure CLI](/azure/role-based-access-control/role-assignments-cli).

articles/key-vault/managed-hsm/key-management.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ To complete the steps in this article, you must have the following items:
2727
* A Microsoft Azure subscription. If you don't have one, you can sign up for a [free trial](https://azure.microsoft.com/pricing/free-trial).
2828
* The Azure CLI version 2.25.0 or later. Run `az --version` to find the version. If you need to install or upgrade, see [Install the Azure CLI]( /cli/azure/install-azure-cli).
2929
* A managed HSM in your subscription. See [Quickstart: Provision and activate a managed HSM using Azure CLI](quick-create-cli.md) to provision and activate a managed HSM.
30+
* To access keys using Azure SDKs, see [.NET](quickstart-dotnet.md) | [Python](quickstart-python.md) | [JavaScript](quickstart-javascript.md)
3031

3132
[!INCLUDE [cloud-shell-try-it.md](~/reusable-content/ce-skilling/azure/includes/cloud-shell-try-it.md)]
3233

articles/key-vault/managed-hsm/quick-create-cli.md

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -84,25 +84,7 @@ Your Azure account is now authorized to perform any operations on this Managed H
8484

8585
All data plane commands are disabled until the HSM is activated. For example, you are not able to create keys or assign roles. Only the designated administrators that were assigned during the create command can activate the HSM. To activate the HSM, you must download the [Security Domain](security-domain.md).
8686

87-
To activate your HSM, you need:
88-
- To provide a minimum of three RSA key-pairs (up to a maximum of 10)
89-
- To specify the minimum number of keys required to decrypt the security domain (called a *quorum*)
90-
91-
To activate the HSM, you send at least three (maximum 10) RSA public keys to the HSM. The HSM encrypts the security domain with these keys and sends it back. Once this security domain download is successfully completed, your HSM is ready to use. You also need to specify quorum, which is the minimum number of private keys required to decrypt the security domain.
92-
93-
The following example shows how to use `openssl` to generate three self-signed certificates.
94-
95-
```azurecli-interactive
96-
openssl req -newkey rsa:2048 -nodes -keyout cert_0.key -x509 -days 365 -out cert_0.cer
97-
openssl req -newkey rsa:2048 -nodes -keyout cert_1.key -x509 -days 365 -out cert_1.cer
98-
openssl req -newkey rsa:2048 -nodes -keyout cert_2.key -x509 -days 365 -out cert_2.cer
99-
```
100-
101-
> [!NOTE]
102-
> Even if the certificate has "expired," it can still be used to restore the security domain.
103-
104-
> [!IMPORTANT]
105-
> Create and store the RSA key pairs and security domain file generated in this step securely.
87+
[!INCLUDE [Security domain prerequisites](../includes/managed-hsm/security-domain-prereqs.md)]
10688

10789
Use the `az keyvault security-domain download` command to download the security domain and activate your Managed HSM. The following example uses three RSA key pairs (only public keys are needed for this command) and sets the quorum to two.
10890

0 commit comments

Comments
 (0)