Skip to content

Commit 0fce57a

Browse files
authored
Merge pull request #53031 from R-C-Stewart/refresh-security-storage
End to end module refresh
2 parents b42fcae + 5c28a4e commit 0fce57a

13 files changed

Lines changed: 417 additions & 220 deletions
Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
This module is designed to provide administrators with the knowledge and skills required to plan and implement comprehensive security measures for Azure storage resources, safeguarding data integrity, confidentiality, and availability.
1+
This module is designed to provide administrators with the knowledge and skills required to plan and implement comprehensive security measures for Azure storage resources, safeguarding data integrity, confidentiality, and availability. You learn how to apply Zero Trust security principles to Azure Storage. Zero Trust security ensures every access request is verified and that data is protected through multiple layers of defense.
22

33
## Scenario
44

5-
Imagine you are an Azure storage administrator responsible for managing storage resources in your organization's Azure environment. Your organization relies on Azure storage services for storing sensitive data, and you need to ensure that this data is protected against unauthorized access and data security threats.
5+
Imagine you're an Azure storage administrator responsible for managing storage resources in your organization's Azure environment. Your organization handles sensitive customer data, financial records, and intellectual property across various Azure storage services. Recent security audits and compliance requirements demand that you implement robust security controls, including identity-based authentication, encryption key management, and data protection policies. You need to ensure that this data is protected against unauthorized access, accidental deletion, and emerging security threats while maintaining compliance with industry regulations.
66

77
## Learning objectives
88

9-
By the end of this module, you will be able to:
9+
By the end of this module, you'll be able to:
1010

11-
- Plan and implement security strategies for Azure storage resources to protect data at rest and in transit.
12-
- Configure access control for storage accounts to manage permissions effectively.
13-
- Manage the life cycle of storage account access keys to maintain security.
14-
- Select and configure appropriate methods for access to Azure Files, Blob Storage, Tables, and Queues based on specific use cases.
15-
- Implement security measures such as soft delete, backups, versioning, and immutable storage to protect against data security threats.
16-
- Configure Bring Your Own Key (BYOK) to enhance data encryption and key management.
17-
- Enable double encryption at the Azure Storage infrastructure level to provide an additional layer of security.
11+
- Plan and implement security strategies for Azure storage resources based on Zero Trust principles to protect data at rest and in transit.
12+
- Configure identity-based access control using Microsoft Entra ID for storage accounts to manage permissions effectively.
13+
- Manage the lifecycle of storage account access keys and implement key rotation policies to maintain security.
14+
- Select and configure appropriate authentication methods for Azure Files, Blob Storage, Tables, and Queues based on specific use cases and security requirements.
15+
- Implement comprehensive data protection measures including soft delete, backups, versioning, immutable storage, and point-in-time restore to protect against data loss and security threats.
16+
- Configure customer-managed encryption keys using Bring Your Own Key (BYOK) with Azure Key Vault to enhance data encryption and key management control.
17+
- Enable infrastructure encryption (double encryption) at the Azure Storage infrastructure level to provide another layer of security for compliance requirements.
1818

1919
## Goals
2020

21-
The module aims to equip you with the knowledge and expertise necessary to design, implement, and manage a comprehensive security strategy for Azure storage resources. Participants will be able to secure data at rest and in transit, manage access control effectively, and implement encryption and data protection measures to ensure the security of critical data assets.
21+
This module equips you with the knowledge and expertise necessary to design, implement, and manage a comprehensive security strategy for Azure storage resources aligned with modern security best practices. You learn to apply defense-in-depth principles by implementing multiple layers of security controls. Upon completion, you are able to secure data at rest and in transit using encryption. You can manage access control effectively through identity-based authentication and role-based access control (RBAC). Then you implement automated key rotation and lifecycle management, and configure advanced data protection measures to meet organizational security and compliance requirements. You explore how to make informed decisions about authorization methods, balancing security requirements with operational needs, while following Microsoft's recommended security baseline for Azure Storage.
Lines changed: 63 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,66 @@
11
## Scenario
22

3-
A Key Vault customer would like to securely transfer a key from their on-premises Hardware Security Module (HSM) outside Azure, into the HSM backing Azure Key Vault. The process of importing a key generated outside Key Vault is referred to as Bring Your Own Key (BYOK).
3+
A Key Vault customer would like to securely transfer a key from their on-premises Hardware Security Module (HSM) outside Azure, into the HSM backing Azure Key Vault. The process of importing a key generated outside Key Vault is referred to as **Bring Your Own Key (BYOK)**.
4+
5+
**Why BYOK matters for security**: Many organizations require control over their encryption keys for compliance, regulatory requirements, or security policies. BYOK allows you to maintain control over the entire key lifecycle, from generation to destruction, while using Azure's cloud infrastructure. Also, BYOK aligns with Zero Trust principles by maintaining cryptographic separation between your key material and cloud providers until you explicitly authorize the transfer.
46

57
The following are the requirements:
68

7-
- The key to be transferred never exists outside an HSM in plain text form.
8-
- Outside an HSM, the key to be transferred is always protected by a key held in the Azure Key Vault HSM.
9+
- **The key to be transferred never exists outside an HSM in plain text form** - Ensuring that even during the transfer process, the key material remains protected.
10+
- **Outside an HSM, the key to be transferred is always protected by a key held in the Azure Key Vault HSM** - Providing cryptographic assurance that only Azure Key Vault can unwrap the imported key.
911

1012
## Terminology
1113

1214
| **Key Name** | **Key Type** | **Origin** | **Description** |
1315
| ---------------------- | ------------------------------- | ------------------- | ------------------------------------------------------- |
14-
| Key Exchange Key (KEK) | RSA | Azure Key Vault HSM | An HSM backed RSA key pair generated in Azure Key Vault |
15-
| Wrapping Key | AES | Vendor HSM | An \[ephemeral\] AES key generated by HSM on-premises |
16+
| Key Exchange Key (KEK) | RSA | Azure Key Vault HSM | An HSM-backed RSA key pair generated in Azure Key Vault |
17+
| Wrapping Key | AES | Vendor HSM | An ephemeral AES key generated by on-premises HSM |
1618
| Target Key | RSA, EC, AES (Managed HSM only) | Vendor HSM | The key to be transferred to the Azure Key Vault HSM |
1719

18-
Key Exchange Key (KEK): This is a customer-generated, HSM-backed key within the key vault intended for the import of the BYOK (Bring Your Own Key) key. The KEK should have the following properties:
20+
**Key Exchange Key (KEK)**: A customer-generated, HSM-backed key within the key vault intended for the import of the BYOK (Bring Your Own Key) key. The KEK should have the following properties:
1921

20-
- It must be an RSA-HSM key, with a size of 4096-bit, 3072-bit, or 2048-bit.
21-
- Its key operations (key\_ops) are limited to 'import', allowing its use exclusively during the BYOK process.
22-
- It must reside in the same vault where the Target Key is to be imported.
22+
- **It must be an RSA-HSM key**, with a key size of 4,096 bits (recommended), 3,072 bits, or 2,048 bits.
23+
- **Its key operations (key_ops) are limited to 'import'**, allowing its use exclusively during the BYOK process. This restriction minimizes the attack surface.
24+
- **It must reside in the same vault where the Target Key is to be imported**, ensuring proper key vault isolation.
2325

2426
## User steps
2527

2628
To perform a key transfer:
2729

28-
1. Generate KEK.
29-
2. Retrieve the public key of the KEK.
30-
3. Using HSM vendor provided BYOK tool, import the KEK into the target HSM and exports the Target Key protected by the KEK.
31-
4. Import the protected Target Key to Azure Key Vault.
30+
1. **Generate KEK** - Create a Key Exchange Key in Azure Key Vault.
31+
2. **Retrieve the public key of the KEK** - Download the public portion for use with your HSM vendor tools.
32+
3. **Using HSM vendor-provided BYOK tool**, import the KEK into the target HSM and export the Target Key protected by the KEK.
33+
4. **Import the protected Target Key to Azure Key Vault** - Complete the transfer using Azure CLI or PowerShell.
3234

33-
Customers use the BYOK tool and documentation provided by HSM vendor to complete Steps 3. It produces a Key Transfer Blob (a ".byok" file).
35+
Customers use the BYOK tool and documentation provided by the HSM vendor to complete Step 3. This process produces a Key Transfer Blob (a ".byok" file) that securely encapsulates the encrypted key material.
3436

3537
## HSM constraints
3638

37-
The existing HSM may apply constraints on key that they manage, including:
39+
The existing HSM may apply constraints on keys that they manage, including:
3840

39-
- The HSM may need to be configured to allow key wrap-based export<br>
40-
- The target key may need to be marked **Cryptoki Attribute (CKA)**\_EXTRACTABLE for the HSM to allow controlled export
41-
- In some cases, the KEK and wrapping key may need to be marked as CKA\_TRUSTED, which allows it to be used to wrap keys in the HSM.
41+
- The HSM needs to be configured to allow key wrap-based export.
42+
- The target key is marked **CKA_EXTRACTABLE** (Cryptoki Attribute) for the HSM to allow controlled export.
43+
- In some cases, the KEK and wrapping key are marked as **CKA_TRUSTED**, which allows them to be used to wrap keys in the HSM.
4244

4345
The configuration of source HSM is, generally, outside the scope of this specification. Microsoft expects the HSM vendor to produce documentation accompanying their BYOK tool to include any such configuration steps.
4446

4547
> [!NOTE]
46-
> Several of these steps can be performed using other interfaces such as Azure PowerShell and Azure portal. They can also be performed programmatically using equivalent functions in Key Vault SDK.
48+
> These steps can be performed using multiple interfaces including Azure CLI (shown in examples), Azure PowerShell, and the Azure portal. They can also be performed programmatically using the Azure Key Vault SDK for automated deployment scenarios.
4749
4850
### Generate KEK
4951

50-
Use the **az keyvault key create** command to create KEK with key operations set to import. Note down the key identifier 'kid' returned from the below command.
52+
Use the **az keyvault key create** command to create KEK with key operations set to import. Note the key identifier ('kid') returned from this command, as you need it for subsequent operations.
5153

5254
```azurecli
5355
az keyvault key create --kty RSA-HSM --size 4096 --name KEKforBYOK --ops import --vault-name ContosoKeyVaultHSM
54-
55-
56-
57-
5856
```
5957

60-
Services support different KEK lengths; Azure SQL, for instance, only supports key lengths of 2048 or 3072 bytes.
58+
> [!IMPORTANT]
59+
> Different Azure services support different KEK lengths. For example, Azure SQL supports key lengths of 2048 bits or 3072 bits only. Always verify the key size requirements for your specific service before generating the KEK.
6160
62-
### Retrieve the public key of the KEK<br>
61+
### Retrieve the public key of the KEK
6362

64-
Download the public key portion of the KEK and store it into a PEM file.
63+
Download the public key portion of the KEK and store it as a PEM (Privacy-Enhanced Mail) file. This file is used with your HSM vendor's BYOK tool.
6564

6665
```azurecli
6766
az keyvault key download --name KEKforBYOK --vault-name ContosoKeyVaultHSM --file KEKforBYOK.publickey.pem
@@ -71,24 +70,52 @@ az keyvault key download --name KEKforBYOK --vault-name ContosoKeyVaultHSM --fil
7170
7271
```
7372

74-
## Generate key transfer blob using HSM vendor provided BYOK tool<br>
73+
## Generate key transfer blob using HSM vendor-provided BYOK tool
7574

76-
Use the HSM Vendor provided BYOK tool to create a key transfer blob (stored as a ".byok" file). KEK public key as a **.Privacy-Enhanced Mail** (.pem file) will be one of the inputs to this tool.
75+
Use the HSM vendor-provided BYOK tool to create a key transfer blob (stored as a ".byok" file). The KEK public key, in **Privacy-Enhanced Mail** (.pem) format is one of the inputs to this tool. Consult your HSM vendor's specific documentation for detailed instructions on using their BYOK tool.
7776

7877
### Key Transfer Blob
7978

80-
Long term, Microsoft would like to use PKCS\#11 CKM\_RSA\_AES\_KEY\_WRAP mechanism to transfer the target key to Azure Key Vault since this mechanism produces a single blob and, more importantly, the intermediate AES key is handled by the two HSMs and is guaranteed to be ephemeral. This mechanism isn't presently available in some HSMs but the combination of protecting the target key with CKM\_AES\_KEY\_WRAP\_PAD using an AES key and protecting the AES key with CKM\_RSA\_PKCS\_OAEP produces an equivalent blob.
79+
Long term, Microsoft would like to use PKCS\#11 CKM\_RSA\_AES\_KEY\_WRAP mechanism to transfer the target key to Azure Key Vault. The PKCS#11 mechanism produces a single blob and, more importantly, the intermediate AES key is handled by the two HSMs and is guaranteed to be ephemeral.
8180

8281
The target key plaintext depends on the key type:
8382

84-
- For an RSA key, the private key ASN.1 DER encoding \[RFC3447\] wrapped in PKCS\#8 \[RFC5208\]
85-
- For an EC key, the private key ASN.1 DER encoding \[RFC5915\] wrapped in PKCS\#8 \[RFC5208\]
86-
- For an octet key, the raw bytes of the key
83+
- For an RSA key, the private key ASN.1 DER encoding \[RFC3447\] wrapped in PKCS\#8 \[RFC5208\]
84+
- For an EC key, the private key ASN.1 DER encoding \[RFC5915\] wrapped in PKCS\#8 \[RFC5208\]
85+
- For an octet key, the raw bytes of the key
8786

8887
The bytes for the plaintext key are then transformed using the CKM\_RSA\_AES\_KEY\_WRAP mechanism:
8988

90-
- An ephemeral AES key is generated and encrypted with the wrapping RSA key using RSA-OAEP with SHA1.
91-
- The encoded plaintext key is encrypted using the AES key using AES Key Wrap with Padding.
92-
- The encrypted AES key and the encrypted plaintext key are concatenated to produce the final ciphertext blob.
89+
- An ephemeral AES key is generated and encrypted with the wrapping RSA key using RSA-OAEP with SHA1.
90+
- The encoded plaintext key is encrypted using the AES key using AES Key Wrap with Padding.
91+
- The encrypted AES key and the encrypted plaintext key are concatenated to produce the final ciphertext blob.
9392

9493
The format of the transfer blob uses JSON Web Encryption compact serialization (RFC7516) primarily as a vehicle for delivering the required metadata to the service for correct decryption.
94+
95+
## Best practices for implementing BYOK
96+
97+
When implementing Bring Your Own Key for Azure Key Vault, consider these security and operational recommendations:
98+
99+
- **Use the largest key size supported** - Generate KEKs with 4096-bit key sizes whenever possible, as they provide the strongest cryptographic protection. Only use smaller key sizes when required by specific service constraints.
100+
101+
- **Limit KEK key operations** - Always restrict KEK operations to 'import' only. You minimize the attack surface and ensures the KEK can't be misused for other cryptographic operations.
102+
103+
- **Maintain HSM security certifications** - Ensure your on-premises HSM meets FIPS 140-2 Level 2 or higher certification standards, matching or exceeding Azure Key Vault's security level.
104+
105+
- **Secure the transfer process** - Protect the .byok file during transfer to Azure. While the key material is encrypted, the file should still be treated as sensitive and transmitted over secure channels.
106+
107+
- **Document your BYOK implementation** - Maintain detailed documentation of which keys were imported via BYOK, their purposes, and the HSM configurations used. Documentation is critical for compliance audits and disaster recovery.
108+
109+
- **Test the import process** - Before importing production keys, test the entire BYOK workflow with test keys to ensure compatibility between your HSM vendor's tools and Azure Key Vault.
110+
111+
- **Plan for key rotation** - Establish procedures for rotating BYOK keys. While you can't export keys from Azure Key Vault, you can import new versions and update dependent services.
112+
113+
- **Use Managed HSM for sensitive workloads** - For highly regulated environments requiring single-tenant HSM isolation, consider Azure Key Vault Managed HSM, which supports BYOK and provides enhanced control.
114+
115+
- **Implement access controls** - Use Azure role based access control (RBAC) to restrict who can perform BYOK operations. Separate the permissions for creating KEKs from permissions who can import target keys.
116+
117+
- **Enable audit logging** - Turn on Azure Key Vault logging and monitoring to track all BYOK operations, including KEK generation, key downloads, and target key imports. Integrate logs with Azure Monitor or a SIEM solution.
118+
119+
- **Verify vendor support** - Before purchasing or implementing an HSM solution, verify that the vendor provides a BYOK tool compatible with Azure Key Vault's current requirements.
120+
121+
- **Consider hybrid architectures carefully** - BYOK is ideal when you need to maintain keys on-premises initially and then migrate to Azure, or when regulatory requirements mandate specific key generation procedures.

0 commit comments

Comments
 (0)